Problem while converting to excle file from jasper

0

Hi all,

I have created a jasper template file for generating excel report. I want to query some data from DB and dispay it in my generated excel file. I can able to generate the file but the problem is there is somuch of blank spaced in the page. I am generating the report for department wise. so, if only one member is present in the department, I need the full page for that department and the remaining details will load to the next page. These all are working.

Attached a screenshot of the file.

From the image, you can see that the report starting from the position A and ends up in cell position CS.

It is not loaded in continuous cells. I can see that so many blank cells in the generated file. How can I create the excle by loading the values in continuous cell.

Regards,

Joby Joseph
 

Attachments: 
jobz.joseph's picture
Joined: Jan 14 2014 - 1:10am
Last seen: 5 years 4 months ago

1 Answer:

1

Hi Joby ,

This is happening because, the excel export takes the white space in the report as a column, as you say that there is an requirement of Header also, that will contain columns which correspond to whitespaces.

It is adviced, that the reports exported in Excel should rather shred the header, and the text feilds placed in the detail section or anywhere for that matter should be continuous in nature

 

Hope that this helps

Thanks
Ankur Gupta
http://ankurthetechie.blogspot.in/

Ankur Gupta's picture
Joined: Jan 21 2013 - 10:36pm
Last seen: 2 months 1 week ago

Hi Ankur,

Thank you for your advice. I will check the design and will try it.
Thank you.

jobz.joseph - 5 years 10 months ago

Hi Ankur,
I need a small help. I am trying to remove the spaces between the data in Jasper report. suddenly, I got an error.

500 Internal Server Error
java.lang.IllegalArgumentException: The 'to' row (20) must not be less than the 'from' row (36) at org.apache.poi.hssf.model.Sheet.addMergedRegion(Sheet.java:445) at org.apache.poi.hssf.usermodel.HSSFSheet.addMergedRegion(HSSFSheet.java:561) at net.sf.jasperreports.engine.export.JRXlsExporter.createMergeRegion(JRXlsExporter.java:611) at net.sf.jasperreports.engine.export.JRXlsExporter.initCreateCell(JRXlsExporter.java:560) at net.sf.jasperreports.engine.export.JRXlsExporter.createTextCell(JRXlsExporter.java:550) at net.sf.jasperreports.engine.export.JRXlsExporter.exportText(JRXlsExporter.java:410) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportPage(JRXlsAbstractExporter.java:590) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReportToStream(JRXlsAbstractExporter.java:463) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReport(JRXlsAbstractExporter.java:186) at pkgIncentiveWeb.EmpIncentiveDvnReportAction.execute(EmpIncentiveDvnReportAction.java:235) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65) at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)

What is this error. any idea?

Regards,

Joby Joseph

jobz.joseph - 5 years 10 months ago
Feedback