views:

412

answers:

3

How do i increase the width of a column in jasper reports dynamically in java, i have tried changing many things in java side like reading the style sheet and changing the values. But in this case i don't know how to initialize the method which will read the width and change it.

A: 

Try the Jasper Forge forums.

Dave Jarvis
A: 

0

down vote hi ,i hv some problem in jasper report.

suppose i hv colum address..

                   address 

                 Abd,XYS,qwew 

i want to show the above value like below pattern

                   address 

                    Abd, 
                    XYS, 
                   qwew 

how to show this file.i hv one jrxml file wr i design the report design and one java file wr fill the report. if any body hv any idea pls send me mail at [email protected]

puneet
+1  A: 

Lets say your report variable is called jasperReport

JasperReport jasperReport;

You need to get the band (JRBand) your column is in. Assuming it is in the detail band:

JRBand band = jasperReport.getDetail();

And then find your column and change it's width:

JRElement column = band.getElementByKey("key_for_column");
column.setWidth(123);
Tjazo