Using DB2 views in crystal reports with java

Post Author: Shikha Tomar
CA Forum: JAVA
Hello,
We have used DB2 views in Crystal Report 11.
We are able to view the report through crystal report tool but while using this rpt file in java application,the DB2 view is not found.
It gives an error: "table SCDC.View_report not found."
SCDC.View_report=Name of the view used in rpt
Code for calling rpt is as below:
The line marked as red gives the error:
private static void switch_tables(DatabaseController databaseController) throws ReportSDKException, IOException {
final String URI = "!com.ibm.db2.jcc.DB2Driver!jdbc:db2://"SERVERNAME":"PORT"/"DATABASE_NAME"!"+"";
final String DATABASE_DLL = "crdb_jdbc.dll";
//Obtain collection of tables from this database controller.
Tables tables = databaseController.getDatabase().getTables();
CommandTable commandTable=new CommandTable();
//Set the datasource for all main report tables.
for (int i = 0; i < tables.size(); i++) {
ITable table = tables.getTable(i);
//Keep existing name and alias.
table.setName(table.getName());
table.setAlias(table.getAlias());
//Change properties that are different from the original datasource.
table.setQualifiedName(TABLE_NAME_QUALIFIER + table.getName());
//Change connection information properties.
IConnectionInfo connectionInfo = table.getConnectionInfo();
//Set new table connection property attributes.
PropertyBag propertyBag = new PropertyBag();
//Overwrite any existing properties with updated values.
propertyBag.put("Trusted_Connection", "false");
propertyBag.put("Server Name", SERVERNAME); //Optional property.
propertyBag.put("Connection String", CONNECTION_STRING);
propertyBag.put("Database Name", DATABASE_NAME);
propertyBag.put("Server Type", "JDBC (JNDI)");
propertyBag.put("URI", URI);
propertyBag.put("Use JDBC", "true");
propertyBag.put("Database DLL", DATABASE_DLL);
connectionInfo.setAttributes(propertyBag);
//Set database username and pasword.
//NOTE: Even if these the username and password properties don't change when switching databases, the
//database password is not saved in the report and must be set at runtime if the database is secured.
connectionInfo.setUserName(DBUSERNAME);
connectionInfo.setPassword(DBPASSWORD);
connectionInfo.setKind(ConnectionInfoKind.SQL);
//connectionInfo
table.setConnectionInfo(connectionInfo);
//Update old table in the report with the new table.
databaseController.setTableLocation(table, tables.getTable(i));
Regards,
Shikha

Hi,
Fo business views please reffer to [Business Views Administrator's Guide|http://help.sap.com/businessobject/product_guides/boexir31/en/xi3-1_bv_admin_en.pdf]
Yes, Crystal Reports 2008 can consume business views.
Regards,
Ramu.

Similar Messages

  • Getting Error while integrating Crystal reports with Java

    Hi All,
    I am getting below error while integrating crystal report with java
    [java] os.arch = x86
    [java] java.lang.NoSuchMethodError: com.crystaldecisions.Utilities.d.<init>
    (Ljava/awt/Image;I)V
    [java] at com.crystaldecisions.Utilities.af.try(Unknown Source)
    [java] at com.crystaldecisions.Utilities.af.a(Unknown Source)
    [java] at com.crystaldecisions.Utilities.af.<init>(Unknown Source)
    [java] at com.businessobjects.crystalreports.viewer.applet.g.a(Unknown
    Source)
    [java] at com.crystaldecisions.ReportViewer.ReportViewer.start(Unknown
    Source)
    [java] at ReportViewerFrame.<init>(ReportViewerFrame.java:51)
    [java] at JRCViewReport.launchApplication(JRCViewReport.java:29)
    [java] at JRCViewReport$1.run(JRCViewReport.java:50)
    [java] at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:
    178)
    [java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:443)
    [java] at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDi
    spatchThread.java:190)
    [java] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDisp
    atchThread.java:144)
    [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.j
    ava:138)
    [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.j
    ava:130)
    [java] at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
    Any help can be appreciated
    Kalyan

    Hi All,
    For got to mention i am using crystal reports XI release 2 with JDK1.4.
    Kalyan

  • Integrating crystal report with java

    Hi
    Any one can send me sample program for integrating Crystal report with java.I dont know how to integrate java with cryatal report.if any one helps me out from this problem an advance thanks to them
    Thanks
    Dilip

    Hi All,
    For got to mention i am using crystal reports XI release 2 with JDK1.4.
    Kalyan

  • Ask about Crystal report with java

    I have a problem. Can you help me to solve it?
    The problem is how to show a crystal report by java and struts action in html.
    Thank you and regards.

    http://www.google.co.za/search?hl=en&q=%2Bjava+%2B%22crystal+reports%22&meta=
    Gives this as the first result:
    http://www.businessobjects.com/products/reporting/crystalreports/java/default.asp
    You then search the site:
    http://www.businessobjects.com/search/?summary=1&client=www_frontend&proxystylesheet=www_frontend&output=xml_no_dtd&lr=lang_en&oe=utf8&ie=utf8&website=&ct=livewww-all&q=java
    Which leads you to this page:
    http://www.businessobjects.com/products/dev_zone/java/default.asp
    Try STFW, RTFM and implement something, then ask a specific question.

  • How to use Crystal Report with Java - need help

    Dear everyone,
    i am completely new to Crystal report , please can anyone help me to creat a very simple Report using the Crystal report,
    the report will show some records from oracle DB.
    How can i make it by a simple example and with code please?
    do i need any JAR or Bean for Crystal report?
    thanks for your help and please don't hesitate to contact me in case of any inquiries.
    my email: [email protected]
    Thanks in advance

    I what to use Crystal report to generate report.My programe in java swing .Iam retrive table from database in Jtable .But when giving print
    command its print half screen .so that why I wantto usecrystal report
    package file2;
    import file2.choice;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.sql.*;
    import java.util.*;
    import java.awt.print.*;
    import javax.swing.table.*;
    import com.sun.java.swing.*;
    import javax.swing.JTable;
    public class cour extends JFrame implements Printable
         //Menu fileMenu;
         public static void main(String[] a)
    cour n = new cour();
    n.setVisible(true);
    public cour()
         super("Course Report");
         report();
         protected void report()
              JPanel panel = new JPanel();
         JButton printButton = new JButton("Print");
         panel.add(printButton);
         JButton exitButton = new JButton("Exit");
         panel.add(exitButton);     
         DefaultTableModel defaulttablemodel = new DefaultTableModel();
              JTable jtable = new JTable(defaulttablemodel);
              panel.add(new JScrollPane(jtable));
              String      tempname="";
              int tempcnt;
              String driver="sun.jdbc.odbc.JdbcOdbcDriver";
              String url="jdbc:odbc:regs";
              Object[] data = new Object[4];
              try
                             Class.forName(driver);                         
                             Connection connection=DriverManager.getConnection(url,"sa","");
                             Statement statement = connection.createStatement();     
                             String query = "SELECT courseid as CourseID,coursen as CourseName,cfee as Fee,coursed as Duration FROM course";
                             ResultSet rs = statement.executeQuery(query);     
                             ResultSetMetaData rmeta = rs.getMetaData();
                             int numColumns=rmeta.getColumnCount();                         
                             for(int i=1;i<=numColumns;i++)
                                  if(i<=numColumns)
                                       defaulttablemodel.addColumn(rmeta.getColumnName(i));
                             while(rs.next())
                                  for(int i=1;i<=numColumns;++i)
                                       if( i<=numColumns)
                                            tempname = rs.getString(i);
                                            tempcnt=i-1;
                                            data[tempcnt] = tempname;          
                                  defaulttablemodel.addRow(data);                              
                   catch(Exception ex)
              printButton.addActionListener(new ActionListener()
         public void actionPerformed(ActionEvent ae)
              /*if(ae.getActionCommand().equals("Print"))
              PrinterJob pj = PrinterJob.getPrinterJob();
              pj.setPrintable(cour.this);
              if (pj.printDialog())
              try
              pj.print();
              catch (PrinterException pe)
              System.out.println(pe);
    exitButton.addActionListener(new ActionListener()
         public void actionPerformed(ActionEvent ae)
              choice ch=new choice();
                   setVisible(false);
                   ch.setVisible(true);
    setContentPane(panel);
         setSize(1040,780);
    /*Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension frameSize = getSize();
    int x = (screenSize.width - frameSize.width) / 2;
    int y = (screenSize.height - frameSize.height) / 2;
    setLocation(x, y);*/
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    dispose();
    System.exit(0);
    public int print(Graphics g, PageFormat pf, int pageIndex)
    if (pageIndex != 0) return NO_SUCH_PAGE;
    Graphics2D g2 = (Graphics2D)g;
    g2.translate(pf.getImageableX(), pf.getImageableY());
    getContentPane().paint(g2);
    return PAGE_EXISTS;
    }

  • How to use Crystal report with Java

    Dear everyone,
    i am completely new to Crystal report , please can anyone help me to creat a very simple Report using the Crystal report,
    the report will show some records from oracle DB.
    How can i make it by a simple example and with code please?
    do i need any JAR or Bean for Crystal report?
    thanks for your help and please don't hesitate to contact me in case of any inquiries.
    my email: [email protected]
    Thanks in advance

    1. Don't ask people to reply by private email. Most Forum regulars believe solving problems should be a public, transparent process during which a first try at an answer can and should be corrected if someone more knowledgeable notices that it is incomplete or incorrect. Also, they get some of their reward for being respondents from being seen to be competent and knowledgeable by their peers.
    2. Don't flag your question as urgent, even if it is for you. Claiming urgency is very likely to be counter-productive: most forum regulars will simply ignore such messages as rude and selfish attempts to elicit immediate and special attention.
    Besides, unless a legion of ninja lemmings is about to chase you over the edge of a cliff, your problem probably isn't as urgent as you think.
    3. Please make the extra effort to write out words such as "please". The extra keystrokes won't cost much in the way of time, and the enhanced clarity will be appreciated by those communicating on a forum with international readership.
    4. STFW.

  • Crystal Reports with Java in Unix Environment

    We have Crystal Enterprise Professional Edition and Embedded Edition v10 with us.We want to use them for generating reports in our development project.
    We have to generate reports as batch jobs ( scheduled jobs) for which we will have a Java Application running in Z/OS (Unix zSeries). This Java Application will connect to our database(DB2) and retrieve data which should be filled in the report design(template).
    1.Can the .rpt file have the design alone(without the data from database).?
    2.Can we fill the data from the database using the .rpt file in a Java Application using an API ?
    3.Can we export this file(report with data) to a text file with a specific character encoding.?
    All the above has to be done using a Java Application that will run in a Z/OS(Unix Environment).
    4.Is Java API for the above operations available as a .jar file that can be included in our classpath in UNIX Environment ?
    I request you all to help me with these queries as soon as possible.
    Million Thanks in Advance.

    Hi,
    It seems that you are having issue with Crystal reports Java SDK's.
    Post your question in Java Development - Crystal Reports forum.
    That forum is monitored by qualified technicians and you will get a faster response there. Also, all Java Development queries remain in one place and thus can be easily searched in one place.
    Thank you for your understanding
    Amit
    Edited by: Amit Singh on Dec 2, 2008 2:55 PM

  • Help to reg. crystal report with java

    hi friends,
    I have installed the crystal report and J-Integra also.
    but I am not able to find the crystl32.ocx in my c:\windows\system32 folder .
    So I downloaded it separately and use the J-Integra's com2java convertor to generate crystal package.
    Then as per manual I compiled that package and created crystal.jar file.
    And while try this setting with a sample code.
    package javaapplication10;
    public class CrystalClient {
      private static final String CONNECT_STRING = "DSN=test";
      private static final String REPORT_FILE_NAME = "d:\\arp\\cryrpt1.rpt";
      private static final String SQL_QUERY = "select * from tab1";
      private static final String PRINT_FILE = "d:\\arp\\YourNewReport.doc";
      public static void main(String args[]) throws Exception{
        try {
          crystal.CrystalReport report = new crystal.CrystalReport();
          report.aboutBox(); // Lets see if it was loaded properly
          report.setConnect(CONNECT_STRING);
          report.setReportFileName(REPORT_FILE_NAME);
          report.setSQLQuery(SQL_QUERY);
          report.setPrinterCopies((short) 1);
          report.setPrinterCollation(crystal.PrinterCollationConstants.crptDefault);
          report.setDestination(crystal.DestinationConstants.crptToFile);
          report.setPrintFileName(PRINT_FILE);
          report.setPrintFileType(crystal.PrintFileTypeConstants.crptWinWord); // Change output type if necessary
          report.printReport();
        } finally {
          com.linar.jintegra.Cleaner.releaseAll();
    [\code]
    During compilation no error found.
    But during runtime it says that
    init:
    deps-jar:
    compile-single:
    run-single:
    J-Integra 2.6 Copyright (c) Intrinsyc Software International, Inc. http://j-integra.intrinsyc.com/
    Thank you for choosing J-Integra.
    You have been evaluating this product for 2 days.
    Please visit http://j-integra.intrinsyc.com/ for
    documentation, support, and purchasing information.
    Exception in thread "main" AutomationException: 0x80040154 - Class not registered
    at com.linar.jintegra.bt.b(Unknown Source)
    at com.linar.jintegra.Rpc.a(Unknown Source)
    at com.linar.jintegra.bm.a(Unknown Source)
    at com.linar.jintegra.Dispatch.createDispatch(Unknown Source)
    at com.linar.jintegra.Dispatch.<init>(Unknown Source)
    at crystal.CrystalCtrlProxy.<init>(CrystalCtrlProxy.java:40)
    at crystal.CrystalReport.<init>(CrystalReport.java:117)
    at crystal.CrystalReport.<init>(CrystalReport.java:107)
    at javaapplication10.CrystalClient.main(CrystalClient.java:23)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 2 seconds)
    eventhough it is not the mistake of javacode.
    if anyone able to clarify my dobut kindly help me.
    Thanks in advance.
    Raj

    Multipost.
    http://forum.java.sun.com/thread.jspa?threadID=784597

  • Integrating Crystal reports with Java Portal (test=pluto,Prod=Vignette

    Hi,
    Crystal reports is new to me...so please don't mind if i sound outright silly, and would love a shove in the correct direction.
    This question might have been asked here (I tried searching for this.)
    Problem: We have some old CR9 reports with us which we want to migrate to our Portal installation Vignette Portal.
    I have seen some Portal integration kits but after having a look at them it seems it is ir-relevant to us...as it requires some server running...we don't have that.

    Update:
    After more investigation, it looks as if the BO Server "CrystalReports2013ReportApplicationServer"
    from time to time has an issue - not only when promoting, but also when viewing publications that contain Crystal Report documents or when executing them, the java class error or similar issue is thrown.
    Did sb face similar behaviour and knows what is the root cause for "CrystalReports2013ReportApplicationServer" not working probably and throwing the java-class error? - it was running fine for several months, now, the class error showed up twice in one month.
    We need to find out what is causing the issue (aleady checked tomcat and BO-logfiles...).
    Best Regards
    Florian

  • Crystal Report with Java

    Hi
    I m using NetBeans for Java(Swing+JDBC) development
    I wana call Crystal Report file (.rpt) file from Java
    I found following source on Sun Forums:-
    import java.awt.*;
    import javax.swing.*;
    import com.crystaldecisions.ReportViewer.*;
    // Use these to talk to RAS
    import com.crystaldecisions.sdk.occa.report.application.*;
    import com.crystaldecisions.sdk.occa.report.reportsource.*;
    public class HelloWorldSwing
        private static void createAndShowGUI()
            try
                //Make sure we have nice window decorations.
                JFrame.setDefaultLookAndFeelDecorated(false);
                //Create and set up the window.
                JFrame frame = new JFrame("HelloWorldSwing");
                frame.setTitle( "Testing 1, 2, 3");
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                ReportViewerBean     viewer = new ReportViewerBean();
                viewer.init( new String[0], null, null, null);
                ReportClientDocument     rpt = new ReportClientDocument();
                // FLui: set the RAS server if you are using RAS
                rpt.setReportAppServer( "localhost" );
                rpt.open( "ras://C:\\Reports\\MyReport.rpt", 0 );
                IReportSource     rptSource = rpt.getReportSource();
                viewer.setReportSource( rptSource );
                frame.getContentPane().add( viewer, BorderLayout.CENTER );
                frame.setSize( 700, 500 );
                frame.setVisible(true);
                viewer.start();
            catch ( Exception exception )
                System.out.println( exception.toString() );
        public static void main(String[] args)
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            //com.crystaldecisions.ReportViewer.ReportViewerFrame.main( args );
            javax.swing.SwingUtilities.invokeLater(new Runnable()
                public void run()
                    createAndShowGUI();
    }Presently I need ReportViewer.jar
    If any one have, please give me at <[email protected]>
    Also guide me how we can pass sql & parameters to Crystal Report

    http://www.google.co.za/search?hl=en&q=%2Bjava+%2B%22crystal+reports%22&meta=
    Gives this as the first result:
    http://www.businessobjects.com/products/reporting/crystalreports/java/default.asp
    You then search the site:
    http://www.businessobjects.com/search/?summary=1&client=www_frontend&proxystylesheet=www_frontend&output=xml_no_dtd&lr=lang_en&oe=utf8&ie=utf8&website=&ct=livewww-all&q=java
    Which leads you to this page:
    http://www.businessobjects.com/products/dev_zone/java/default.asp
    Try STFW, RTFM and implement something, then ask a specific question.

  • Print option in report viewer of crystal report in Java

    I am using following code to view the report:
    <%@taglib uri="http://www.businessobjects.com/jsf/crystalreportsviewers"
    prefix="bocrv"%>
    <bocrv:reportPageViewer viewerName="CrystalViewer"
    reportSource="#{CrystalReportBeanObject.reportSource}"
    displayToolbarRefreshButton="false"
    allowDatabaseLogonPrompting="false"
    allowParameterPrompting="false"
    databaseLogonInfos="#{CrystalReportBeanObject.connectionInfosCrystal}"
    parameterFields="#{CrystalReportBeanObject.fieldsCrystal}"
    displayGroupTree="false" displayToolbarLogo="false"
    displayToolbarToggleTreeButton="false"
    enablePageToGrow="false" height="540"
    zoomPercentage="100" width="750"
    allowDrillDown="false"
    displayToolbarPrintButton="true"
    printMode="PDF"
    ></bocrv:reportPageViewer>
    Here, when printMode="PDF", it opens a popup, telling "First save the report as PDF and then print it", as soon as I click Print icon.
    But when printMode="ActiveX", it opens a blank popup, as soon as I click Print icon.
    I am not sure, which print mode should I use, so that my report viewer will show the Printer lists as soon as I click on Print icon.

    Hi Nandakumar,
    In my opinion, this thread is related to ASP.NET forum. This forum is to discuss problems about C# programming. So please post thread on ASP.NET forum for more effective response. Thank you for understanding. Please refer to the following link.
    http://forums.asp.net/.
    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.

  • "Create Report" OR ONLY "edit report" with java?

    Dear all
    Is it possible to create a new crystal report with java?
    Do you have some classnames, methodenames, etc that bring me back on the right track?
    I found: "With the latest versions of Crystal, there is no way to actually allow your users to create a report.  There used to be a COM component called "RDC", but that was deprecated with Crystal XI and is no longer available."
    My Version is Crystal Reports 2008 - is this still up to date?
    best regards!
    Edited by: gipsomat on Dec 17, 2010 12:31 PM

    You would want to look for Crystal Reports for Eclipse 2.0 which is the equivalent Java SDK for Crystal Reports 2008.  You can then find samples for Report Modification [here|http://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsJava+SDKSamples#CrystalReportsJavaSDKSamples-ReportModification]
    Generally you need to start with loading an rpt file, but this report can be blank.

  • 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

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

  • Which is better to use Store Procedure or Views in Crystal Reports ?

    Hi,
    which one is more better to use Store Procedure or Views in Crystal Reports ?
    Thanks.

    It depeneds on the requirement. Well, but from performance point of view as u know that stored procedures are already compiled on DB side, they would be more efficient. Views are handled differently. Here CR has nothing to do with it.
    But if the stored procedure u r using is having 2 Select statements, CR will only display the results from the first select statement. In that case you need to use Views as one can use more than one views in the report and join them.
    Using a Generic view which is created by the DBA for a larger audience will result in performance issues meaning if a View "V" has 25 fields and View is based on 5 tables  and ur report is using only 5 fields which are coming only from 2 tables inside the view,in this case u will end up in joining 3 more tables unnecessarily.
    Hope this helps!

Maybe you are looking for

  • Cash Management - Bank Statement Open Interface

    Bank Statement Open Interface (The tables are ce_statement_headers_int_all and ce_statement_lines_interface) I am trying to load the bank statements with Journal Lines and trying to reconcile them using Autoreconcilation but I am getting error. ( I a

  • IPhone cannot sync with Windows 7

    Hi, I am unable to sync my iPhone (OS 4.3.3) can't be paired with my laptop (Windows 7).  I have reinstalled my iTunes and restart my laptop but it still did not work.  My power button is not working hence I am unable to restart my iPhone.  Does any

  • Access point problem

    I installed a MIDlet in my nokia 6600. When application tries to open an Http connection I have to select the access point. In my mobile I have set my default access point. Still it asks me to select access point everytime. How can I make the access

  • Template parameters showing reverting to old data

    Hi I added meta-data using template parameters. For some reason DW reverted back to showing old meta-data on the page. When I checked the template parameters fields it showed the latest meta-data. it just had not been written to the page. Is this a k

  • Is Lion compatible with Adobe CS4 products?

    I have heard that Lion doesn't work well with many Adobe products once upgraded. I have all of the Adobe CS4 Design Suite products, does it work well for others? Thanks-