Setting tray selects inside the crystal report

I am writing a report which will have 3 possible page layouts.
I would like to print page 1 from a specific tray while page 2 and 3 from a  differenet tray.  Is there a way to control this or set
the paper source/ printer tray from inside the crystal report itself?  
Thank you so much for your time on this.

Hi
In Crystal Reports Designer we can not select the print tray at runtime for a single report however to workaround on this, you can insert different subreports.
Insert subreport for different chunk of data for which you want different trays. Please note inserting multiple subreports can cause a slower execution of report.
Go to file ->print -> set the tray from Printer paper -> source
but it depends on the type of printer is in use and on the printer driver.As its printer dependent you need to check the printer options for trays in control panel.
Hope this helps!!
Amit

Similar Messages

  • How to set database location in the crystal report X1 from the Source code.

    Dear All,
    I am using Crystal report X1 for report generation.Now I am setting the database location manually in the crystal report. How can I Set the database location from the Source code.
    Awaiting for your reply.
    Thanks in advance.
    Regards,
    Rahaneef T

    Here's a routine that also searches for subreports to set the log on info. Simply remove that aprt to set the main report logon info:
    IDatabaseTablePtr pTable;
    //get first table
    pTable = m_Report->Database->Tables->GetItem(1) ;
    long lTableCount = m_Report->Database->Tables->Count;
    for( long lTable=1; lTable<=lTableCount; lTable++ )
         pTable = m_Report->Database->Tables->GetItem(lTable);
         pTable->ConnectionProperties->DeleteAll();
         pTable->ConnectionProperties->Add("DSN", "Name of your DSN");
         pTable->ConnectionProperties->Add("Database", "Demo");
         pTable->ConnectionProperties->Add("Password", "sa");
         pTable->ConnectionProperties->Add("User ID", "1Oem2000");
    // Log on the tables of the subreports.
    long lSectionCount = m_Report->Sections->Count;
    for( long lSection=1; lSection<=lSectionCount; lSection++ )
         ISectionPtr pSection = m_Report->Sections->Item[lSection];
         long lSubreportCount = pSection->ReportObjects->Count;
         for( long lSubreport=1; lSubreport<=lSubreportCount; lSubreport++ )
              IReportObjectPtr pSubreportObject = pSection->ReportObjects->Item[lSubreport];
              CRObjectKind crObjectKind;
              pSubreportObject->get_Kind(&crObjectKind);
              if( crObjectKind == crSubreportObject )
                   ISubreportObjectPtr SubReportPtr = pSubreportObject;
                   IReportPtr pSubReport = SubReportPtr->OpenSubreport();
                   long lTableCount = pSubReport->Database->Tables->Count;
                   for( long lTable=1; lTable<=lTableCount; lTable++ )
                        pTable = m_Report->Database->Tables->GetItem(lTable);
                        pTable->ConnectionProperties->DeleteAll();
                        //pTable->ConnectionProperties->Add("DSN", "dwcb12003");
                        pTable->ConnectionProperties->Add("Database", "CrystalEport_DB");
                        pTable->ConnectionProperties->Add("Password", "sa");
                        pTable->ConnectionProperties->Add("User ID", "1Oem2000");
    If that doesn't work you need to tell us what is the error you are getting and paste in the code you are using.

  • How do you set the Crystal Report Viewer Printer to Duplex

    Using the code below I can print in duplex mode, but this does not let me view a report before printing
    How do I set the Printer in the Viewer Control Bar of the Crystal Report Viewer to Duplex Printing programmatically rather than having to manually select Duplex through the preferences option?
    I have searched but the only example code I found produces errors in the code and will not run
    Private myReport As ReportDocument
    myReport = New ReportDocument()
    myReport.PrintOptions.PaperSize = PaperSize.PaperA4
    myReport.PrintOptions.PaperOrientation = PaperOrientation.Portrait
    myReport.PrintOptions.PrinterDuplex = PrinterDuplex. Vertical
    myReport.PrintToPrinter(3, False, 0, 0)
    In my VB6 Project that I am converting to VB.NET when I added Report.PrinterDuplex = crPRDPVertical, this allowed me to view the report and then print with Duplex without having to set the Print Preferences manualy
    I found 1386475 - How to set printer name and print job title at runtime using Report Application Server SDK for Visual Studio .NET
    But this causes errors
    Imports CrystalDecisions.ReportAppServer.ClientDoc
    Imports CrystalDecisions.ReportAppServer.Controllers
    Dim boReportClientDocument As ISCDReportClientDocument
    Dim boPrintOutputController As PrintOutputController
    Dim boPrintReportOptions As New PrintReportOptions
    Edited by: DavidMills on Feb 18, 2011 11:58 AM

    Hi David,
    You can mix both engines, just declare them both with different report object names. Here's all of my references:
    using System;
    using System.IO;
    using System.Xml;
    using System.Drawing;
    using System.Collections;
    using System.ComponentModel;
    using System.Windows.Forms;
    using System.Data;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;
    using CrystalDecisions.ReportAppServer.ClientDoc;
    using CrystalDecisions.ReportAppServer.Controllers;
    using CrystalDecisions.ReportAppServer.ReportDefModel;
    using CrystalDecisions.ReportAppServer.CommonControls;
    using CrystalDecisions.ReportAppServer.CommLayer;
    using CrystalDecisions.ReportAppServer.CommonObjectModel;
    using CrystalDecisions.ReportAppServer.ObjectFactory;
    using System.Data.OleDb;
    using CrystalDecisions.ReportAppServer.DataSetConversion;
    using CrystalDecisions.ReportAppServer.DataDefModel;
    using CrystalDecisions.ReportSource;
    using CrystalDecisions.Windows.Forms;
    using System.Data.SqlClient;
    using System.Runtime.InteropServices;
        public class frmMain : System.Windows.Forms.Form
            CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument rptClientDoc;
    My file open dialog:
            private void btnOpenReport_Click(object sender, System.EventArgs e)
                rptClientDoc = new CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocument();
                openFileDialog.Filter = "Crystal Reports (*.rpt)|*.rpt|Crystal Reports Secure (*.rptr)|*.rptr";
                openFileDialog.FilterIndex = 1;
                 if (openFileDialog.ShowDialog() == DialogResult.OK)
                      btnOpenReport.Enabled = false;
                      btnSaveRptAs.Enabled = false;
                      object rptName = openFileDialog.FileName;
                    try
                        rpt.Load(rptName.ToString());
                        rptClientDoc = rpt.ReportClientDocument;
                    catch (Exception ex)
                        MessageBox.Show("ERROR: " + ex.Message);
                        return;
                    MessageBox.Show(rptClientDoc.MajorVersion.ToString() + "." + rptClientDoc.MinorVersion.ToString());
                        MessageBox.Show("Report opened.","RAS",MessageBoxButtons.OK,MessageBoxIcon.Information );
                        btnOpenReport.Enabled = true;
                        btnSaveRptAs.Enabled = true;
                    //MessageBox.Show(rpt.RecordSelectionFormula, "my record: ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    MessageBox.Show(rpt.ReportRequestStatus.NumberOfPages.ToString(), "Number of Pages: ", MessageBoxButtons.OK, MessageBoxIcon.Information);
    As for the page number I use it off the Engine report object:
    MessageBox.Show(rpt.ReportRequestStatus.NumberOfPages.ToString(), "Number of Pages: ", MessageBoxButtons.OK, MessageBoxIcon.Information);
    And it works for me...
    Thank you
    Don

  • How to set printersettings for the crystal report viewer in SAP BI dynamically

    Hello
    I have set the URL method for my crystal report and with parameter passing as shown below, it was displaying the crystal report viewer by connecting to the SAP BI 4.0 server with this method.
    http://cr:port/businessobjects/enterprise115/desktoplaunch/opendoc/openDocument.jsp?sDocName=CRLabelParam&sType=rpt&lsSnPrinted=0&lsSsTestProjectNr=1
    This URL will be called from Web application by different users, i would like to set the printer settings differently for different users for this crystal report viewer how shall i need to set the printer options?
    shall i need to set the printer settings programatically for each user. Please advise me how do i need to proceed.
    Thanks & Regards,
    Rajeswari.

    There are no BI / CR APIs that would do this for you. The way I see it, you'll have to have your own print button and populate it with the correct printer information for each user as they request the report. Of course, alternatively, use the viewer printer button and get the users to choose the correct printer.
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Hiding the Selected field in the Crystal reports 2011

    Hi Experts,
              I am new to the Crystal reports. How to hide the Selected Field in the Crystal report 2011.
    Thanks,
    Kavya.C

    Hi Kavya,
    You can right click on the field, go to Format Field -> Common Tab. Select/Check the option "Suppress". Or if you want to hide/ Suppress the entire section in a Crystal Report, for e.g. Detail section, right click on Details Section and select Section expert. You can select Hide/Supress accordinly.
    That should hide the filed/Section when you run the report.
    - Kuldeep

  • Display User Selection Results on Cover Sheet of the Crystal Report

    How do you display the result of a multi-level dynamic parameter that the user has selected on the cover sheet of the crystal report.
    Or Display the Start & Ending selection results from a dynamic parameter on the cover sheet of the crystal report.

    Replace the code with:
    stringvar selection;
    stringVar array arr1;
    numberVar i;
    redim preserve arr1[count({?ProductID})];
    for i := 1 to count({?ProductID}) step 1 do
    arr1<i> := {?ProductID};
    selection:= 'ProductID is : ' & chr(39) & join(arr1,",") & chr(39);
    This should hopefully fix the error, but I don't think it will solve your problem as it might keep assigning the same product id to each element of the array.
    Have you tried just join({?parameter},', ') as suggested by RG?
    Edited by: Sanjay Kodidine on Jul 1, 2009 10:22 AM

  • SAP B1 Closes when Running the Crystal Report

    Hi SAP Expert,
    I have a problem during running the customized report i've created in Crystal. I created a stored procedure please see my code below. The Crystal Report is running during development but when i exported to SAP B1 and run the report. The SAP Business One will terminated. Any help please...
    CREATE PROCEDURE [dbo].[SP_ACTUALPURCHASESV3]
         -- Add the parameters for the stored procedure here
         @FROM DATETIME,
         @TO DATETIME
    AS
    BEGIN
         SET NOCOUNT ON;
         SET @FROM = CAST(CAST(MONTH(@FROM) AS NVARCHAR) + '/' +
                        CAST(DAY(@FROM) AS NVARCHAR) + '/' +
                        CAST(YEAR(@FROM) AS NVARCHAR) + ' 00:00:00:000' AS DATETIME)
         SET @TO = CAST(CAST(MONTH(@TO) AS NVARCHAR) + '/' +
                        CAST(DAY(@TO) AS NVARCHAR) + '/' +
                        CAST(YEAR(@TO) AS NVARCHAR) + ' 23:59:59:000' AS DATETIME)
         SELECT
              (SELECT DocEntry FROM OPOR WHERE OPOR.DocNum = PDN1.BaseRef) as  PODocentry,
              PDN1.BaseRef AS PONum,
              OPDN.DocEntry,
              OPDN.DocNum,
              OPDN.DocType,
              (select ocrd.lictradnum from ocrd where ocrd.cardcode = opdn.CardCode) as LicTradNum,
              OPDN.CardCode,
              OPDN.CardName,
              OPDN.DocDate,
              CASE WHEN PDN1.WhsCode IS NULL THEN PDN1.AcctCode ELSE PDN1.WhsCode END AS WhsCode,
              CASE WHEN PDN1.WhsCode IS NULL THEN (SELECT OACT.AcctName FROM OACT WHERE OACT.AcctCode = PDN1.AcctCode) ELSE (select OWHS.WhsName from OWHS where OWHS.WhsCode = PDN1.WhsCode) END AS WhsName,
              CASE WHEN PDN1.ItemCode IS NULL THEN 'N/A' ELSE PDN1.ItemCode END AS ITEMCODE,
              PDN1.Dscription,
              PDN1.Quantity,
              PDN1.unitMsr,
              PDN1.Price,
              PDN1.PriceBefDi,
              PDN1.PriceAfVAT,
              CRD4.WTCode,
              OWHT.RATE,
              (case when pdn1.quantity > 0 then (pdn1.Price * pdn1.Quantity) else PDN1.Price end ) * (OWHT.rate/100) as EWTVALUE
         FROM OPDN JOIN PDN1 ON OPDN.DOCENTRY = PDN1.DOCENTRY left join CRD4 on OPDN.CardCode = CRD4.CardCode left join OWHT on OWHT.WTCode = CRD4.WTCode
         WHERE OPDN.DocDate BETWEEN @FROM AND @TO  and OPDN.CANCELED = 'N'
         --WHERE OPDN.DocNum = 2542
         ORDER BY OPDN.DocDate
    END

    Hi,
    Does it means we are allowed to create stored Procedure inside the Company Database. We only use selecting and joining tables and somehow some complex sql procedures to meet our requirements.
    Thanks, but my question is if there's nothing wrong with it why my SAP B1 Closes when previewing the Crystal Report. Im running on Windows 7 64-bit, i will not imagine that the capacity of memory of my Terminal Unit is not enough because my memory is 8GB. I run crystal report but it shows the record, but when running the Cystal Viewer inside SAP B1 it illegally terminated.
    Thanks for clarifying the creation of Stored Procedure.
    Ben

  • Windows 2008 problems with Delphi and the Crystal Reports VCL

    Anybody had any luck with Crystal XI using the VCL on a Windows 2008 machine?
    In testing we've found that everything seems to work, except that the user can not select a different printer.  When I go to the Printer Setup button, the panel that pulls up used to have, in previous Windows versions, a printer button inside the Printer Options box.  Windows 2008 does not, so the end user can not select a different printer to print to than their default.
    Anybody have any ideas on:
    1) Am I just doing somthing wrong
    2) A fix for the Crystal XI VCL that will address the probelm
    3) An option on how to call Crystal Reports from inside a Delphi program without the VCL?
    Obviously, I'm hoping I don't have to go with #3, but if that's the only solution I guess I need to know now.
    Mike Nielsen

    Hi Mike,
    Try these links:
    https://www.sdn.sap.com/irj/boc/businessobjects-samples?rid=/webcontent/uuid/80774579-b086-2b10-db91-ed58c4dda375
    If that link doesn't work try this one:
    https://www.sdn.sap.com/irj/boc/businessobjects-samples
    Then click on the Crystal Reports .NET SDK link.
    Gets you to the .NET downloads and you should see this, try the RAS samples, gives you the most functionality:
    Crystal Reports .NET SDK Applications
    All Sample Applications
    All | Exporting/Printing | Report Modification | Viewing | Home
    Report Application Server .NET Sample Code Code Sample(ZIP 177 KB)
    Contains Visual Studio 2005 Web sample code pages that highlight features of the RAS SDK, including report parameter and formula modification, database logon, and exporting.10 Oct 2008
    NET-CS2005_CRNET_CR115_Set_Viewer-Locale-by-Page Code Sample(ZIP 51 KB)
    This sample shows you how to change the multilingual settings for the .NET web form viewer control (CrystalReportViewer) to any locale of your choice. The locale is set via a QueryString variable. The settings are changed on the webform page level instead of using the web.config. Changing the Regional Settings or IE Language Settings will not impact this sample. Note: This has only been tested on Crystal Reports XI R2 with Visual Studio .NET 2005.14 Jul 2008
    NET-CS2003_RAS-Unmanaged_CR115_Modify_Command-Table-SQL Code Sample(ZIP 31 KB)
    "This sample application shows how to retrieve and change the text of a SQL command table from a Crystal Report using the CR .NET SDK and in-process Report Application Server (RAS) Report Creation API (RCAPI). Note that you must have SP2 for Crystal Reports XI R2 for this sample to work. Previously you could access the RAS .NET SDK from the ReportDocument object only if you had a dedicated RAS server. Now you can use RAS in-process to accomplish this. "05 Mar 2008
    NET-CPP-Win2005_CRNET_CR115_Change_Record-Selection-Formula Code Sample(ZIP 3 MB)
    A .NET C++ Windows application that demonstrates how to change a record selection formula at runtime.03 Mar 2008
    Crystal Reports 2008 .NET SDK Tutorial Samples Code Sample(ZIP 2 MB)
    This sample contains Visual Studio 2005 Web sample code projects that highlight features of the Crystal Reports .NET SDK, including viewing and exporting reports, filtering data and setting parameters, and connecting to different data sources.19 Feb 2008
    NET-CS2005_CRNET_CR115_Modify_Image-Location Code Sample(ZIP 90 KB)
    This sample application shows how to change an image in a Crystal Report at runtime using the graphic location formula in the CR .NET SDK (C#).16 Feb 2008
    NET2003-CS-Web_CRNET_CR115_change_graphic-location Code Sample(ZIP 103 KB)
    This sample application shows how to change an image in a Crystal Report at runtime using the graphic location formula in the CR .NET SDK (C#).31 Jan 2008
    Crystal Reports .NET SDK u2013 Sample Applications from Tutorials Code Sample(ZIP 1 MB)
    This file contains C# and VB .NET Windows and web sample applications. These samples were built using the tutorials provided in the u2018Crystal Reports .NET SDK u2013 Additional Documentation and Tutorialsu2019 (cr_net_sdk_additional_en.zip). These sample applications apply to Crystal Reports 9 and 10, and Crystal Reports for Visual Studio .NET 2002 and 2003.10 May 2006
    Thanks again
    Don

  • Display only graph in the Crystal report viewer

    Background:
    We used Crystal Reports ver10 to display various graphs in our ASP.Net 2.0 Web Application (Visual Studio 2005)
    We recently migrated our application to .NET 4.5 and Crystal Reports ver13 (Visual Studio 2012)
    Issue:
    Now, the Crystal Report Viewer control loads the graph inside an <IFRAME> which shows the whole page with the graph placed on the right bottom corner instead of just the graph image as it used to previously.
    I have checked various properties that hides the tree and the toolbar and I am unable to get rid of the whole page.
    Query:
    Is there a way to not display the page and display only the image that contains the graph? OR
    Is there a way to not render the whole <iframe> and just display the graph image inside a <div> as it used to happen before?

    Hi Ludek, thanks for your response. Please refer the screenshots below.
    1) CR ver10 - the graph <img> is simply enclosed inside a div
    2) CR ver13 - the graph <img> is enclosed inside an <iframe>'s body - you can also see the scroll bars and "white-page-background" and "grey space" which I am hoping to hide or disable
    3) We are using the same set of CRViewer properties in both cases:
    - DisplayGroupTree = False
    - DisplayToolbar = False
    - HasDrillUpButton = Flase
    - HasRefreshButton = False
    - HasToggleGroupTreeButton = Fasle
    - HasViewList = False
    - HasZoomFactorList = False
    - EnableViewState = True
    4) Here's a screenshot of of the .rpt file opened in the VS 2012:
    We only want to render the graph image on the UI and not the whole page. Is there a property setting that will help us achive this or should we define explicit CSS styles to hide those areas?
    Thank you for looking into this!
    Avrosh

  • Altering schema of tables/objects inside a crystal report through API

    hi all,
            We run crystal reports through a Java application (using CR4E API) connecting to Oracle database. All the tables/views within the report do not use fully qualified names (i.e. schemaName.objectName) instead they use the object name alone. Earlier we would run all the reports logging in as the schema owner and hence all the objects would be accessible without issue. Per a new requirement we now log in as a non-schema owner ID and the objects are now not accessible to this user id unless a fully qualified object is not provided as the default context schema will now be different.
           We tried altering the schema through the API like so,
            ITable origTable = null;
            ITable newTable = null;
            String DB_USER_NAME = username;
            String DB_PASSWORD = password;
            String TRUSTED_CONNECTION = "true";
            String SERVER_TYPE = "JDBC (JNDI)";
            String USE_JDBC = "true";
            String DATABASE_DLL = "crdb_jdbc.dll";
            String JNDI_DATASOURCE_NAME = jndiName;
            String CONNECTION_URL = connectionURL;
            String DATABASE_CLASS_NAME = driverName;
    Tables tables = clientDoc.getDatabaseController().getDatabase().getTables();
                for(int i = 0;i < tables.size();i++){
                    origTable = tables.getTable(i);
                    if (tableName == null || origTable.getName().equals(tableName)) {
                        newTable = (ITable)origTable.clone(true);
                    newTable.setQualifiedName("TestSchema." + origTable.getAlias());    <--- Set actual schema here but it still takes the alias as "command"
    Are we doing anything wrong here? It appears that the table name is always "command", internally I think CR uses the name command for its table and we are not allowed to change it. The table name, alias and qualifier name are be default set to "command" by CR. If I append schema name to the table name I get schemaName.command as against schemaName.objectName.
    Synyonyms are not an option for us for various reasons. We will not be able to go down that road no matter what. However we are looking at an API related solution here so if anyone could advise in this regard it would be very helpful.

    Lindell - your response was very helpful.  I was able to create a SQL Command on the subreport and change the subreport links on the main report to use the paramters in the SQL Command.  The report is now very fast - even when there are lots of detail records on the main report.  It is properly executing the query and not reading all 2M records into memory for each subreport.
    I'm still totally confused as to why Crystal was misbehaving so poorly and changing how the subreport queried the database when the only change was the fields used for record selection on the main report.  It really looks like a bug to me, but maybe someone can still enlighten me.
    thanks again so much.  We are in Parallel testing for a production rollout - and the users are MUCH happier now!  (which of course makes me much happier!)
    Susan
    PS I was not aware of the SQL Command - had never used it before.  Took me a little while to figure it out and how to do the linking - but it is very powerful.  Thanks again.

  • Selection Screen for crystal report ?

    Hi to all,
    Is it possible to create selection screen using Crystal report designer alone ?
    I came to know that we can give selection parameteres using SELECT EXPERT option in desginer.
    Can we create selection screen for user input like we have in abab (selection screen) ?.
    Is it possible to check authorization using Crystal report designer ?
    If anyone knows anything .... remotely connected with the question I asked please reply.
    Waiting for reply.
    Regards,
    Surya.

    Surya,
    To do what you are wanting, you will want to do the following:
    1) Create parameters. Open the Field Explorer > right click Parameter Fields > fill in the necessary fields o create the desired parameter.
    2) Add the parameter to the Select Expert.
    2a) If you are using a SQL Command to generate your data set you will need to add the parameter name to the Parameter List of the Command and add it the selection criteria of the SQL statement.
    Something like this:
    WHERE f.FieldName = {?ParameterName}
    HTH,
    Jason

  • Switching the language of the "Crystal Reports for Eclipse" plugin

    Good day everyone,
    I would like to ask about configuring the language of the "Crystal Reports for Eclipse" plugin:
    - I have "Crystal Reports for Eclipse" version: 2.0.7.r1040
    - I have installed the language packs 1 and 2
    - Currently, the Crystal Reports perspective and the associated views are displayed in German.
    - I would like to switch these views back to English.
    Questions:
    1. How can I switch the language?
    2. Will this switching of the language have any known side effect on the existing reports, because some of the reports in my current project are displayed in German?
    Thank you in advance for your support.
    Best regards,
    Samar

    Hello everyone,
    I have found a solution for this question that I would like to share with you.
    - Browse the Control Panel
    - Open the Regional and Language Options
    - In the Regional Options tab under the Standards and formats group, select the Locale that you prefer.
    - *Restart Eclipse* and the Crystal Reports plugin would read the changed setting and display the Crystal Reports perspectives and views in the language of the selected Locale.
    Best regards,
    Samar
    Edited by: Samar Hossam on Jun 30, 2011 6:56 PM

  • 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

  • Not able to see the crystal reports XI version in the IE 7 and IE 8

    Hi Team,
    I am using web based application developed in VB,ASP,SQL SERVER,Crystal Reports(XI). I am able to see the Crystal Reports in IE 6. But i am not able to see the reports in IE 7 and IE 8. While clicking on the reports button it is showing the  red X image top left cornor.
    I am using CrystalActiveX viewer11 version for viewing the reports.
    In IE 6,if the client using fiirst time for vieiwing the reports,it will ask the Activexviewer control prompt and says ok,it will display the reports.
    Thanks and Regards
    Eshwar

    Thanks your advise.But we are using following crystal reports (XI) version and we don't have CRXI with R1 and R2.
    CurrentVersion:11.0.0.895 ( CR Developer and Product Type:Full)
    Crystal Reportviewer11 configured in the IIS which is version (5.0). and configured the virtual folder to C:\Program Files\Common Files\Business Objects\3.0\crystalreportviewers11\.
    Our web application code also configured in the IIS at same level.
    When the user wants to see the reports through the application,it will ask the Plugin of Crystal Report Viewer and user will download this plugin and it will save in the IE plug ins.It will ask only first time viewing the reports for the next onwards it will not ask or prompt of the Activex control.
    So please suggest me, is there any upgrade version of this Crystal Reportviewer11 needs to be installed or any browser setting need to be configured for IE 7 and IE 8.
    waiting for your reply.
    Regards
    Eshwar

  • How can I get the View Tab name on the Crystal Report Viewer at runtime?

    When a report is displayed in the Windows Forms Crystal Report Viewer and the user drills into the report, the drill down view is displayed in a seperate view and is identified via a View tab at the top of the report.  I can determine the index of the view tab that is currently selected, but I need to access the text that is on the View tab.  The only properties that I've found that pertain to the "view" on the Crystal Report viewer are the ActiveViewIndex and the ViewCount.  Unfortunately, neither of these items help me because they are not specific to a certain section of the report.  Has anyone had any luck accessing the View Tab properties ?  Thanks.

    The tabs at the top of the page are nested within some of the viewers controls. Through trial and error you just have to find the right one. In this case the main part of the report is in the first control. This happens to be a TabControl. From there you can loop through the TabPages on the TabControl to grab the names of the tabs.
    Here is a quick example of what I did to get the tab text. All this code was in a button click event.
    Control oControl = crystalReportViewer1.Controls[0];
    TabControl oTabControl = (TabControl)oControl.Controls[0];
    foreach (TabPage oTabPage in oTabControl.TabPages)
         MessageBox.Show(oTabPage.Text);

Maybe you are looking for

  • Problem with timed histogram counter

    I have tested a small bit of code (attached) that works fine by itself, but when I integrate it to another vi it has some difficulty.  I simply wanted to make take the output of a histogram (being summed) and time how long it could fill up rather tha

  • New syncing problem

    My ipod has recently started not syncing. Itunes recognises the ipod being there and tries to sync with it but the ipod doesn't sync. The only time I've been able to get the ipod to sync is after a restore but then the same thing happens the next tim

  • Problem exporting versions

    Anyone know why i can't export versions from aperture 2 on a new imac? Exporting masters is no problem; and I'm trying to export the versions in the same way, ie, file/export/version/s but the little dialogue box doesn't even appear for me to choose

  • TNS Protocol Adapter error

    I changed my Database Server's IP Address . Later get this Protocol Adapter error from Client machines. I change the IP address in Listner.. Where are the Other places need the Ip changes.. Please give a solution Shiju

  • Site Studio Placeholder question...

    Hello all, I was wondering if it's possible to check if a placeholder has a subtemplate, regiontemplate or data file associated to it through idoc... for example, consider the code below: <body> <div id="content"> <!--$wcmPlaceholder("Content_Placeho