Results 1 to 3 of 3
  1. #1
    sams is offline Member
    Join Date
    May 2010
    Posts
    2
    Rep Power
    0

    Default Calling a crystal report from swing form

    Hello,
    I am calling a report (created in crystal reports) from swings GUI, report is called successfully without errors but information displayed in reports is missing while those values are displayed in views when i see from data base ( mysql):Kindly help me in this regard , following is the code:

    public static void showViewer ()
    {
    CallReport viewerFrame = showViewerFrame ();
    boolean success=false;
    try {
    success = viewerFrame.showReport();
    } catch (SQLException ex) {

    //Logger.getLogger(TestReport.class.getName()).log(L evel.SEVERE, null, ex);
    }
    if (!success) {
    viewerFrame.closeViewer ();
    }
    }
    static CallReport showViewerFrame ()
    {
    CallReport viewerFrame = new CallReport();
    viewerFrame.setVisible (true);
    // Start the viewer
    viewerFrame.reportViewer.start ();
    return viewerFrame;
    }

    private boolean showReport () throws SQLException
    {
    reportClientDocument = new ReportClientDocument ();
    conn = new DBConnection();
    stmt = new DBStatement();
    try {

    resultSet = (stmt.getStatement(conn.getConnection())).executeQ uery(QUERY);


    } catch (SQLException ex) {
    Logger.getLogger(CallReport.class.getName()).log(L evel.SEVERE, null, ex);
    }

    try {
    reportClientDocument.setReportAppServer(ReportClie ntDocument.inprocConnectionString);
    reportClientDocument.open(REPORT_PATH, OpenReportOptions._openAsReadOnly);

    } catch (ReportSDKException e) {

    }

    String tableAlias = reportClientDocument.getDatabaseController().getDa tabase().getTables().getTable(0).getName(); reportClientDocument.getDatabaseController().setDa taSource(resultSet, tableAlias, "tableAlias");

    if (reportClientDocument != null) {
    setReportSource ();
    return true;
    }
    }
    catch (ReportSDKException e)
    {
    String localizedMessage = e.getLocalizedMessage ();
    int errorCode = e.errorCode ();
    String message = localizedMessage + "\nError code: " + errorCode;
    JOptionPane.showMessageDialog (CallReport.this, message, title, JOptionPane.WARNING_MESSAGE);
    }
    }

  2. #2
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Default

    I'm afraid we can't help you with just placing your code.
    Besides, we don't know the logic you want the program to achieve.
    You may post our SSCCE for us to understand better your concern.
    Every project, package, class, method, variable, syntax, algorithm, etc.
    are registered in my memory bank. Thanks to this thread.

  3. #3
    sams is offline Member
    Join Date
    May 2010
    Posts
    2
    Rep Power
    0

Similar Threads

  1. Crystal Report in Netbeans
    By endx in forum NetBeans
    Replies: 4
    Last Post: 02-20-2014, 07:37 AM
  2. unable to import jar files (crystal report 11)
    By kishore101 in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 02-25-2009, 07:51 AM
  3. tips on crystal report
    By kishore in forum New To Java
    Replies: 1
    Last Post: 01-20-2009, 03:23 AM
  4. Crystal report with JSP
    By fred in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 12-17-2008, 08:27 PM
  5. Crystal Report with Java
    By Jack in forum Advanced Java
    Replies: 2
    Last Post: 07-02-2007, 01:39 PM

Posting Permissions

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