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

running Java program created with Eclipse plugin fails to open report

$
0
0

I created a CR 2008 report and using the Eclipse plug-in I created a Java program to drive data through the report and export the resulting reports as pdf files.

 

This process works just fine if I run the Java program in Eclipse. I copied the code to a server to run the application remote.

 

The program fails at the point of opening the Crystal Report. This is the error.

 

D:\src>java EDIInvoice

Current date : 2009928-

Report output name is : D:\src\report\Invoice2009928-45462829.pdf

com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: com/ibm/icu/util/Ca

lendar---- Error code:-2147467259 Error code name:failed

        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.<init>(Unknown Source)

 

This is the code

 

public class EDIInvoice {

 

     private static final String REPORT_NAME = "D:
src
CR8Invoice.rpt";

           

     public static void launchApplication() {

     try

     {

        FileInputStream in = new FileInputStream("D:
src
ghxInv.txt");

        BufferedReader br = new BufferedReader(new InputStreamReader(in));

        String strLine;

        Calendar cal = new GregorianCalendar();

        int month = cal.get(Calendar.MONTH);

        int year = cal.get(Calendar.YEAR);

        int day = cal.get(Calendar.DAY_OF_MONTH);

        String today = (year + "" + (month + 1) + "" + day + "-");

        System.out.println("Current date : " + today);

              

// Read the file one line at a time

        while ((strLine = br.readLine()) != null)  

              {

            String patternStr = ",";

            String[] fields = strLine.split(patternStr);

            String EXPORT_FILE = "D:
src
report
Invoice" + today + fields[1] + ".pdf";

            String Company  = fields[0];

            String Invoice = fields[1];

            String PO_number  = fields[2];

                   System.out.println("Report output name is : " + EXPORT_FILE);

     try {

                                                   

//Open report.

     ReportClientDocument reportClientDoc = new ReportClientDocument();

     reportClientDoc.open(REPORT_NAME, 0);

     System.out.println("Opened the report");

 

As you can see the first 2 println statements worked fine, but the 3rd one failed. The program was not able to open the report.

 

Is there a reason the code can not run without Eclipse?


Viewing all articles
Browse latest Browse all 893

Trending Articles



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