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

Similar Messages

  • Creating a sample report using JAVA SDK

    Hi,
    I am trying to create a sample report using JAVA SDK.
    I slelect 4 "free cells" and pass 4 different strings to it.
    I even slelect the font colour and size. When i run the class and try to view the report in Infoview, I only seeblank blocks without any data. Now if I edit the report from infoview, and save the changes, I am able to see the data.
    My issue is, Why am I not able to see the data when I run the java code.
    Please find teh code below.
    package com;
    import java.awt.Color;
    import java.io.FileOutputStream;
    import java.util.ArrayList;
    import java.util.Date;
    import java.util.List;
    import com.businessobjects.rebean.wi.BinaryView;
    import com.businessobjects.rebean.wi.DataProvider;
    import com.businessobjects.rebean.wi.DataProviders;
    import com.businessobjects.rebean.wi.DataSource;
    import com.businessobjects.rebean.wi.DataSourceObject;
    import com.businessobjects.rebean.wi.DocumentInstance;
    import com.businessobjects.rebean.wi.DocumentLocaleType;
    import com.businessobjects.rebean.wi.FontImpl;
    import com.businessobjects.rebean.wi.FreeCell;
    import com.businessobjects.rebean.wi.HTMLView;
    import com.businessobjects.rebean.wi.OutputFormatType;
    import com.businessobjects.rebean.wi.PageHeaderFooter;
    import com.businessobjects.rebean.wi.Query;
    import com.businessobjects.rebean.wi.Recordset;
    import com.businessobjects.rebean.wi.Report;
    import com.businessobjects.rebean.wi.ReportBody;
    import com.businessobjects.rebean.wi.ReportCell;
    import com.businessobjects.rebean.wi.ReportContainer;
    import com.businessobjects.rebean.wi.ReportElement;
    import com.businessobjects.rebean.wi.ReportEngine;
    import com.crystaldecisions.sdk.framework.CrystalEnterprise;
    import com.crystaldecisions.sdk.framework.IEnterpriseSession;
    import com.crystaldecisions.sdk.framework.ISessionMgr;
    import com.crystaldecisions.sdk.occa.infostore.IInfoObject;
    import com.crystaldecisions.sdk.occa.infostore.IInfoObjects;
    import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
    import com.crystaldecisions.sdk.plugin.CeKind;
    public class Aug7th {
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              String CMS = "pundl8136:6400";
              String userID = "srivas";
              String password = "morcom123";
              String auth = "secEnterprise";
              List<String> entire =new ArrayList<String>();
              List<String> country =new ArrayList<String>();
              List<String> resort =new ArrayList<String>();
              IEnterpriseSession enterpriseSession;
              try
                   ISessionMgr mySessionMgr = CrystalEnterprise.getSessionMgr();
                   enterpriseSession = mySessionMgr.logon(userID, password, CMS,auth);
                   if (enterpriseSession != null)
                   {//Create and store useful objects for the session.
                        IInfoStore iStore = (IInfoStore)enterpriseSession.getService("InfoStore");
                        ReportEngine reportEngine = (ReportEngine)enterpriseSession.getService("WebiReportEngine");
                        IInfoObject infoView = null;
                        String str = "SELECT SI_ID, SI_NAME, SI_PARENTID FROM CI_INFOOBJECTS WHERE (SI_KIND = '"+CeKind.WEBI+"' OR SI_KIND='FullClient') " +
                        "AND SI_INSTANCE = 'false' AND SI_NAME='Structure Test_001_Java' ORDER BY SI_NAME ASC ";
                        //String str = "SELECT SI_ID, SI_NAME, SI_PARENTID FROM CI_INFOOBJECTS ORDER BY SI_NAME ASC ";
                        IInfoObjects objInfoObjectsWIDs = (IInfoObjects) iStore.query(str);
                        System.out.println(objInfoObjectsWIDs.size());
                        IInfoObject objInfoObjectWID = (IInfoObject) objInfoObjectsWIDs.get(0);
                        DocumentInstance doc = reportEngine.openDocument(objInfoObjectWID.getID());
                        DataProviders dps = doc.getDataProviders();
    //                     Retrieve the 1st data provider
                        DataProvider dp = dps.getItem(0);
    //                     Retrieve the universe objects
                        DataSource ds = dp.getDataSource ();
                        Query q = dp.getQuery();
                        Recordset rs = dp.getResult(0);
    //                     0: assume query has one flow
                        rs.first();
    //                     Print the column types. They can be Integer, String,
    //                     or Date.
                        for (int i = 0; i < rs.getColumnCount(); i++) {
                        Class c = rs.getColumnType(i);
                        StringBuffer sbt = new StringBuffer();
                        if ( c.equals(Integer.class) )
                        sbt.append("Integer");
                        if ( c.equals(String.class) )
                        sbt.append("String");
                        if ( c.equals(Date.class) )
                        sbt.append("Date");
                        sbt.append(";");
                        System.out.println(sbt.toString());
                        System.out.println(rs.getColumnCount());
                        while (!rs.isLast()) {
    //                          column names
                             StringBuffer sbn = new StringBuffer();
                             StringBuffer sbd = new StringBuffer();
                             for (int j = 0; j < rs.getColumnCount(); j++) {
                             sbn.append( rs.getColumnName(j).toString() );
                             sbn.append(";");
                             System.out.println("sbn "+sbn.toString());
    //                          data
                             for (int k= 0; k< rs.getColumnCount(); k++) {
                             sbd.append( rs.getCellObject(k).toString() );
                             sbd.append(";");
                             entire.add(rs.getCellObject(k).toString());
                             System.out.println("sbd "+sbd.toString());
                             rs.next();
                        System.out.println(entire.size());
                        for(int i=0;i<entire.size();i++){
                             country.add(entire.get(i));
                             i++;
                             System.out.println("entireList "+entire.get(i));
                             resort.add(entire.get(i));
                        DataSourceObject city = ds.getClasses().getChildByName("Country");
                        DataSourceObject resorts = ds.getClasses().getChildAt(1);
                        dp.runQuery();
                        ReportContainer report = doc.createReport("Resort");
                        PageHeaderFooter header = report.getPageHeader();
                        FreeCell headerCell = header.createFreeCell("Resort Report");
                        PageHeaderFooter footer = report.getPageFooter();
                        FreeCell footerCell = footer.createFreeCell("Report Ends");
                        ReportBody body =  report.createReportBody();
                        for(int k=0;k<resort.size();k++){
                        FreeCell res=body.createFreeCell(resort.get(k));
                        res.getAttachTo();
                        res.setHeight(15d);
                        res.setWidth(30d);
                        Color c = new Color(255,255,255);
                        Color c1 = new Color(255,0,0);
                        FontImpl fnt = (FontImpl)res.getFont();
                        fnt.getDecoration().setTextColor(c1);
                        res.setFont(fnt);
                        //res.deleteAttachment();
                        //res.setAttachTo(body,VAnchorType.BOTTOM,HAnchorType.NONE);
                        doc.applyFormat();
                        doc.refresh();
                        final String l_docToken = doc.getStorageToken();
                        final DocumentInstance l_docToSave = reportEngine.getDocumentFromStorageToken(l_docToken);
                        doc.saveAs("mor31",835,null,null);
                        doc.closeDocument();
                        str = "SELECT SI_ID, SI_NAME, SI_PARENTID FROM CI_INFOOBJECTS WHERE (SI_KIND = '"+CeKind.WEBI+"' OR SI_KIND='FullClient') " +
                        "AND SI_INSTANCE = 'false' AND SI_NAME='mor31' ORDER BY SI_NAME ASC ";
                        //String str = "SELECT SI_ID, SI_NAME, SI_PARENTID FROM CI_INFOOBJECTS ORDER BY SI_NAME ASC ";
                        objInfoObjectsWIDs = (IInfoObjects) iStore.query(str);
                        System.out.println(objInfoObjectsWIDs.size());
                        objInfoObjectWID = (IInfoObject) objInfoObjectsWIDs.get(0);
                        DocumentInstance doc1 = reportEngine.openDocument(objInfoObjectWID.getID());
                        String token = doc1.getStorageToken();
                        DocumentInstance doc2 = reportEngine.getDocumentFromStorageToken(token);
                        doc2.saveAs("123123", 835, null, null);
                   //     doc.refresh();
                        //doc.save();
                   enterpriseSession.logoff();
              catch(Exception e)
                   e.printStackTrace();

    duplicate post:
    Sample report using JAVA SDK

  • How to create a crystal Report using C# and SQL Server

    Hi, im new in creating crystal report using SQL Server, and im making a project.. and could someone help me how to connect your .sdf (SQL Server File) from the bin to your crystal report? thanks a lot.. i followed some instructions like this one (https://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?referrer=http://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?referrer=http://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?referrer=http://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?forum=csharpgeneral)
    but i got an error on the adding of server name and database portion.. thanks a lot in advance

    Hello,
    Crystal Reports are supported on
    http://scn.sap.com/community/crystal-reports.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • How do you reference a Formular Object on a Crystal Report using Java

    Hi all,
    I am trying to reference an object on my report which contains a Formula field.
    I have read the following 2 threads, but they refer to textObjects:
    [How do you reference a textObject on a Crystal report using Java|Re: How do you reference a textObject on a Crystal report using Java?]
    [Changing the text of ITextObject programatically|Re: Changing the text of ITextObject programatically]
    But I cannot even get those to work. I can reference a object which refers to a database field but as soon as I try
    reference a textObject or reportObject I just get a NULL variable.
    Below is the code I am useing
    IReportObject dbField = reportClientDocument.getReportDefController().findObjectByName("BOB1");
    IReportObject textBob = reportClientDocument.getReportDefController().findObjectByName("BOB2");
    "BOB1" is the name of my DB field Object, and "BOB2" can be a Text box or a Formula item and I just get nothing.
    I have just tested it with a FieldHeadingObject and that returns a valid object, so clearly I am going about this the wrong way
    for objects I place on the reports which are not driven by the database items.
    Ultimately what I want to do is reference an object in the Report Footer which will contain the RecordCount of the number of
    records contained in the report, which I am them going to use to determine if the report holds data,
    if it does I will print it, else ignore it and move on the the next report. I am doing this so that I can at an extra filter to split
    a report up into groups and produce a sinlge PDF for each group instead of one massive PDF containing all the groups.
    So if someone has a solution to any of my problems I would be very greatful, and I dont mind being told Im an idiot and should
    rather do it another way, as long as you supply that other way
    Thanks for the help
    Darren
    Edited by: Darren Jackson on Dec 16, 2009 7:29 PM
    Forgot to add am using CR4Ev2 SP3

    Right I have made some headway.
    Firstly, Im an idiot. I was making changes and setting up test fields on my report, but then when running the app, I had it looking at
    the backup report, which would explain why all the new textbox fields were not being found.
    The stupiditity did force me to delve deep and work out a fair bit of how the reports work, so cant complain too much. BUT, I am still
    not able to return values of Formula fields and formulas extra. Could someone tell me if this is even possible. I get retrieve the formula field
    name, and properties but not its value once the report has been populated. Am I wasting my time?
    Well I will continue dismantling my reports till I find the answer, or someone points me in the right direction.
    If any one is interested this is the code I used to drill down to my text boxes:
    IReportObject recCount = reportClientDocument.getReportDefController().findObjectByName("TB1");
    ITextObject obj_RecCount = (ITextObject) recCount;
    System.out.println(obj_RecCount.getName());
    Paragraphs objP = obj_RecCount.getParagraphs();
    for (int i = 0; i < objP.size(); i++){
         ParagraphElements pE = objP.getParagraph(i).getParagraphElements();
         for (int j = 0;j < pE.size(); j++){
              IParagraphTextElement pEE = (ParagraphTextElement) pE.getParagraphElement(j);
              System.out.println(pEE.getText());
    Cheers

  • 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.

  • 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

  • How to create a crystal report using secured web service as a datasource?

    Hi All Expert,
    I having some challenges on how to create a report using secured web service as a datasource in crystal report designer (CR11 R3).
    Secured Web Service including the certificate trusting, token authentication, header and/or body encryption. All web services running on https protocal.
    Could you please suggest me on the solution?
    Thank you and Best Regards,
    Cherr

    Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
    http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551

  • How do you reference a textObject on a Crystal report using Java?

    Hi,
    Could someone please tell me the java statement to reference a textObject on a Crystal report. I am struggling to find the info in the docs and work out how the object model works.
    My textObject on the report is called "VersionNumber" and I want to locate it on the report (I know it will be in the page footer) and then retrieve its value and change it.
    I've managed to get a handle to the report using,
    ReportClientDocument localDoc;
    localDoc = getReport();
    localDoc.open("rassdk://" + reportFile.getAbsolutePath(), OpenReportOptions._openAsReadOnly);
    Any help would be much appreciated.
    Regards
    Rob.

    I've found a way of referencing the textObject using the following line of java code (used in conjunction with the preceding code).
    IReportObject iro = localDoc.getReportDefController().findObjectByName("VersionNumber");
    I can put "iro" into a Watch (within Eclipse) and I can find the contents of the textObject there under the Paragraph tree, but I am now stuck with how to reference this within Java.
    If anyone can help it would be much appreciated (and I will of course award points !)
    Regards
    Robert.

  • Crystal Report using XML file

    Hi,
    I want to create dynamic crystal report using below mention xml file.
    Example:--
    <?xml version="1.0" encoding="utf-8"?>
    <root xmlns:inl="http://inline">
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://inline" xmlns="http://inline" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:element name="Person">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="First_Name" type="xs:string"/>
    <xs:element name="Last_Name" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    <inl:Person>
    <inl:First_Name>Anna</inl:First_Name>
    <inl:Last_Name>Ant</inl:Last_Name>
    </inl:Person>
    <inl:Person>
    <inl:First_Name>Betty</inl:First_Name>
    <inl:Last_Name>Boop</inl:Last_Name>
    </inl:Person>
    </root>
    Crystal report column will be generated using this xml file.
    my report look like--
    First Name Last Name
    Anna Ant
    Betty Boop
    Thanks
    Praveen

    can you please be more detailed on what you mean automatically
    like put the xml file together and have the report generated without actually attaching the dataset to the rpt file and placing the fields in the report?
    if that is the case i dont believe crystal functions that way, been working with it for many years. i know you can create webi files through business objects where an end user can talk an dataset and build there own queries and rpt files on a dashboard type screen.

  • Crystal reports using xml at run time??

    Post Author: avnkkishore
    CA Forum: General
    Hi,
    I have very simple requirement.
    I would like to create a crystal
    report using XML. This
    XML file will be decided at run time
    (not at design time).
    Hence i have added a crystal report viewer control to my windows form and did
    not choose any data source (i left it blank currently). Now i am trying to load
    XML file with the following simple code.
                PropertyBag
    crLogOnDetails = new PropertyBag();
    crLogOnDetails&#91;"Local XML File"&#93; = @"C:\Hosts.xml";
    crLogOnDetails&#91;"Local Schema File"&#93; = @"C:\Hosts.xsd";
    ConnectionInfo conn = new ConnectionInfo();
    conn.Attributes = crLogOnDetails;
                // create
    "Host" table
    CrystalDecisions.ReportAppServer.DataDefModel.Table tbl;
                tbl = new
    CrystalDecisions.ReportAppServer.DataDefModel.Table();
                tbl.Name =
    "Host";
    tbl.ConnectionInfo = conn;
    rcDoc.DatabaseController.AddTable(tbl, null);
    I am getting exception exactly at the above line (i.e. when adding table to
    Database Controller) saying "COMException was unhandled" with error code
    0x80004005 Unspecified error.
    Can any one please help me regarding how to resolve this.
    Thanks in advance,
    Kishore

    I am using VB6 as the front end and Microsoft Access to hold the data and Crystal Reports 8.5. I have a staff name parameter that I want the user to select which staff name to print the report.  If there is
    a new staff the name is not in the list of parameters.  How do I add to the parameter list at run time from the staff table?
    Hi,
    I am afraid that these forums don't support VB6, you could refer to this thread:
    Where to post your VB 6 questions
    You could consider posting this issue in these forums below:
    These forums do not support Visual Basic 6, however there are many third-party support sites that do. If you have a VB6-related question please visit these popular forums:
    VB Forums
    VB City
    In addition, issues related to Crystal Reports are not supported either since it belongs to third-party.
    You could post issues related to Crystal Reports to its forum to get dedicated supports.
    SAP Crystal Reports for .NET forum:
    http://forums.sdn.sap.com/forum.jspa?forumID=313
    Thanks for your understanding.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • 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

  • Error creating Crystal Report using Stored Proc Universe

    Hi,
    I have created a stored procedure Universe, using the new feature available in XI R3.
    This connects to an Oracle database, executing a PL/SQL procedure returning ref cursor.
    I have created a WebI report using this Universe, which works fine and functions as expected.
    So there are no problems with either my Oracle stored proc or the Universe.
    However, I would like to create a Crystal report (2008) using the same Universe.
    I can create the report ok - using the SP Universe.
    When I attempt to refresh the data I get an error:
    Failed to retrieve data from the database.
    Details: ORA-06550: line 1, column 7:
    PLS-00103: Encountered the symbol "." when expecting one of the following:
    begin case declare etc etc
    .................................My Procedure ...................
    CREATE OR REPLACE PROCEDURE BIADM.Bo_Test_Report_R
    (Deposit_Cursor IN OUT SYS_REFCURSOR)
    IS
    BEGIN
    OPEN Deposit_Cursor FOR
    SELECT DISTINCT foracid "A/C"
    , acct_name "A/C Name", acct_opn_date "OP/Date", schm_code "SchmCode"
    FROM gam@finrpt
    WHERE acct_cls_flg ='N'
    AND foracid ='2252020145001';
    --AND cust_id ='CB2020145'
    END Bo_Test_Report_R;
    Please Give me solution as early as possible.
    Masud Iqubal

    Moved to Universe Design forum.

  • 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>

  • How to set DbConnections when scheduling a crystal report using Crystal Reports Server Java SDK?

    Post Author: Manjula
    CA Forum: JAVA
    Hi,
    Trying to schedule a report using Crystal Reports Server Java SDK. Want to pass DBConnections from API, though passing DBConnections, the report is not being scheduled and says "Failed to retrieve data from the database.Details:&#91;Database Vendor Code:6550&#93;.
    Would be thankful if someone could answer my point as applicable.
    Here is the code attached.
    ISDKList dbLogons = oReport.getReportLogons();int dbLogonSize = dbLogons.size();
    for(int i=0; i<dbLogonSize; ++i) {
    IReportLogon dbLogon = (IReportLogon)dbLogons.get(i);
    dbLogon.setDatabaseName("DBname");
    dbLogon.setUserName("usrname");
    dbLogon.setPassword("pwd");
    Thanks in advance.

    Post Author: Manjula
    CA Forum: JAVA
    Ted,
    Thank you for your valuable information.
    First, tried scheduling on Central Management Console and then with the java code.It worked fine, but here is another question for you.
    On the Console, a report exists with ServerName and UserName harcoded and when trying to set ServerName and UserName from the java code, its throwing exception. Where as Password is not set on Console, am able to set password from java.
    And DatabaseName is not set on Console (non editable), unable to set the same from java too. Why is it so?
    So, my question is - though ServerName,DatabaseName,UserName,Password exists on the Console report, can't I override those parameters from java?
    Would be greatful if you answer my question and provide me some guidance.
    Thanks in advance.

  • Display structure in crystal report using structure created in BEx.

    I created a structure in BEx query designer and trying to display the structure as a hierarchy in crystal report.
    Iam not able to accomplish it. the crystal report is displaying the structure with no nodes. please help

    Hi,
    in case you created a BEx query with 2 structure - one for keyfigures and one as characteristic structure - then the structure for the characteristics will result in Crystal REports using the BW MDX Driver as a single field and each element of the structure will result in a row of data.
    regards
    Ingo Hilgefort

Maybe you are looking for

  • Problem with customer exit variable on date range

    Hi All, I have customer exit variable on date range. In the selection screen it has to give the week range  as a default (05/21/2009 to 05/27/2009). Earlier its working fine and from yesterday onwards it is not working properly. yesday onwards defaul

  • Upgrading OSB 10.2 to 10.3: uninstall required?

    Greetings. We're planning on upgrading OSB 10.2 to 10.3. Boss says the upgrade failed last time he did this because he did uninstall 10.2 first. He backed out of the upgrade at that point. Any problems if I do not uninstall 10.2 first? What's the fee

  • I Need to have many internet windows open at once

    I'm used to PC based work where I can have several internet windows open at once. I can't seem to do this on the iMac. I have downloaded Firefox, so I can use Firefox and Safari at the same time, but I would like to have at least 6 internet windows o

  • The volume for music clip that I drag into Imovie 08 can't be reduced.

    I have dragged several audio tracks over to my video that I am editing. Everything was going fine I was able to reduce the volume to the percentage I wanted then suddenly all the tracks on my video are playing at 100%. I check the audio information a

  • Podcasts not showing under Podcast menu, but under Podcast Genre

    I am subscribed to several podcasts through iTunes. On my 40GB 4G, all the podcasts show up under the main menu option "Podcasts". But on my Nano, only one of the 9 podcasts I subscribe to shows up there, I have to go into Music -> Genres -> Podcasts