#1 2024-06-18 06:26:58

dkwfung
Member
Registered: 2024-04-25

Issue of export excel for jasperreport

Hi,

I have 2 problems when I export excel in jasperreport.

1, There are 3 columns for 1 record in excel when I export the jasperreport to excel.  Below screen capture is for your reference.
1.jpg

I want 1 record in 1 column in excel when I export the jasperreport.  Please let to know how to change the setting in reportserver

2, There are lot of blank column in excel when I export the jasperreport to excel if the report is more than 1 page.  Below screen capture is for your reference.
2.jpg

I want to export excel in jasperreport without blank column.  Please let to know how to change the setting in reportserver

Thank you

Last edited by dkwfung (2024-06-18 06:33:04)

Offline

#2 2024-06-18 15:33:39

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Issue of export excel for jasperreport

Hi dkwfung,

please note that the Excel export of Jasper reports essentially "draws" the report into Excel. This is handled by the Jasper engine and can vary in quality, as seen in the screenshots you provided.

To address this, ReportServer offers a "Plain Excel" option. By setting a datasource, you can achieve a cleaner, more straightforward Excel export that does not attempt to render the pixel-perfect layout of the report. Please consider using this option.

Bildschirmfoto-2024-06-18-um-17-32-00.png

Note that you have to select the "Excel (plain)" export:
Bildschirmfoto-2024-06-18-um-17-39-15.png

Regards,
Eduardo

Offline

#3 2024-06-19 02:11:02

dkwfung
Member
Registered: 2024-04-25

Re: Issue of export excel for jasperreport

Hi Eduardo,

Thanks for your help.

I enabled the "Plain Excel" option and select the "Excel (plain)" to export the report.

Below error is for your reference.  Thank you

Error: An error occurred during report execution.
The report could not be executed: OracleDatabaseException: ORA-00918: column ambiguously defined
To get help please contact an administrator.
Details
Report could not be executed. {"error":"OracleDatabaseException: ORA-00918: column ambiguously defined\n","report_id":512492,"report_name":"Contract Details","base_report_id":512492,"base_report_name":"Contract Details","executing_user_id":6,"report_output_format":"TABLE_EXCEL","report_uuid":"ba787d94-e855-4b34-81ea-fa7bbd20ad30"} net.datenwerke.rs.core.service.reportmanager.exceptions.ReportExecutorException: The report could not be executed: OracleDatabaseException: ORA-00918: column ambiguously defined at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:275) at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:161) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.executeReport(ReportExportServlet.java:563) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.doExportReport(ReportExportServlet.java:444) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.exportReport(ReportExportServlet.java:367) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.exportReportViaSession(ReportExportServlet.java:358) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet.doGet(ReportExportServlet.java:162) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$1918281469.GUICE$TRAMPOLINE() at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:74) at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:64) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:75) at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:112) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:75) at com.google.inject.internal.InterceptorStackCallback.invoke(InterceptorStackCallback.java:55) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$1918281469.doGet() at javax.servlet.http.HttpServlet.service(HttpServlet.java:655) at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$1918281469.GUICE$TRAMPOLINE() at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:74) at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:112) at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:75) at com.google.inject.internal.InterceptorStackCallback.invoke(InterceptorStackCallback.java:55) at net.datenwerke.rs.core.server.reportexport.ReportExportServlet$$EnhancerByGuice$$1918281469.service() at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:290) at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:280) at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:184) at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:89) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85) at com.google.inject.persist.PersistFilter.doFilter(PersistFilter.java:94) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82) at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:121) at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:133) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: net.datenwerke.rs.core.service.reportmanager.exceptions.ReportExecutorException: The report could not be executed: OracleDatabaseException: ORA-00918: column ambiguously defined at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:275) at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:161) at net.datenwerke.rs.incubator.service.jaspertotable.hookers.JasperTableExecutorHook.executeReport(JasperTableExecutorHook.java:49) at net.datenwerke.rs.core.service.reportmanager.engine.ReportEngine.execute(ReportEngine.java:134) at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:246) ... 50 more Caused by: net.datenwerke.rs.core.service.reportmanager.exceptions.ReportExecutorException: Query could not be executed: ORA-00918: column ambiguously defined at net.datenwerke.rs.base.service.datasources.table.impl.TableDBDataSource.open(TableDBDataSource.java:274) at net.datenwerke.rs.base.service.reportengines.table.TableReportEngine.createReport(TableReportEngine.java:278) at net.datenwerke.rs.base.service.reportengines.table.TableReportEngine.doExecuteNormal(TableReportEngine.java:200) at net.datenwerke.rs.base.service.reportengines.table.TableReportEngine.doExecuteNormal(TableReportEngine.java:155) at net.datenwerke.rs.base.service.reportengines.table.TableReportEngine.doExecute(TableReportEngine.java:86) at net.datenwerke.rs.core.service.reportmanager.engine.ReportEngine.execute(ReportEngine.java:146) at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:246) ... 54 more Caused by: java.sql.SQLSyntaxErrorException: ORA-00918: column ambiguously defined at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:494) at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:446) at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1054) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:623) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:252) at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:612) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:226) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:59) at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:747) at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:904) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1082) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3780) at oracle.jdbc.driver.T4CPreparedStatement.executeInternal(T4CPreparedStatement.java:1343) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3822) at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1165) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:1471) at net.datenwerke.rs.base.service.datasources.table.impl.TableDBDataSource.open(TableDBDataSource.java:269) ...

Last edited by dkwfung (2024-06-20 01:49:01)

Offline

#4 2024-06-19 07:18:09

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Issue of export excel for jasperreport

Hi dkwfung,

the error is: ORA-00918: column ambiguously defined

so your query is incorrect. https://www.tekstream.com/resource-cent … ghtforward.

Regards,
Eduardo

Offline

#5 2024-06-25 10:01:57

dkwfung
Member
Registered: 2024-04-25

Re: Issue of export excel for jasperreport

Dear Eduardo,

Thanks for the prompt reply.  I tried to set isStretchWithOverflow="true" or textAdjust="StretchHeight" in textField of my jasperreport.

The exported excel has problem.  There are 3 rows for 1 record in excel.  It seems both setting do not work.

Please advise.

For your information, I have a lot of impact when I use the "Excel (plain)" to export the report, so I cannot use "Excel (plain)".

Thank you

Regards,

David

Offline

Board footer

Powered by FluxBB