Quantcast
Channel: SCN : Popular Discussions - SAP Crystal Reports, version for Eclipse
Viewing all articles
Browse latest Browse all 893

Using Excel as Data Source for Crystal Reports (with Java SDK)

$
0
0

Hi,

I already tried to find similar topics here but was more or less unable to fix my problem with the suggestion I found so far.

I would like to create a report with a excel file as data source. All my current attempts fail with the following exception "com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(719):  detected an exception: Error finding JNDI name (E:\SampleSalesData.xls)"

 

This is my current approach:

final ReportClientDocument boReportClientDocument = new ReportClientDocument();
boReportClientDocument.setLocale(Locale.US);
boReportClientDocument.newDocument();
final String fullPathToExcelFile = "E:\\SampleSalesData.xls"
final ConnectionInfo boConnectionInfo = new ConnectionInfo();
final PropertyBag boPropertyBag = boConnectionInfo.getAttributes();
boPropertyBag.put("Server Type", "Access/Excel (DAO)");
boPropertyBag.put("Database Type", "Excel 8.0");
boPropertyBag.put("Database DLL", "crdb_dao.dll");
boPropertyBag.put("System Database Path", "");
boPropertyBag.put("Session UserID", "");
boPropertyBag.put("PreQEServerName", fullPathToExcelFile);
boPropertyBag.put("Database Name", fullPathToExcelFile);
boPropertyBag.put("Server Name", fullPathToExcelFile);
boPropertyBag.put("JNDIOptionalName", fullPathToExcelFile);
boPropertyBag.put("Trusted_Connection", false);
boPropertyBag.put("Use JDBC", false);
boConnectionInfo.setAttributes(boPropertyBag);
// Set the DB Username and Pwd
boConnectionInfo.setUserName(null);
boConnectionInfo.setPassword("");
boConnectionInfo.setKind(ConnectionInfoKind.SQL);
// [...]

 

Once I have added the datasoruce I add a filed to the report and would like to export as PDF (this works fine).

The current StatckTrace looks like this:

2015-09-14 16:35:54,191 ERROR [MAIN] com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(719):  detected an exception: Error finding JNDI name (E:\SampleSalesData.xls)

        at com.crystaldecisions.reports.queryengine.Connection.t4(SourceFile:3024)

        at com.crystaldecisions.reports.dataengine.dfadapter.DFAdapter.a(SourceFile:697)

        at com.crystaldecisions.reports.dataengine.dfadapter.DFAdapter.for(SourceFile:707)

        at com.crystaldecisions.reports.reportdefinition.ReportHelper.a(SourceFile:198)

        at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.long(SourceFile:957)

        at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.a(SourceFile:635)

        at com.businessobjects.reports.sdk.requesthandler.ReportViewingRequestHandler.int(SourceFile:672)

        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1943)

        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:660)

        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:166)

        at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:528)

        at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:526)

        at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(SourceFile:102)

        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(SourceFile:524)

        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:423)

        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(SourceFile:351)

        at com.businessobjects.sdk.erom.jrc.a.a(SourceFile:54)

        at com.businessobjects.sdk.erom.jrc.a.execute(SourceFile:67)

        at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(SourceFile:716)

        at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(SourceFile:125)

        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:537)

        at com.crystaldecisions.sdk.occa.report.application.ds.a(SourceFile:186)

        at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(SourceFile:1558)

        at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(SourceFile:337)

        at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.if(SourceFile:223)

        at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:147)

        at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:128)

        at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(SourceFile:111)

        at EXPORT...

 

Any help on how to resolve this Problem is highly appreciated.

 

Thanks,


Viewing all articles
Browse latest Browse all 893

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>