Reporting Services export to Excel causes 'Repair' and removes styles - excel

I have quite a complex SSRS report that I would like to export to Excel more or less how it looks in the web output.
Export to Excel and opening in Excel 2010 yields the following error:
Excel was able to open the file by repairing or removing the unreadable content.
Removed part: /xl/styles.xml part (Styles)
All the styling is gone from the report, so it looks terrible.

After isolation testing it I have fixed 99% of the style errors by one simple change:
Excel doesn't seem to like 'Total' cells for Row Groups within tables having no Font='' (these cells are auto-created when you create a total for a group)
Font=", 10pt, Default, Bold, Default"
Change Font to "Arial":
Font="Arial, 10pt, Default, Bold, Default"

Another thing to look for if all of your textboxes have a font name is the Format Property. I had a date field that I wanted formatted, so, in the Format field, I used =Format(Fields!CreatedDate.Value, "MM/dd/yyyy"). This worked when viewing the report, however, when exporting, received the unreadable content error. I eventually just used: MM/dd/yyyy in the format property, that solved my problem.

In my case, I fixed this by preventing a divide-by-zero.
For some weird reason, instead of failing to render a divide-by-zero, it displays the word Infinity.

Related

Pentaho Report Designer: Change column value if output-format is excel

Helo, I have report, where I show some photos. However, if the report is generated as Excel output, I don't want to have the photos there, because the size of generated file is too big in that case.
Because of that, I want to have those columns empty, if the output format is Excel (or, even not HTML would work). I have tried to do it through excel:formula in Attributes section of the cell, but it did not work (I guess, it is because its the formula of that excel cell.
I have also tried to create Open formula with IF statement, but wasn't able to find any way how to give it output-format as an parameter.
Is there any way how to solve this issue? How to change value of a cell depending on output-format? I been trying to find it in Pentaho documentation, but no luck so far..
Select the element you don't want to show and under size & position -> visible, add an OpenFormula by clicking the (+) and add a formula like this:
=NOT(ISEXPORTTYPE("table/excel"))
The available export types can be looked up at Master Report -> Attributes -> output-format.
When previewing as e.g. "HTML" and "Excel", the output format will automatically be set accordingly, so you can simply hit preview without changing that value every time.

Stop SSRS adding Excel "Outline" when exporting to Excel

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.

Specify Excel 'Display Format' while importing data

I'm currently using an excel document as a template for generating a report. This is done by first specifying an 'Xml Map' in Excel and then importing data against it. The report generation works fine.
The problem is that I want the display format on the cell to be 'General' and not 'Text' after the import. I came across this link (yes, Excel 2007)
http://office.microsoft.com/en-gb/excel-help/xml-schema-definition-xsd-data-type-support-HP010206414.aspx#BMxsdexport
The link specifies that Excel will set string data from the xml import to display as 'Text' by default. I need this to be displayed as 'General' instead. Is there a way to do this?
The only solution I've come up with so far is to use a macro to change the display format after opening the document but if I can do it using only Excel settings it would be better.
Try to use the text import feature: http://office.microsoft.com/en-us/excel-help/text-import-wizard-HP010102244.aspx
NOTE: the important step that should address your need is the "Column data format" section, which often gets overlooked as it is the last step of the import. I hope that helps.
The mapping cannot be changed.
http://social.technet.microsoft.com/Forums/en-US/fdf99171-0a53-4716-9e72-25afc36ddf90/specify-excel-display-format-while-importing-data

Large Excel File From SSRS Sorting

A SSRS 2005 report that is run by multiple users is generating about 45,000+ records and then being exported to Excel. This is working fine, but when the users try to sort/filter the results they are seeing a huge amount of lag. At first I thought that it was just because of the large number of rows, but we found that when we stripped all of the formatting from the Excel file the report sorted and filtered quickly. Is this a common problem any of you have seen and how would you resolve it? They need the formatting to stay on the main report, so if I could somehow export without formatting that would be ideal.
Thanks!
There are only three settings you can set for the ReportViewer excel renderer.
See Excel Device Info
Unfortunately, none of which will omit formatting in your exported report.
The only thing I can suggest is that you strip out all the formatting from the RDLC report file, prior to exporting.

CrystalReports excel field cut off when using CanGrow=True

I am working on an excel report in CrystalReports, in VS2005. I have a field in the Details section which can have up to 255 characters of text, and I want the height of the row in excel to expand so that the entire text can be seen initially when the report is generated.
I set CanGrow=True in the field's properties, and the field does seem to grow; the field is only one line (Height=159), but many of the rows display multiple, wrapped lines of text. Some rows intermittently have the bottem half of the last line of text cut off; the user has to expand the row a little bit to see it. There doesn't seem to be a particular field length that causes this - in one case, it has four lines total in the output, and in another case, it has only three.
Can anyone suggest what might be the cause of this, or how I could work around it?
Thanks in advance for any help you guys can offer.
[Edit: I am no longer working on this project, so I never found out what became of this setting. Most likely it wasn't fixed, since it's not a critical issue.]
One solution to this issue that I've come up with in the past is to have two separate reports. One for display and exporting to pdfor rtf and another report for exporting to Excel.
I know in general this is not a good approach because there is the possibility for data to be different in the export than the display report, but if careful it works well.
I have a situation where a client needs data printed in a specific format on a report, but there is way to much data to physically be able to fit on a page. We worked out a solution that I run a "display version" of the report that fits most of the data, but the rest of the data necessary for there client is added only to the "Excel version" of the report.
To do this I simply load the "display report" to the report viewer as you normally would, but when you go to export the report I load the "excel report" with the same parameters as the "display report" and call the code to export the data to Excel.
By using this method the "display report" can be formatted any way necessary without having to worry about messing up the export to excel. The excel report fields can then be made a smaller size than required by the display report because the data should export even regardless of the size of the field. Doing this allows you to fit more data on the Excel export report.
Since both reports use the same datasource you will have an issue if you make a change that you have to remember to go verify the database on each report to see the new database changes, but this method allows you to include more data and in a different format than the display version of the report.
Hope this helps.
While not a solution for Crystal (I don't know of one), as part of the reporting team at GrapeCity-Data Dynamics, we've worked with similar issues taking free-form reports to excel spreadsheets for a decade. In our Data Dynamics Reports product we came up with a completely new way of solving the problem of exporting reports to excel.
We allow you to create a template for the report output. The template is a basic excel file with place holders for the various textboxes (or other controls) and regions (tables, lists, etc.) in the report. You can open this template inside of excel and modify the properties of the cells and rows. In the scenario you describe, you can export a "template" from Data Dynamics Reports and then modify the autosize property of the row in the template containing the placeholder for the textbox you're struggling with.
When you export the report to excel next time, just specify the template to Data Dynamics Reports (which can be done programmatically and transparently to the end user) and Data Dynamics Reports will honor all settings you specified in the template.
This is hard to explain so there is a ~2 minute screencast that shows this feature at our website in the following location:
http://www.datadynamics.com/Products/DDRPT/ScreencastViewer.aspx?ID=XLS01
For more information about the product and for a free trial download visit: http://www.datadynamics.com/DataDynamicsReports
Scott Willeke
GrapeCity - Data Dynamics

Resources