Results 1 to 7 of 7
  1. #1
    hitesh is offline Member
    Join Date
    Jul 2010
    Posts
    28
    Rep Power
    0

    Exclamation problem with calling .rpt file

    Hi
    I m using crystalreport to generate reports. But I unable to call report files from java.
    I m trying the code as follows-

    import java.awt.BorderLayout;

    import javax.swing.JFrame;

    import com.crystaldecisions.ReportViewer.ReportViewerBean ;
    import com.crystaldecisions.reports.sdk.ReportClientDocum ent;
    import com.crystaldecisions.sdk.occa.report.reportsource. IReportSource;

    public class JRCPrintReport
    {
    private static void createAndShowGUI()
    {
    try
    {
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(false);

    //Create and set up the window.
    JFrame frame = new JFrame("Report");
    frame.setTitle( "Testing 1, 2, 3");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E);

    ReportViewerBean viewer = new ReportViewerBean();
    viewer.init( new String[0], null, null, null);

    ReportClientDocument rpt = new ReportClientDocument();
    rpt.open( "report1.rpt", 0 );

    IReportSource rptSource = rpt.getReportSource();
    viewer.setReportSource( rptSource );

    frame.getContentPane().add( viewer, BorderLayout.CENTER );
    frame.setSize( 700, 500 );
    frame.setVisible(true);

    viewer.start();
    }
    catch ( Exception exception )
    {
    System.out.println( exception.toString() );
    }
    }

    public static void main(String[] args)
    {
    javax.swing.SwingUtilities.invokeLater(new Runnable()
    {
    public void run()
    {
    createAndShowGUI();
    }
    });
    }
    }





    the errors are-

    1. ERROR in JRCPrintReport.java (at line 5)
    import com.crystaldecisions.ReportViewer.ReportViewerBean ;
    ^^^^^^^^^^^^^^^^^^^^
    The import com.crystaldecisions cannot be resolved
    ----------
    2. ERROR in JRCPrintReport.java (at line 6)
    import com.crystaldecisions.reports.sdk.ReportClientDocum ent;
    ^^^^^^^^^^^^^^^^^^^^
    The import com.crystaldecisions cannot be resolved
    ----------
    3. ERROR in JRCPrintReport.java (at line 7)
    import com.crystaldecisions.sdk.occa.report.reportsource. IReportSource;
    ^^^^^^^^^^^^^^^^^^^^
    The import com.crystaldecisions cannot be resolved
    ----------
    4. ERROR in JRCPrintReport.java (at line 23)
    ReportViewerBean viewer = new ReportViewerBean();
    ^^^^^^^^^^^^^^^^
    ReportViewerBean cannot be resolved to a type
    ----------
    5. ERROR in JRCPrintReport.java (at line 23)
    ReportViewerBean viewer = new ReportViewerBean();
    ^^^^^^^^^^^^^^^^
    ReportViewerBean cannot be resolved to a type
    ----------
    6. ERROR in JRCPrintReport.java (at line 26)
    ReportClientDocument rpt = new ReportClientDocument();
    ^^^^^^^^^^^^^^^^^^^^
    ReportClientDocument cannot be resolved to a type
    ----------
    7. ERROR in JRCPrintReport.java (at line 26)
    ReportClientDocument rpt = new ReportClientDocument();
    ^^^^^^^^^^^^^^^^^^^^
    ReportClientDocument cannot be resolved to a type
    ----------
    8. ERROR in JRCPrintReport.java (at line 29)
    IReportSource rptSource = rpt.getReportSource();
    ^^^^^^^^^^^^^
    IReportSource cannot be resolved to a type



    I will be very thank full if anybody help me

  2. #2
    hitesh is offline Member
    Join Date
    Jul 2010
    Posts
    28
    Rep Power
    0

    Default

    Anybody plz help me .......
    I m in big trouble............

  3. #3
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,802
    Rep Power
    19

    Default

    It can't find the jar file containing those imports.
    How do you run this?

  4. #4
    hitesh is offline Member
    Join Date
    Jul 2010
    Posts
    28
    Rep Power
    0

    Default

    Then plz give me some java code through which i can run .rpt file with parameters
    plz.........................plz................... ....

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    For heaven's sakes, stop begging and please answer Tolls question. This has nothing to do with giving you Java code and all to do with classpath. Again, you need to answer Toll's question.

  6. #6
    hitesh is offline Member
    Join Date
    Jul 2010
    Posts
    28
    Rep Power
    0

    Default

    where I get those jar files????????????????

  7. #7
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,802
    Rep Power
    19

    Default

    No idea where you get them from.
    You wrote this code so I would (normally) presume you knew what it was you were writing.

    I don't think I've ever written something without actually having the libraries I needed to compile it. I might have occasionally forgotten to stick them on my classpath, but that's about it.

Similar Threads

  1. Calling a .dll file
    By kiros88 in forum New To Java
    Replies: 1
    Last Post: 07-16-2010, 09:43 PM
  2. Problem with calling php script from java file
    By eldushyant in forum Advanced Java
    Replies: 1
    Last Post: 04-28-2010, 12:56 PM
  3. calling a class in another file
    By MauveMV in forum New To Java
    Replies: 0
    Last Post: 04-11-2010, 02:59 PM
  4. calling a jar file from within java application
    By robby14 in forum Advanced Java
    Replies: 3
    Last Post: 03-10-2010, 08:11 PM
  5. calling another call file
    By Yaya B in forum New To Java
    Replies: 1
    Last Post: 12-21-2007, 06:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •