My first program to create a crystal report from java... Help needed...

Hi... I am writing a java program that fetches a table from database and creates a Crystal Report from that table(ResultSet object)... Optionally exporting the report as a pdf also...  This will be a console application since it is my first program using crystal reports.... Any one can help me with this...?

Hi Karthik,
you could have a look over these developer guides below for understanding of Java sdk :-
[http://www.sdn.sap.com/irj/boc/sdklibrary|http://www.sdn.sap.com/irj/boc/sdklibrary]
you could also find  below sample codes for creating reports using Java sdk (RAS sdk) :-
[http://www.sdn.sap.com/irj/boc/samples|http://www.sdn.sap.com/irj/boc/samples]
let me know if you need any help,
Regards,
Rameez.

Similar Messages

  • Call Crystal Report from java

    <p>Hi,<br /><br />Can anyone pl send me an e.g of how to call crystal reports from java ? Preferably crsytal version 10. how to instantiate a crystal report viewer? how to pass parameters? how to set the connection string?</p><p>my email is <a href="mailto:[email protected]">[email protected]</a><br /><br />Regards,</p><p>Hui Bee<br /></p>

    <p>Hi Hui Bee, </p><p>   There are a number of version 10 samples available contained in the following package:</p><p><a href="http://support.businessobjects.com/communityCS/FilesAndUpdates/cr10_jrc_samples.exe" title="JRC 10 samples">http://support.businessobjects.com/communityCS/FilesAndUpdates/cr10_jrc_samples.exe</a></p><p>However, I would strongly suggest that you take a look at using the latest version of the Java component that ships with our Crystal Reports for Eclipse product. You can download it from here:</p><p><a href="/node/450">http://diamond.businessobjects.com/node/450</a></p><p>and best of all, it&#39;s free! </p><p>Regards,<br />Sean Johnson (CR4E Product Manager) <br /><br /> <a href="http://www.eclipseplugincentral.com/Web_Links-index-req-ratelink-lid-639.html">Rate this plugin @ Eclipse Plugin Central</a>          </p>

  • Printing the datas through Crystal Report from Java

    How can I Print the datas through Crystal Report from java?

    How can I Print the datas through Crystal Report from
    java?
    What the hell are "the datas"?
    Jesus, I can understand this is a shrinking planet, Global community, and all that happy horse pucky. Typos or small grammar errors are no big deal, I make them all the time. But when I have to spend more time interpretting the question than figuring out the answer, it drives me crazy.

  • Creating a crystal report from R/3

    Hi,
    I am new to R/3. I am trying to create a new crystal report from R/3. I already connect crystal report with R/3 using integration kit. My problem now is i not sure which field i should i take from a which table when i look in R/3.I been provided a link, http://www.sap-img.com/sap-sd/important-tables-for-sap-sd.htm where i can check all the table for SD, PM n etc. For example, i go to t.code VA03 and search for an order, i see there is so many field. How do i know which field is from which table n row. Let said i want to pull the below information to my crystal report, how do i know which table and row i should take ? (this is just an example)
    PO Number, Po Date, Material, Order quantity, pricing date, net value and overall status
    Thank you

    Moved to Integration Kit forum.
    The people in this forum will know more about the data structure than the CR Design forum which typically doesn't know much about the SAP Data sources Structure.
    Don

  • Creating a Crystal Report from a non-SAP data base

    I have the following scenario
    server1\myDataBase
    server1\SAP\sapDataBases
    in sapDataBases I have about 30 company databases. I am trying to create a report, that gets informatino from a table/view/SP from server1\myDataBase, when I try to PREVIEW or SAVE such report on SAP Business One, I always get errors as
    I understand that this eerror means taht I can't invoke the data from out of SAP; it needs to be inside SAP (at least the SP, incoking some other data bases and stuff..)
    Some bodies have told me that it is beacuase I can only create a report from a table/view/sp that resides in the running/currently SAP company database. Is this right?
    Also, If this is the case, this means that If I have an SP taht I use for a crystal report, and 30 companies, I have to create such SP in the 30 companies?
    This is my software details:
    SQL Server 2012
    SAP Business One 9 PL 11
    SAP BusinessObjects Crystal Reports 2013 Support Pack 2 version 14.1.2.1121
    What I want to do is to create a non-SAP data base to create all the SPs/Views for reports, to centralize it, and the just create one reporte and do the 30-imports in each company database, without the need of creating such sps/views in each company-database. Is this possible?
    Thanks

    Moved to Integration Kit forum.
    The people in this forum will know more about the data structure than the CR Design forum which typically doesn't know much about the SAP Data sources Structure.
    Don

  • How to create a crystal reports from infocube

    Hi everyone
    I'm a new one in BOBJ, after few weeks learning, I've come across a problem.
    Is it possible to create a CR via an infocube? 
    What would i do if it's possible.
    Thank you very much

    Hello Ivan,
    you can built a report against the cube and against the query level in Crystal Reports. We highly recommend the cube level.
    why ? because when connecting to the cube directly you will lose the following:
    - navigational attributes
    - calculated keyfigures
    - restricted keyfigures
    - variables
    - conditions
    - authorization variables
    ingo

  • Create a Crystal Report using Java

    Hi
    Im Using Java 6 to connect to a Crystal Reports server. Im trying to create a common API that we can use throughout our office for integration with Crystal Reports.
    But Im having troubles with my method to upload/create a report. If I create a new Report Object via the Business Objects Central Management Console then everything is fine, but I get some funnies when I do it via Java.
    My upload code is like this :
    IInfoObjects newObjs = infoStore.newInfoObjectCollection();
    IPluginInfo pluginInfo = infoStore.getPluginMgr().getPluginInfo(CeProgID.REPORT);
    IInfoObject newObj = newObjs.add(pluginInfo);
    IReport myReport = (IReport)newObj;
    myReport.setTitle("title");
    myReport.setParentID(parentId);
    IFiles files = myReport.getFiles();
    files.addFile(file);
    infoStore.commit(newObjs);
    Now that all works fine and I get no errors. When I look at the Central Management Console I can see the newly created Report, but when I click on it I dont get any of the standard tabs. i.e. 'Properties', 'History' etc, but I do get an error message on the screen that simply says "An internal error has occurred"
    I cant find anything in the logs to tell me what this error is, and my steps to create/upload the report seem to match every example I have found.
    Can anyone help with this problem?
    Thanks for your time

    cwhiteside, please don't post in threads that are long dead. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.
    I'm locking this thread now.
    db

  • Using Jsp to create a crystal report

    Hi,
    I am using Jsp to create a crystal report from an oracle database.To create a new report document,i am using the ReportClientDocument class in the
    "com.crystaldecisions.sdk.occa.report.application.ReportClientDocument " package.
    I am using this code:
        ReportClientDocument rpt=new ReportClientDocument ();
                       rpt.newDocument();The report application server running on my machine does not support this.
    I have to use an IReportAppFactory interface method which is part of the package com.crystaldecisions.sdk.occa.managedreports.*,, in order to create a new report document.Can anbody help be know how to use this interface in a Jsp??
    Any help would be appreciated.
    Thanks,

    <p>Hi Tim,</p><p>      For security reasons we do not save the database password with the report. There are a few ways to solve what you are trying to do:</p><ol><li>Use the Create Viewer JSP page wizard to auto-generate the code. You will need to use the API option and select the option to <strong>"Log on to existing data connections" </strong>as well as the option to <strong>"Connect the CrystalReportPageViewer" </strong>(Note: I suspect that the reason you had a blank page the first time you tried this is because you did not have an Output option selected) <br /><br />The code that is generated will provide you with the ability to pass in the database authentication and then launch the report in the viewer.<br /><br /></li><li>The other option is to use a JNDI Connection at runtime. If you setup a JNDI Data Source you should have the ability to store the database authentication with the Data Source. To have the report use a JNDI connection at runtime you will need to set the name of the JNDI Data Source using the Properties View of the database in the Report Designer.</li></ol><p>Anyway, give this a shot and let me know how you make out.</p><p>Regards,<br />Sean Johnson (CR4E Product Manager) <br /><br /> <strong><a href="http://www.eclipseplugincentral.com/Web_Links-index-req-ratelink-lid-639.html">Rate this plugin @ Eclipse Plugin Central</a></strong>          </p>

  • Populating a Crystal Report from XML data

    Hi,
    I want to populate a Crystal Report using a XML data structure. Below I have explained what Iu2019m trying to do in detail,
    u2022 First I will create a Crystal Report using Crystal Report XI R2 designer  by connecting to a Oracle database using a native Oracle connection (not ODBC or JDBC)
    u2022 Then I want to write a Java application using CR XI R2 JRC SDK to open this report
    u2022 Then to run and populate this report using a XML data structure (which I have separately in a disk location. XSD too is available in disk)
    u2022 Then to export this report with data to either PDF or RPT file with saved data in to disk.
    The questions I have are,
    1. Is this possible to do in away?
    2. If so, can you please provide me with a sample code for doing this? I tried some of the other threads in the forum but some had broken links.
    3. Do the xml and the xsd needs to be in a special format?
    4. Is there any other configuration setting I should do?
    Hope you can help me. Thank you in advance.
    Regards,
    Chanaka

    Hi Chinmay,
    Thank you for the prompt answer. I have gone through this before. It explains on how to create a report using a xml database from CR designer. What I want to do is to set the data source programmatically to a xml date source from the code. I didnu2019t find anything like that. Is it the same way as setting the database connection information?
    Also another question I have is how does a report with two tables work? Say I have a master u2013 detail report (order and order lines). The master part is taken from one table (order_tab) and the detail part is taken from another (order_detail_tab). Do I need to have 2 xmls or is one structured xml sufficient? How will the same work if I have the detail section in a sub-report? Will it work with one or do I need to have two?
    Regards,
    Chanaka

  • Developing Crystal Report from SAP BEx query

    Hi,
    I am trying to create an crystal report from SAP BEx query( using MDX driver). I can able to connected to BEx query and got key figures and characterstics, but not able to get calculated key figures into crystal reports.
    Would likes to know how to use the calculated key figures used at BEx query level in Crystal Reports? and
    Creation of complex parametes in Crystal reports on SAP data.
    I really appreciate your quick reply.
    Thanks in advance.
    VR

    Hi,
    calculated keyfigures are shown like any other keyfigure in Crystal Reports.
    ingo

  • Create and open Crystal Reports from ABAP program

    Hello,
    Let me explain the scenario with a simple example.
    In my ABAP program, I have the entries of table MARA in an internal table. I want to now create a crystal report through ABAP, and display the result in a .rpt file programatically.
    Could you please provide some pointers?
    Regards,
    Suraj

    Hi,
    I think this can done through the BW development or we can use the XI.
    Pls refer to this link
    Crystal reports
    Thanks & Regards,
    Chandralekha.

  • Creating a crystal report using excel

    I have an excel spreadsheet that I would like to access to create a crystal reports.  But it seems that I have to first save it as an access or other database file.  But this information changes frequently so I it would be more efficient to access the excel file directly.  I tried using the crystal wizard addin in excel, but then when I run the report I get the error message "Server has not yet been opened".  Any other ideas on how to create report of excel data directly?

    Hello Guys ,
    I have something similar problem ,but not exactly.
    our requirement is We are scheduling one crystal report to generate excel and sent to FTP location.This Excel file (in FTP) should be the input of new Crystal Report using ODBC (RDO) connection.
    I am able to create the ODBC connection,but that ODBC connection is not showing me the selected excel sheet in the Crystal Report ODBC Connection.I tried with Remote as well as local drive Excel also.
    I tried on different machine (thought ,it could be Driver specific),but all machines does have same issue.
    Is there any settings or driver upgrades require for CR XI R2 /2008 in order to use ODBC (RDO) for EXCEL FILES.I didnt find any comments /resolution in Google too.
    My steps -
    1) Create a sample Excel file - only few records
    2) Created a System ODBC connection pointing this excel file say "TEST1"
    3) Opened A Blank Crystal Report
    4) Create a New connection
    5) Select ODBC RDO
    6) Create new connection and selected the newly created SYSTEM DSN "TEST1"
    7) check the selected excel is displayed in ODBC RDO connection??
    If it is a Crystal Report issue or ODBC Driver issue ,please let me know if anyone have came across similar issues.
    thanks in advance.
    Nitin

  • Is there a way how to create new Crystal Report template programmatically?

    Hi all,
    I would like to know if there is any way how to call .NET code using Crystal Reports for VS2010 to create Blank Crystal Report template with specific DataDefinition?
    I want to save work with opening Crystal Reports application and manually adding DataDefinition fields which my application provides...
    Thank you for your reply in advance,
    Honza
    Edited by: honzajic on Sep 20, 2011 3:53 PM

    Hello Honza
    You will have to use the InProc RAS SDK as this includes report creation APIs. A few resources to get you started:
    [How to Use The RAS SDK .NET With In-Process RAS Server|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10b840c0-623f-2b10-03b5-9d1913866b32]
    [Samples|https://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples]
    [Programming tutorial|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b050afe0-2fa5-2b10-658d-98f214ba6a4a]
    [Report Application Server .NET API Guide|http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/xi4_rassdk_net_api_en.zip]
    [Report Application Server .NET SDK Developer Guide|http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/xi4_rassdk_net_dg_en.zip]
    You may also find [this|http://book.soundonair.ru/sams/] website quite interesting.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • Viewing Report created in Crystal Report Designer

    <p>Hi,</p><p>I&#39;m new to CR4E and tries to work with existing report. I saw many error while trying this, please excuse me to the long email below that I explain all the errors I saw......</p><p>I have some reports that were created in Crystal Report Designer (CR XI Release 2) connecting to the Oracle Database using "Oracle Server" type connection. How can I access it from CR4E? I have the following problem (in the order I see them)</p><p>1) In the Eclipse&#39;s JSP page, I specified the full path to the report, but I get a report not found error. Must the report locate within the project? Is there any way we can open a report outside of the project?</p><p>2) I copied the report to the project, </p><p>    a) followed jrc_print_report example to print the report, get "JNDI name not found" error. </p><p>    b) then generate a viewer page, but I get the Driver "crdb_oracle.dll" is not supported error.</p><p>3) I setup the new JNDI followed the jrc_changedatasource.jsp example to change the datasource, but I still get the "JNDI name not found" error.</p><p>4) I imported the report intoEclipse and changed the connection. Then I can create a jsp page to print it to a printer (I still can&#39;t view it, but my goal is to print, so that&#39;s ok). However, </p><p>    a) the original report has a "Command" object from the Oracle database to control where to select the report&#39;s data, when I remap, this object disappear and I cannot see how to recreate it. Any suggestion?</p><p>    b) also, the report is very complex with many subreports and it will be nightmare to go in and change all of the datasource, also a maintenance nightmare to maintain two copies. Any better suggestions?</p><p>Thank you very much! Your help is very appreciated.</p><p>Celia</p>

    Hi Celia
    1. Yes the Java Reporting Component (JRC) which is the runtime component of the Crystal Reports for Eclipse can open reports outside the project.  Its often better to have the reports inside the project for deployment purposes but you are welcome to put the report where ever you need it.Â
    Note: To use absolute paths, ensure that the CRConfig.xml file does not contain a reportlocation tag.
    2. The JRC can't report off of Oracle directly, you would need to use a JDBC driver to connect your reports to Oracle. The crdb_oracle.dll will never connect because its not Java.Â
    3. When the JRC finds that the report is not using a supported database driver it will do a lookup to find the name of the report datasource. When it finds the datasource name it will then do a JNDI lookup for a JDBC datasource with the same name. If your Application server doesn't have a datasource with that name it will through the error you were seeing.Â
    4. I'm not sure about losing the Command object when changing the datasource but this is probably happening because the Command is linked to the database driver.
    5. What you could try doing is creating a JDBC Datasource on your application server where this app will run with a JNDI name that matches your report datasource name. If your reports datasource name is "MyOracleDatasource" then I believe the JNDI name for new JDBC Datasource would have to be "jdbc/MyOracleDatasource".
    You could give this a try.
    Rob Horne
    http://diamond.businessobjects.com/blog/10

  • 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

Maybe you are looking for

  • Switching to a Location if using a 3G Modem

    I want to have EndPoint automatically switch to a Location if it detects that the computer is connecting to the internet using a 3G (broadband) modem. When I hover over the Endpoint client icon it shows my wired connection with a cross (that's correc

  • Follow-up on "LastSeen" field of UserTracking in CM of CiscoWorks

    Found this discussion here ("LastSeen"  field of UserTracking table in Campus Manager of CiscoWorks). Here is a few follow-up questions: If UT acquisition is scheduled to run everyday, and a user end host (PC workstation) is online all the time on th

  • How to increase vram in macbook pro 13 early 2011

    I recently bought Macbook Pro core i5, 13in early 2011. Is there any way to increase VRAM in my macbook pro. I want to work for Graphics specially in After effects and Adobe Photoshop. But when I started photoshop I saw an error that I have only 384M

  • Template Works in Dreamweaver Preview But Not After It's Published...

    I am running CS5.5 on a Mac. I have been working on this website, and everything was working fine. I would preview the site in Firefox and everything looked great so I pubished it. Now, the content shows up, but the template doesn't (on any browser I

  • Errors with flashplayer 9

    My computer said I needed to install flashplayer 9 so i did that and automatically i couldn't see any kind of pictures or videos. I figured a problem must have occured so i tried uninstalling it and it wouldn't uninstall. I had to come to this websit