Jump to content
We've recently updated our Privacy Statement, available here ×

Excel cell autoadjustment


shamphadtale

Recommended Posts

  • Replies 11
  • Created
  • Last Reply

Top Posters In This Topic

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:

 

<property name="net.sf.jasperreports.print.keep.full.text" value="true"/>

 

<property name="net.sf.jasperreports.export.xls.wrap.text" value="false"/>

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 2 months later...

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

 

Link to comment
Share on other sites

 

 

 

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 -

 

net.sf.jasperreports.export.xls.column.width

net.sf.jasperreports.export.xls.column.width.ratio

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...