I'm attempting to create an excel spreadsheet using BIRT. The spreadsheet is a crosstab mapping two objects together. The number of rows and columns are dynamic based on values in a MySQL database. Currently I have a working implementation of the report for PDF output. Now, I am trying to create a second version of the report for Excel.
I have copied the report design and begun adjusting it to work with Excel. Everything looks good, but only the first 3 columns are displayed after the header. All rows appear correctly.
I have tried the following:
I tried setting Overflow to Visible on every element on the page. This had no effect.
I tried setting the master page's height and width to ridiculously large values. All of the information displayed correctly, but I am hoping for a solution without hard coded values. In the future the data width might exceed my arbitrary value again and be cut off.
I am constrained in the following ways:
I am not able to switch reporting engines (I have to use BIRT).
I am not able to switch Excel emitters.
This blog entry mentions my problem:
http://www.spudsoft.co.uk/2011/10/the-spudsoft-birt-excel-emitters/
but it does not offer a solution other than an emitter switch. The specific quote is "The files also have problems with page layout that I could not work around (specifically wide reports would be cut off)."
Beyond the one blog entry my googlefu has failed me. Any help is appreciated! Thank you!
There are two questions here. The first one is relatively easy, the second is complex.
1.Why is my Cross tab being cut off in Excel?
2.How do I dynamically adjust the master page width based on the number of columns in the report at runtime?
A1: The Cross tab is being cut off because column widths have been manually set, where the number of columns will expand past the set width of the Master page. Anytime you grab report design element and adjust, BIRT assumes you know what your doing and does not override your setting.
The solution is to recreate the report element (Table or Cross Tab) and not manually adjust any sizes. When run in HTML or Excel all the columns will be automatically set to display in the available master page width.
Screen shot of a BIRT 4.2 Cross Tab, Report Item with a 2 inch master page width and 30 columns
A2: This is not easy, and I will not be providing the answer at this time. I will point toward the solution and identify a couple of the road blocks. A valid solution to this question must include a functioning solution using the Sample Database.
(as of BIRT 4.2.1)
Challenge1 - The Master Page Width is set BIRT Report Scripting in events prior to report Table or Cross Tab item being completed. You can not simply count how many columns are in the report;
If you wanted to count, columns --
Report Design intialize
columnCount = 0;
Cross Tab, onCreate
columnCount ++;
In my research there are two paths suggested for counting columns prior to the Cross Tab item being created. Either
Run the data set in the beforeFactory (this means two queries to the data base, one to count and one for the report), then get a count and use it.
Calculate the value in your intial query and harvest it in the Data Set, onFetch.
I followed the Data Set, onFetch, option using a computed column but did not get it working.
Challenge2 - The Width Property of the Master Page must be set on or before the Report Design, beforeRender. With the beforeFactory being the most often recommended. Additionally the Width Property of the Master Page is only available when the Master Page "Type" is set to "Custom", in my attempts I set this manually in the Property Editor General.
Passing Values from the onFetch to beforeFactory must be done using a PersistentGlobalVariable which can only pass strings, not integers. I found all kinds of way for this to not work. Even passing "12in" in PersistentGlobalVariable failed to adjust the master page Width
Either of these codes in beforeFactory will adjust the Master Page Width (when Type = Custom)
Pass the Value
reportContext.getReportRunnable().designHandle.getDesignHandle().findMasterPage("Simple MasterPage").setProperty("width","12in");
Calculate a value and pass it
increaseWidth = 20;
reportContext.getReportRunnable().designHandle.getDesignHandle().findMasterPage( "Simple MasterPage").setProperty("width",((2+increaseWidth)+"in"));
In the end I have been unable to find or create a functional report that adjusts the Master Page Width passed on the number columns generated at report run time. I think it is possible, but doing so is beyond my current skills.
Related
I have used Excel for quite some time now but only using traditional formulas. Now I am trying to create a more elaborated document for my business using VBA coding to expand my possibilities.
I have done some research and started practicing but found something that I can’t understand how to do yet.
I have a worksheet with a table on it. Since this is a fresh document it has nothing but the header and a blank row below it. What I always did when writing the information was type text in any of the columns that belong to the row immediately below the table (without actually inserting a new row myself). This creates a new row for the table where most of its format is kept, such as text size and formulas. However, I noticed that the row height doesn’t automatically change to that of the previous rows of the table, and changing it manually for each new row is very time consuming.
I would really appreciate it if anyone could share me the necessary Excel VBA code to fix this issue. I have thought of two possible approaches. The first one is a code that automatically sets all the rows of the table to a height of 20 (I want all rows to be the same size so no problem with that), supposing this would also affect new rows as I add them the way I mentioned. The second one would be a code that automatically sets every new row of the table to a size of 20. It doesn’t matter which one you choose, the easiest will be just fine. Thanks in advance.
I am encountering an very unusual behavior while rendering a SSRS report in EXCEL format. I have a simple SSRS report with one parameter (Country).It has only one tablix (table) with no report header and footer. This report will be generated by executing a SSIS package. The SSIS package will pass the country parameter (one parameter at a time) and invoke the data driven subscription associated with the report. Three reports will be generated in Excel format in the specific location provided for each parameter passed. Say, one report for parameter India, one for Pakistan and final one for Srilanka. After the report generation, Sometimes I find that the last row is hidden in any one or all of three reports generated. So, I converted the specification of table height & width, row height and column width from inches to pt as per the workaround suggested by Microsoft. But, it is behaving in unusual pattern after this modification too. Sometimes the report has no hidden last row and sometimes it has. Please note that every time, I have used the same sample data for this report generation.
Also, I have changed below properties of textboxes in tablix as per suggestion in one of the workaround post
Padding - 2pt,2pt,0pt,0pt
Vertical align - Middle
Can grow - false
an shrink - false
And tried increasing the row height from 15pt to 22pt. But above same unusual behavior persists. I have attached the screenshots of report design and sample report here Did anyone experienced this issue before. Any suggestions on this issue will be really helpful.
Report Design
Here row 10045 is hidden
After spending around an hour, I figured out the fix for it.
As mentioned by Microsoft the row height/width measurement has to be in points.
The main part is you have to apply it for all the cells of the tablix. Select ALL the cells and Press F4 to get the properties window and do the required changes in points (shown below).
Note: The default height of excel row is 14.4pt.
I have been facing the same issue, what I did to fix:
1. Converted all the size from cms to pts, page size, report size, columns size, row size, tablix size.
2. It didnt work even after changing row height to 14.2pt, because font was verdana 10pt, and for that minimum 14.3pt is needed in excel
3. I have changed row height to 14.3 pt, and now it works always. No more hidden rows.
Hope this helps.
We have a report which looks like this:
If I then go Actions>Export>Excel I get the following:
Unfortunately the number circled is misleading. This column is a count of users - so if the same user was in several months they should only be counted in the total as 1.
I assume out-of-the-box it adds the excel outline whenever we include the expansion/collapse (+/-) functionality in the report.
Is there a way in the rdl file to stop RS's export functionality of adding the outline?
That Outline behaviour in Excel is triggered by the ToggleItem property in SSRS. You cannot set this with an Expression. Therefore I would remove the ToggleItem property from all textboxes.
Instead I would use Bookmarks and/or DocumentMap functionality - these achieve similar results and generally work better across a broad range of rendered output formats.
I have a simple Reporting Services report, a simple table, created with BIDS 2005, with the report wizard.
I run the report on a RS2008 R2 server as is and it renders perfectly.
When I export to Excel, an extra row is appended just below the table. The row is hidden and has a heigth of 409.5.
Where that row comes from ?
How to get rid of it ?
*nb - no extra row if run on a RS2005 server
The only way I found to eliminate the hidden row is change the layout of the report. I increased the height of all rows of from 0,53333cm to 0,538cm.
Anything less than 0,538cm doesn’t solve the issue.
According to Microsoft, the goal when exporting to excel is to match the visual appearance of the report as close as possible. The excel output may have unexpected things like extra rows or columns or merged cells as part of the process to match the layout.
Changing the tablix location to 0cm, 0cm , will fix the problem.
I was running into this issue and tried all the posted solutions I could find, but none worked for me. To be more specific, after exporting the SSRS report to excel there was an extra row that contained duplicated data from the first row of the group. This extra row was contained in a group that could be toggled and when that group was collapsed that extra row was still showing instead of nothing.
This was the report layout looked like before I made the change.
What I had to do was add an extra row above and outside the nested grouping by right clicking the group box and selecting "Add row" -> "Outside Group - Above"
Here is the report after.
After adding the rows outside the group there was no duplicated data in an extra row.
Try to change the Size of report(not table) to 0.0pt, 0.0pt.It will automatically set it to minimum required.
I have a SQL Server Reporting Services report that has several layers of groups. The groups have footers but no headers. Each sub-group's visibility is initially hidden and can be toggled from a cell in the footer of its parent group.
The report renders fine in the browser. However, when I export to Excel the groupings are wrong. With three layers of groups the last item in the second layer is not collapsable in Excel. The last item in the third layer is collapsable but not initially collapsed like it should be and is in the browser.
Is there anything I can do differently to make this work?
I do not have a high enough rep to add comments so I am posting my comment here.
Do you summation expressions in those lines like this.
=sum(Fields!MyField.Value)
I have noticed with excel that it has no way to conditionally represent a summation like the one above when you collapse a group.
This means that the information has to go somewhere, as excel will not truncate information, and is represented by the addition of a line with the summation the same as the =sum() expression in excel.