Use of Crystal Reports

Ok Now this may seem to be a little stupid but heres my problem:
I need to integrate a Crystal Report in my Java Application and I have no idea what so ever how to do it. Here's the case:
I have a Form in my application that receives various details about an employee and these are to be printed witht the crystal report. what i m doing here is to feed these values in the database table, and then pass a simple query to access these in my report but the problem is "HOW TO SHOW THIS REPORT IN JFRAME OF MY APPLICATION"
any help will be highly appreciated!!!

I'd hate to look like advertising for a product, especially a product that I have never used myself, but there exists a "Crystal report dor Eclipse", that is supposed to provide an "SDK that enables report creation and modification with Java code". Have you evaluated that?
If this doesn't fit, well, you have to consider that we (most of us at least) are not users of Crystal Reports, so you'd better give us more info about what does CR generate. It is easy to display an image in Swing, as mentioned below, it is also relatively easy to display an HTML document, it's reasonably easy to display a PDF report. The techniques will vary, so do the study about what output can be generated and come back with a more precise question.
Eventually, you should consider your requirement: "these are to be printed witht the crystal report" can be interpreted in a number of ways (one of them being: "From the Java app, run "CrystalReport in interactive mode" command line, the user will just have to click on the "print" icon).

Similar Messages

  • RE: What's database field are used in crystal report file?

    Hi all
    Please help me a C# code that using Crystall Report API (Crystal Report XI- Develop license) to get the list of database fieldname that using in crystal Report file. (What's database field using in header section ,group section , detail section of report.....)
    We looking forward to hearing from you
    Thanks
    Son

    Hello Son,
    please use this code below to get a list of used database fields in a report :
    //File Name:          CS_Get_report_data_out_inproc.sln
    //Created:            April 11, 2008
    //Author ID:          FLI
    //Purpose:            This C# .NET sample Windows application demonstrates
    //                  how to retrieve report data and put the into a XML file
    //                  using unmanaged RAS.
    // Note this is available without a dedicated RAS with SP2 for XI R2
    using System;
    using System.IO;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.ReportAppServer.ClientDoc;
    using CrystalDecisions.ReportAppServer.Controllers;
    using CrystalDecisions.ReportAppServer.DataDefModel;
    namespace CS_Get_report_data_out_inproc
        public partial class Form1 : Form
            // CR Declarations
            ReportDocument boReportDocument;
            ISCDReportClientDocument boReportClientDocument;
            public Form1()
                InitializeComponent();
                //Create a new ReportDocument
                boReportDocument = new ReportDocument();
                // load the RPT file
                boReportDocument.Load("..
    ReportData.rpt");
                // show in reportviewer
                crystalReportViewer1.ReportSource = boReportDocument;
            private void button1_Click(object sender, EventArgs e)
                //Access the ReportClientDocument in the ReportDocument (EROM bridge)
                boReportClientDocument = boReportDocument.ReportClientDocument;
                // Retrieve the Rowset Controller
                RowsetController boRowsetController = boReportClientDocument.RowsetController;
                // Retrieve the metadata (column headers) - this allows you to only retrieve the data that is on the report.
                RowsetMetaData boRowsetMetaData = new RowsetMetaData();
                Fields boFields = boReportClientDocument.DataDefinition.ResultFields;
                boRowsetMetaData.DataFields = boFields;
                // Now print out the data in XML file
                //(Note: This will print out the results of formulas too)
                StreamWriter sw = new StreamWriter("C:
    ReportData.xml", false);
                sw.WriteLine("<?xml version='1.0' encoding='utf-8'?>");
                sw.WriteLine("<ReportData>");
                sw.WriteLine("<Reportheader>");
                // Print out the titles
                for (int i = 0; i < boFields.Count; i++)
                    String boFieldName = boFields<i>.Name;
                    sw.WriteLine("<ReportheaderDetail>" + boFieldName + "</ReportheaderDetail>");
                sw.WriteLine("</Reportheader>");
                //Create the cursor which lets us loop through the data
                RowsetCursor boRowsetCursor = boRowsetController.CreateCursor(null, boRowsetMetaData, 1);
                Record boRecord;
                while (boRowsetCursor.IsEOF == false)
                    sw.WriteLine("<Customer>");
                    boRecord = boRowsetCursor.CurrentRecord;
                    for (int j = 0; j < boFields.Count; j++)
                        try
                            sw.WriteLine("<Detail>" + (String)boRecord[j].ToString() + "</Detail>");
                        catch (Exception err)
                            sw.WriteLine("<Error>" + err.Message + "</Error>");
                    sw.WriteLine("</Customer>");
                    boRowsetCursor.MoveNext();
                sw.WriteLine("</ReportData>");
                // CLose the file
                sw.Close();
                MessageBox.Show("XML File 'ReportData.xml' successfully created on C:");

  • How to use a Crystal Reports Query as datasourc in an other Cristal Report

    Hi
    I would like to read a File in a CR Report, change some data and use the output as datasource  in an other Criystal Reports Report.
    Is ist possible to use a Crystal Reports Report as datasource for an other Crystal Reports Report?
    Thomas
    Edited by: Thomas Martin on Jul 18, 2011 12:44 PM

    Hi Thomas,
    Are you having Xcelsius also in your kitty??(for dynamically doing this activity)
    Xcelsius has very good writing & reading functionality and you can incorporate your crystal report data into it using live office.
    Let say you have a report in crystal , you connect that repot to live office .Let say this is REPORT named as SOURCE CR  REPORT.
    IN Xcelsius import the this SOURCE CR REPORT  report using live office connection and using GRID selector there to show tabular data.
    Xcelsius has buttons & controls  for updating and exporting the data inform of XML SOURCE FILE.
    Now you can either make xcelsius Dashboard for TARGET CR REPORT or you can make crystal Report on ADO.NET(XML) for second crystal Report.
    Search on SDN for cross usage of Crystal & Xcelsius
    regards,
    RK

  • How can I determine if PeopleSoft Queries are used in Crystal Reports

    One PeopleSoft user requested that we delete 118 Queries. How can we determine if any of these Queries are being used in Crystal Reports?

    >
    One PeopleSoft user requested that we delete 118 Queries.
    >
    Why? How would the user know, or even care, if the queries exist?
    It is not the concern of a user whether such queries exist or not. If your system has a security flaw that allows non-privileged users to executed those queries then you need to fix that flaw.
    Remove the privileges that the user has on those queries and then, for that user, the queries will not exist.
    >
    How can we determine if any of these Queries are being used in Crystal Reports?
    >
    You can't.
    How do you determine if an app has any Java code that uses the SCOTT.EMP table? You can't.

  • How to create a report with data using the Crystal Reports for Java SDK

    Hi,
    How do I create a report with data that can be displayed via the Crystal Report for Java SDK and the Viewers API?
    I am writing my own report designer, and would like to use the Crystal Runtime Engine to display my report in DHTML, PDF, and Excel formats.  I can create my own report through the following code snippet:
    ReportClientDocument boReportClientDocument = new ReportClientDocument();
    boReportClientDocument.newDocument();
    However, I cannot find a way to add data elements to the report without specifying an RPT file.  Is this possible?  I seems like it is since the Eclipse Plug In allows you to specify your database parameters when creating an RPT file.
    is there a way to do this through these packages?
    com.crystaldecisions.sdk.occa.report.data
    com.crystaldecisions.sdk.occa.report.definition
    Am I forced to create a RPT file for the different table and column structures I have? 
    Thank you in advance for any insights.
    Ted Jenney

    Hi Rameez,
    After working through the example code some more, and doing some more research, I remain unable to populate a report with my own data and view the report in a browser.  I realize this is a long post, but there are multiple errors I am receiving, and these are the seemingly essential ones that I am hitting.
    Modeling the Sample code from Create_Report_From_Scratch.zip to add a database table, using the following code:
    <%@ page import="com.crystaldecisions.sdk.occa.report.application.*"%>
    <%@ page import="com.crystaldecisions.sdk.occa.report.data.*"%>
    <%@ page import="com.crystaldecisions.sdk.occa.report.document.*"%>
    <%@ page import="com.crystaldecisions.sdk.occa.report.definition.*"%>
    <%@ page import="com.crystaldecisions.sdk.occa.report.lib.*" %>
    <%@ page import = "com.crystaldecisions.report.web.viewer.*"%>
    <%
    try { 
                ReportClientDocument rcd = new ReportClientDocument();
                rcd.newDocument();
    // Setup the DB connection
                String database_dll = "Sqlsrv32.dll";
                String db = "qa_start_2012";
                String dsn = "SQL Server";
                String userName = "sa";
                String pwd = "sa";
                // Create the DB connection
                ConnectionInfo oConnectionInfo = new ConnectionInfo();
                PropertyBag oPropertyBag1 = oConnectionInfo.getAttributes();
                // Set new table logon properties
                PropertyBag oPropertyBag2 = new PropertyBag();
                oPropertyBag2.put("DSN", dsn);
                oPropertyBag2.put("Data Source", db);
                // Set the connection info objects members
                // 1. Pass the Logon Properties to the main PropertyBag
                // 2. Set the Server Description to the new **System DSN**
                oPropertyBag1.put(PropertyBagHelper.CONNINFO_CRQE_LOGONPROPERTIES, oPropertyBag2);
                oPropertyBag1.put(PropertyBagHelper.CONNINFO_CRQE_SERVERDESCRIPTION, dsn);
                oPropertyBag1.put("Database DLL", database_dll);
                oConnectionInfo.setAttributes(oPropertyBag1);
                oConnectionInfo.setUserName(userName);
                oConnectionInfo.setPassword(pwd);
                // The Kind of connectionInfos is CRQE (Crystal Reports Query Engine).
                oConnectionInfo.setKind(ConnectionInfoKind.CRQE);
    // Add a Database table
              String tableName = "Building";
                Table oTable = new Table();
                oTable.setName(tableName);
                oTable.setConnectionInfo(oConnectionInfo);
                rcd.getDatabaseController().addTable(oTable, null);
        catch(ReportSDKException RsdkEx) {
                out.println(RsdkEx);  
        catch (Exception ex) {
              out.println(ex);  
    %>
    Throws the exception
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: java.lang.NullPointerException---- Error code:-2147467259 Error code name:failed
    There was other sample code on SDN which suggested the following - adding the table after calling table.setDataFields() as in:
              String tableName = "Building";
                String fieldname = "Building_Name";
                Table oTable = new Table();
                oTable.setName(tableName);
                oTable.setAlias(tableName);
                oTable.setQualifiedName(tableName);
                oTable.setDescription(tableName) ;
                Fields fields = new Fields();
                DBField field = new DBField();
                field.setDescription(fieldname);
                field.setHeadingText(fieldname);
                field.setName(fieldname);
                field.setType(FieldValueType.stringField);
                field.setLength(40);
                fields.add(field);
                oTable.setDataFields(fields);
                oTable.setConnectionInfo(oConnectionInfo);
                rcd.getDatabaseController().addTable(oTable, null);
    This code succeeds, but it is not clear how to add that database field to a section.  If I attempt to call the following:
    FieldObject oFieldObject = new FieldObject();
                oFieldObject.setDataSourceName(field.getFormulaForm());
                oFieldObject.setFieldValueType(field.getType());
                // Now add it to the section
                oFieldObject.setLeft(3120);
                oFieldObject.setTop(120);
                oFieldObject.setWidth(1911);
                oFieldObject.setHeight(226);
                rcd.getReportDefController().getReportObjectController().add(oFieldObject, rcd.getReportDefController().getReportDefinition().getDetailArea().getSections().getSection(0), -1);
    Then I get an error (which is not unexpected)
    com.crystaldecisions.sdk.occa.report.lib.ReportDefControllerException: The field was not found.---- Error code:-2147213283 Error code name:invalidFieldObject
    How do I add one of the table.SetDataFields()  to my report to be displayed?
    Are there any other pointers or suggestions you may have?
    Thank you

  • Hide Link Button Image used in Crystal Report 2008 while printing

    Hello Experts,
    I am using Link Button of SAP B1 in Crystal Report 2008 which works perfectly. But when i am trying to export it, i am also getting the image of Link Button.
    Is there a way to hide the image while printing?
    Thanks
    Shiv

    hi Piyush,
    there are some changes in the cr viewer between 3.1 to 4.x. can you please upgrade the reports that are not working to webelements 2.47 which was built for 4.0.
    let us know how this works.
    -jamie

  • Good day sir. Im newbie in using SAP Crystal Report. I hope you can help me with my problem

    PROBLEM EXPLANATION
    Pretend that the attached excel file is a crystal report file
    Column A is the details to be compared. Column B is the details that i will have to use a formula in sap crystal report.
    as you can see cell B3 is same with the value in cell A2, B4 with A3, B5 with A4, B6 with A5 and so on.
    How can i get the previous data of column A and put it in column B using formula in crystal report? either basic or crystal syntax
    My Column
    Colmun with formula
    7000
    0
    7689
    7000
    9457
    7689
    8472
    9457
    2364
    8472
    12395
    2364
    18273
    12395
    84723
    18273
    57483
    84723
    493837
    57483
    2823747234
    493837
    226374
    2823747234
    7646363
    226374
    85826263
    7646363
    75756236324
    85826263
    1239534
    75756236324
    Message was edited by: Ludek Uher

    Hi,
    Use the 'previous()' function.
    Example:
    Previous({Column A})
    -Abhilash

  • Can Oracle materialized view be used as crystal report datasource

    Hi,
    Can we use materialized view created in Orace 10g database as the data source of crystal reports.
    I'm using Crystal reports Server 2008 V1 version. I'm unable to find the materialized view under my data connection. I can see only tables, static views and stored procedures.
    Is there a way by which I can run my reports against a materialized view created in Oracle.
    Thanks
    Thomas EL

    Hi Thomas,
    Rather than doing all of this work around to access multiple databases/servers why not create a stored procedure to do all of this for you? Search the notes area for samples on how/what CR requires to use a SP in Oracle.
    Advantages is this is done all server side and CR simply waits for the data to be returned. Even if you are using a BVM or connecting directly to the SP, both cases are server side. Database servers are much more efficient and optimized to run queries and filtering data. CR has to do the filtering on it's second pass and that causes performance delays.
    Thank you
    Don

  • Automated Solution for Exporting SQL used in Crystal Reports

    My company has created over 400 reports that are running on Crystal Reports XI. Due to proposed changes in our database, we occasionally need to review the SQL statements of all 400+ reports to determine if any of them would be impacted by the proposed changes. In order to review the SQL used in these 400+ reports, we have had to open each report manually. We would like to know how we can review the SQL used in the reports without having to manually look at each report. I suspect there is a way to either write a program or use a tool that will export the SQL that is used in all reports. In a similar vain, we would be interested in knowing if there is an automated way to identify table names and fields that are used in each SQL statement.

    I see two directions to go:
    1. Review functionalities of .rpt Inspector
    [http://www.softwareforces.com/Product/ri/pro/3/rptInspector.htm]
    - it allows rpt mass analyses
    2. Post your question to ".Net Development - Crystal Reports" forum to see if it is possible to access required information through custom application

  • Cells in SAP BW Query u2013 possible to use in Crystal Reports ?

    Hello Experts,
    we have the following scenario:
    - Crystal Reports Report (CRR) on top of a SAP BW Query which uses cells
    It seems that we cannot access the cells in Crystal Reports. Or does anyone know a way how to work with the cells ?
    Many thanks in advance for your help !
    Frank

    Hi,
    son in case you have a query with multiple structures you will see those structure in Crystal reports.
    the structure with keyfigures is being resolved in actual measures in CR and the structure with characteristics will become a single item in CR returning several rows. the cell definition itself is totally transparent to CR.
    Ingo

  • Unable to get the data from ms sql stored procedures using crystal report 10

    Dear,
    I am using the crystal report 10 and MS SQL 2000. I created stored procedures and after making the connection, i am unbale the data from that procedure. When i run stored procedure on MS SQL server it works fine.
    Please help me.
    Best Regards
    Pankaj
    [email protected]

    Dear,
    I am using the crystal report 10 and MS SQL 2000. I created stored procedures and after making the connection, i am unbale the data from that procedure. When i run stored procedure on MS SQL server it works fine.
    Please help me.
    Best Regards
    Pankaj
    [email protected]

  • Crystal report printing using epson dot matrix printer (continouos paper)

    Hi there, im tiff from the philippines.
    i have a  question on printing using a crystal report. How do i print using epson continuous printer(dot matrix)? im having a problem printing to that type of printer specially using continuous paper. the first page is correct but unfortunately the succeeding pages are not. its automatically adjusted upon reaching the second page. hope you can help me.
    thanks a lot and looking forward to hear from you soon.
    tiff

    Check with the printer manufacturer that the matrix printer is Unicode compliant. If it is not, it will  not work with Crystal Reports. If it is, make sure you have the latest printer driver updates.
    Download SP 1 for CR 102 from here;
    https://smpdl.sap-ag.de/~sapidp/012002523100006007872008E/crvs05sp1.exe
    See the following resources re. printers;
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a09051e9-721e-2b10-11b6-f9c65c64ef29
    [Note #1314394|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_dev/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]
    Ludek

  • Crystal report Using Push Method (OutOfMemoryException)

    Hello,
    i am developping reports using Sap Crystal reports , i am using the push method ( which uses a DataSet for binding informations with the reports) , and i want to display a large data, but i m getting an OutOfMemoryException, because of using the dataset,
    is there any solution to solve this problem?

    This is my code, and i think it's correct, i was using this code for previous versions of crystal report (cr10) and it worked fine,
    now i am using crystal report v 13 sp1 with visual studio 2010,
    When i used the Data set , the next page and zoom worked fine, but with stored procedure it doesn't work,
    Note: when i open the Tree of Data on the left,  then click on the next page or the zoom, it become funtional, it's very weird,
            protected void Page_Init(object sender, EventArgs e)
                if (!IsPostBack)
                    reportDocument = (ReportDocument)this.Page.Session["_reportDocument"];
                    if (reportDocument != null)
                            string rptFile = reportDocument.FileName.Split('
    ', '/').Last();
                            LoadReportRessource(reportDocument);
                                TableLogOnInfo log = new TableLogOnInfo();
                                ConnectionStringSettings conn = WebConfigurationManager.ConnectionStrings[0]; //la premiere connectionstring
                                SqlConnectionStringBuilder SConn = new SqlConnectionStringBuilder(conn.ConnectionString);
                                log.ConnectionInfo.ServerName = SConn.DataSource;
                                log.ConnectionInfo.DatabaseName = SConn.InitialCatalog;
                                log.ConnectionInfo.UserID = SConn.UserID;
                                log.ConnectionInfo.Password = SConn.Password;
                                log.ConnectionInfo.Type = ConnectionInfoType.SQL;
                                for (int i = 0; i < reportDocument.Database.Tables.Count; i++)
                                    reportDocument.Database.Tables<i>.ApplyLogOnInfo(log);
                                for (int i = 0; i < CrystalReportViewer1.LogOnInfo.Count; i++)
                                    CrystalReportViewer1.LogOnInfo<i>.ConnectionInfo = log.ConnectionInfo;
                            CrystalReportViewer1.ParameterFieldInfo = (ParameterFields)this.Page.Session["_paramFields"];
                            CrystalReportViewer1.ReportSource = reportDocument;
                            CrystalReportViewer1.DataBind();
                            CrystalReportViewer1.ShowFirstPage();
                else
                    CrystalReportViewer1.ReportSource = (ReportDocument)this.Page.Session [ "_reportDocument" ] ;

  • Crystal Report XI: Can you write your query in SQL instead of using the GUI

    Hello
      In crystal report version XI, can you write your query in sqlplus and then use the crystal report designer to build your report instead of using the GUI . I would like to be able to go database and show sql query and open that query and make changes directly there, is that possible on this version, if yes is there a setting somewhere? Please let me know.
    Thank you
    alpha

    Moved to Database forum.
    No you can no longer modify the SQL directly. Use a Command Object to enter the SQL directly.
    Thank you
    Don

  • Ports Crystal Reports uses when Connecting to a Universe as a Data Source

    I have a couple of Crystal Reports that use universes as a data source.  On my Windows 7 machine I am getting an error message that "Logon Failed", rather opening and running the same report on my Windows XP machine, I get the results from the universe as expected.  I have tried multiple universes that report against different databases (Oracle, SQL Server, Sybase, etc) and I am getting the same vague error message on my Windows 7 machine with Crystal Reports 12.3.0.601. 
    Can someone please tell me what ports are being used within Crystal Reports (other than 6400) when connecting to the CMS and pulling back data from a universe?  The odd thing, is that I can connect to the CMS, see the universes that I have permissions too and even see the objects within the universe, but I cannot view the results.  This is a pretty high priority for us, so I would appreciate any feedback possible.

    Hello,
    "Seems contrary to the concept of isolating users (in this case designers) from connection details. I can only be hopeful that report users will not also have to have connections configured on the local workstations to view these reports ;-)"
    As long as you use/set Saved Data with the reports then they don't need the client installed. If they hit Refresh to update the data then obviously they need to be able to connect to the data source, how else are they going to get it.
    Think about it, you sit down to write a report off of a database you don't have access to? How are you going to create a report....
    If you planning on sending out reports for viewing only then export them to PDF or some other type, then DB connections are not an issue, the PDF's are for viewing only.
    Another concept is DB Security. Using NT Authentication or DB Authentication unless that user hitting the refresh button has access to the DB it won't prompt for log on info or if they don't provide the correct log on info they can't see new data.
    It's all about security, CR does not save the Password in the RPT file, if we did anyone could get it and hack your database.
    Not sure what your post has to do with Ports?
    If you have questions then please post, in this forum we assume post that are answered are closed.
    Don

Maybe you are looking for

  • LAYOUT CHANGE IN FBL1N

    HI EXPERTS ! The transaction code for the report we generate is FBL1N - vendor ledger. we require the vendor's bank detail in this report at the header i.e. vendor bank name , account no..(change layout of report for output ) this detail can be seen

  • Dropping table

    hi , when iam dropping a table.. iam getting the error message and that indicates my table is been using by some other user... how to check which user is accessing my table currently... Regards, Mohd Mehraj Hussain

  • My CD drive doesn't burn anymore

    when i attempt to burn a cd i get the following message, "The attempt to burn a disc failed. The device failed to calibrate the laser power level for this media" What should i do about that? im not really sure where to begin, could it be something to

  • Ideacentre A720 - Recover Partition (One Key Recovery) doesn't boot

    My System was without a SSD Drive, but I upgraded it by my own and everything was allright after I cloned the System to the SSD-drive. I keep the "LENOVO_PART" (20gb) on my HDD, and the rest of it was just for Data-storage. 2 Month later Iwanted to c

  • Bridge shows wrong pdf size

    I'm browsing a folder of Photoshop pdf documents, with 4000x3000 pixels size but bridge shows 1134x850 size instead of the correct size. Any idea why ? Thanks