views:

833

answers:

3

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.]

A: 

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.

Dusty
@Dusty: Thanks for the reply! We actually do use separate report designs, one for PDF/Word output, and one for excel. This problem only occurs on the excel version of the report. They want to see the row height expanded in the excel so that they can read the entire thing.
RMorrisey
I apologize. I misread the question. I am not aware of a way to have the Excel report export to the correct height without resizing. I'll think on it for a bit and I'll delete this comment and edit my response if I come up with something.
Dusty
No problem! At least from that I know somebody else read it and is thinking about it =) It is a good suggestion but one we already have put in. I asked the project lead about changing the format, so the issue may end up becoming moot; but keeping my eyes open for a solution.
RMorrisey
A: 

You can try some excel-like reporting tool. As I know, RAQ Report is a free professional excel-like reporting tool.

You can get free RAQ Report at http://www.raqsoft.com/ and have a try.

A: 

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
scott
Scott - thanks for your feedback, however I wasn't looking to change reporting tools. I do hope others who read this find the information useful. See my edit above.
RMorrisey