Hello all,
I want to auto adjust cell length (cell length should get increase when data length is increase) when i export jasper report to excel format. Please anybody let me know how to do this?
It is possible with DynamicJasper. So I guess it should also possible in JasperReports.
11 Answers:
shamphadtale
Wrote:
Hello all, I want to auto adjust cell length (cell length should get increase when data length is increase) when i export jasper report to excel format. Please anybody let me know how to do this? It is possible with DynamicJasper. So I guess it should also possible in JasperReports. |
You can set this two properties in the Jrxml, and set the isStretchWithOverflow to false:
Thanks yyun!
Setting isStreachWithOverFlow to false affects View of report. Viewer shows truncated data. If this property is true data get wrapped to next line, so showing whole data. I am using single Jrxml file and creating different kinds of report using JRSaveContributor. So how can i set isStreachWithOverflow to false only for Excel reports?
When we open exported CSV file in Microsoft Excel, is it possible to provide auto resizing of cell to it by setting some property or by some java code?
Regards,
Sham P.
Post Edited by shamphadtale at 09/23/2011 08:56
Hello Sham,
The (row and column) autofit properties were not introduced in the 4.1.3 release, but in the present they are in the testing phase. They will be rendered fully functional in the near future.
Other 2 resizing properties were made available in 4.1.3:
net.sf.jasperreports.export.xls.column.width
net.sf.jasperreports.export.xls.column.width.ratio
Maybe one of these 2 will be helpful in resizing cells as you need, until the autosize will be part of the JR release.
Hope this helps,
sanda
When I open exported CSV report in Microsoft Excel, data does not display properly. I need to use excel functionality Format ---> AutoFit Column Width for getting data display neatly. Does jasper report has some property by which column lengh get adjusted automatically when CSV report is open in Microsoft Excel?
OR
For CSV are there any similar properties like -
Hi Sham,
There are no equivalent properties for CSV format, because CSV files don't store such layout information. For instance, try to run Format ---> AutoFit Column Width for a column in a CSV file, save the modified CSV and close it. Open again the CSV file and see that the autofit setting is gone. If you try to manually set the column width, you'll get the same result.
CSV are designed to store data only, any format setting is dropped when the file is saved.
Regards,
sanda