Passing parameters to Crystal Reports 2008; C#

Hi,
we are developing a .NET C# application and would like to call a Crystal Reports document (version 2008) from there passing some parameters.
So we will build the Crystal reports with the necessary parameters - however, how can I pass them from our C# application? The Crystal reports will be stored locally.
Thanks!

First make sure you are on SP 3:
https://smpdl.sap-ag.de/~sapidp/012002523100007123572010E/cr2008_sp3.exe
SP 3 msi     
https://smpdl.sap-ag.de/~sapidp/012002523100007123592010E/cr2008sp3_redist.zip
SP 3 msm     
https://smpdl.sap-ag.de/~sapidp/012002523100007123582010E/cr2008sp3_mm.zip
Have a look at [Crystal Reports for Visual Studio 2005 Walkthroughs|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2081b4d9-6864-2b10-f49d-918baefc7a23]
(The above does apply to your version of CR also)
Have a look at the samples:
https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
And look at the Developer Help file:
http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_dg_12_en.chm
And don't forget to use the search box at the top right corner of this web page. It will bring up KBases, blogs, wikis, articles and more. Searching these forums is also a good idea.
- Ludek

Similar Messages

  • PASSING PARAMETERS TO CRYSTAL REPORTS THRU FORMS!

    Hi! all,
    Is there someone who passed parameters to crystal reports from
    forms 5.0?
    The problem is when I call the report executable from the form,
    its giving a login prompt again which is not desirable as @ this
    stage the user has already logged in once. So is there a way to
    pass this as a parameter to crystal or may be any better way???
    Thanx for the solution,
    Hima
    null

    First make sure you are on SP 3:
    https://smpdl.sap-ag.de/~sapidp/012002523100007123572010E/cr2008_sp3.exe
    SP 3 msi     
    https://smpdl.sap-ag.de/~sapidp/012002523100007123592010E/cr2008sp3_redist.zip
    SP 3 msm     
    https://smpdl.sap-ag.de/~sapidp/012002523100007123582010E/cr2008sp3_mm.zip
    Have a look at [Crystal Reports for Visual Studio 2005 Walkthroughs|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2081b4d9-6864-2b10-f49d-918baefc7a23]
    (The above does apply to your version of CR also)
    Have a look at the samples:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    And look at the Developer Help file:
    http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_dg_12_en.chm
    And don't forget to use the search box at the top right corner of this web page. It will bring up KBases, blogs, wikis, articles and more. Searching these forums is also a good idea.
    - Ludek

  • "Date / Date Time" type parameters in crystal reports 2008

    i am using parameters in crystal report to select records. one of the parameters is "From Date" of type Date Time.
    i mapped this parameter to a field "DateIn" of type smalldatetime in my sql table.
    Now, when i open the report it asks for "From Date" but b y default it sets the time to current time so i have to change it to 00:00:00 manually. i want it to show 00:00:00 by default. which means i don't want time here.
    For this if i select the datatype of parameter "From Date" as Date only then i am not able to map it to the "DateIn" field of the sql table.
    Please help me out of this.
    Edited by: rohit0825 on Jun 2, 2010 2:25 PM

    >
    Deepravs wrote:
    > Hi Rohit,
    >
    > Change the Parameter to Date Datatype and use this formula in the "Record Selection Formula " (Report Tab -> Selection Formulas -> Record)
    >
    > = CDateTime ({?From Date})
    >
    > Though the parameter is date datatype it converts to datetime datatype amd maps to the desired column.
    >
    >
    > Thanks,
    Great !!!
    this is working.
    i found another way, i changed the datatype of parameter to Date and click ok and everything was good, it doesn't require any conversion to date time.
    Thank You so much. All Points You.
    Edited by: rohit0825 on Jun 3, 2010 10:47 AM

  • How to Pass parameters to Crystal report 10 based on Oracle Stored Procedur

    Hi,
    I use the following code to pass the parameters:
    Rep.Tables[0].ConnectBuffer := Connection_Str;
    Rep.Tables[0].AliasName := 'REP';
    Rep.Connect.Propagate := True;
    Rep.ParamFields.ByName('Lang', '').CurrentValue := IIF(BiDiMode = bdRightToLeft, '2', '1');
    Rep.ParamFields.ByName('SESSION_ID', '').CurrentValue := IntToStr(Session_id);
    Rep.WindowState := wsMaximized;
    Rep.Show;
    The 1st parameter 'Lang' which created from crystal report pass well,
    but the 2nd parameter 'SESSION_ID' which created from Oracle Stored Procedures give the following Error:
    Error: 202 Parameter Name could not be found u2013 ParamFields.ByName
    However in MS SQL Server the above code work fine with the 2 Parameters.
    Any one has solution,

    Hello,
    Click on the businessobjects Tab above and then select Samples and dowload the sample app you for your SDK. There are a few samples for changing/setting Parameters.
    The Parameter collection has all parameters.
    Thank you
    Don

  • Passing Parameters to Crystal Report

    Dear all,
    I wonder if anybody has tried out the crystal report bundled with workshop
    in SP2.
    I got some problems when I try to pass a parameter from a jsp in workshop to
    crystal report according to part 4 of tutorial in the Crystal Reports for
    BEA Weblogic workshop Developer's guide.
    This message show in the web browser:
    com.crystaldecisions.report.web.viewer.CrystalReportViewer
    Some parameters are missing values
    However, the report viewer works fine in workshop if I am not passing
    parameters.
    If anyone has successfully setup a report which involves parameter passing
    in workshop, I would appreciate you can share the tricks how to make it
    work.
    Thanks!
    Orion Yiu

    Hi Orion,
    I have the same issue like the one you sent to bea helpdesk . Please, if you got any positive response on that issue. Need help. Thanks you for you time.
    Abdellah

  • SAP Crystal Report (2008) through SQL Query parameters

    Hi,
    I Created a report in Crystal report (2008) based on Sql Query. I created parameters in SQL query prompt only (all single valued).
    Based on this I need to show the data in detail section.
    For Graph, I used another SQL query, and added one subreport to the Main report header section. Since this subreport is also using the SQL query prompts for taking parameters.
    Since both the reports are using same set of parameters. I mapped Main report parameters to sub-report parameters.
    So Now structure is like,
    In a report there is one subreport.
    Main report ....SQL query generates parameter prompt..same parameters is passed to subreport.
    In subreport there are sql generated prompts. and we mapped that prompts to main report parameter prompts.
    Now it is running fine from crystal report, but not from CMC. It is not showing the graph.
    Made Two Experiment:
    1. To check subreport is running or not , Mannualy put my name in sub report--working fine.(CMC)
    2. To check the parameters are correctly mapped--printed the value in subreport--Showing all the parameters value from CMC
    but it is not running the SQL query of that sub report.
    Any suggestion ?? Or is there anyoption to check?? Or a CMC setting.
    Please suggest and respond..
    Thank you in advance.!!

    Hi Rajeev,
    This is Crystal reports development community, you said the report is working fine in Crystal. it is problem in CMC. So the issue is at BI Server.
    So i think you need to create the thread in the below community.
    BI Platform
    --Naga

  • Bapi Function call from Crystal reports 2008. import parameters syntax.

    Dear,
    I have an issue with calling a function directly from Crystal reports (2008) in the R3 system.
    (if this belongs in another thread , please add the link if moved !)
    I try to get data through function "BAPI_CLASS_GET_CLASSIFICATIONS".
    Till now all possible input parameters have no data-result.
    I already read other threads stating that 'for example' the Language key needs to be provided in a single character. 'E' in stead of 'EN'.
    I also already created a Z-wrap-function that fills out all input parameters 'hardcoded'. This works.
    clearly there are som syntax changes in passing the values to R3 when called from Crystal Reports.
    Can someone state which syntax has to be followed for numeric fields, for datefields etc. (so when i make these dynamical, I know which syntax should be the outcome of the formula)
    in my function that doesn't work I use these selections:
    (this function is called in a standard report only calling this function)
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_LANGU_ISO} = "E" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_LANGU_INT} = "E" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.T_CLASS_OBJECTS.OBJECT_TYPE} = "MARA" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.T_CLASS_OBJECTS.OBJECT_KEY} = "000000000000000085" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_CLASSNUM} = "DSWTEST" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_CLASSTYPE} = "001" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_KEY_DATE} = Date (2011, 08, 05)
    I already tried other languages or the 'EN' as input.
    (I would like to know how the date is passed exaclty to R3.)
    The function is of course RFC enabled.
    when I call the my Z-function with predefined inputparameters in R3 it does give the wanted result.
    FUNCTION ZBAPI_CLASS_GET_CLASSIFICATION.
    ""Local Interface:
    *"  TABLES
    *"      OBJECT_CLASSIFICATION STRUCTURE  BAPI_OBJECT_VALUES
    *"      CLASS_OBJECTS STRUCTURE  BAPI_CLASS_OBJECTS
    data ZOBJECT_CLASSIFICATION type TABLE OF BAPI_OBJECT_VALUES.
    data ZCLASS_OBJECTS  type TABLE OF BAPI_CLASS_OBJECTS WITH HEADER LINE.
    ZCLASS_OBJECTS-OBJECT_KEY = '000000000000000085'.
    ZCLASS_OBJECTS-OBJECT_TYPE = 'MARA'.
    Append ZCLASS_OBJECTS.
    CALL FUNCTION 'BAPI_CLASS_GET_CLASSIFICATIONS'
      EXPORTING
        CLASSTYPE                    = '001'
        CLASSNUM                     = 'DSWTEST'
    *   KEY_DATE                     = SY-DATUM
    *   LANGU_ISO                    =
    *   LANGU_INT                    =
    *   CHARACTS_OF_CLASS_ONLY       =
    * IMPORTING
    *   RETURN                       =
      TABLES
        OBJECT_CLASSIFICATION        = ZOBJECT_CLASSIFICATION
        CLASS_OBJECTS                = ZCLASS_OBJECTS
    OBJECT_CLASSIFICATION[] = ZOBJECT_CLASSIFICATION[].
    ENDFUNCTION.
    please advise.
    once again if this should be moved to another forum , add the link please!

    Dear,
    I just debugged my Z-function, after adding all input parameters as in the standard BAPI function.
    All parameters seems to be passed correctly except from the table parameters from
    CLASS_OBJECTS
    So all I_parameters are passed :
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_LANGU_INT} = "EN" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_LANGU_ISO} = "EN" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_KEY_DATE} = Date (2011, 08, 05) and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_CLASSNUM} = "DSWTEST" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_CLASSTYPE} = "001" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_CHARACTS_OF_CLASS_ONLY.BAPIFLAG} = ""
    but the table parameters aren't coming through:
    {ZBAPI_CLASS_GET_CLASSIFICATION.T_CLASS_OBJECTS.OBJECT_TYPE} = "MARA" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.T_CLASS_OBJECTS.OBJECT_KEY} = "000000000000000085" and
    these are 'blanco' in the function.
    also after the function is executed and all data is retrieved, when passing the data back to Crystal reports, once again, the table result isn't passed to Crystal Reports.
    please advise

  • Crystal Reports 2008 - passing a parameter in the Command Object

    Hi,
    I am using Crystal Reports 2008. I have 4 Command Objects where I have the following queries.
    select emrace, count(empl_id) cntFCiv  from emmain where emtype='CIV' and emsex ='F' and emdateterm is null group by emrace
    select emrace, count(empl_id) cntFSw  from emmain where emtype='SWOR' and emsex ='F' and emdateterm is null group by emrace
    select emrace, count(empl_id) cntMCiv from emmain where emtype='CIV' and emsex = 'M' and emdateterm is null  group by  emrace
    select emrace,count(empl_id) cntMSw from emmain where emtype='SWOR' and emsex = 'M' and emdateterm is null  group by emrace
    I want to pass a parameter  to all these command objects. I want the user to select a parameter from a list of values. So, I created a parameter object, Bureau. (I get the values for the parameter with this command object: select code_agcy, descriptn from systab1 where code_key = 'UNIT'). I want the user to be able to get the counts for each bureau.
    How do I pass the parameter that the user picked to those command objects. I tried doing this:
    select emrace, count(empl_id) cntFCiv  from emmain where emtype='CIV' and emsex ='F' and emdateterm is null
    and emunit = '{?Bureau}' group by emrace
    But it did not work. Any help will be greatly appreciated.
    Thanks.

    Hi,
    I am using Crystal Reports 2008. I have 4 Command Objects where I have the following queries.
    select emrace, count(empl_id) cntFCiv  from emmain where emtype='CIV' and emsex ='F' and emdateterm is null group by emrace
    select emrace, count(empl_id) cntFSw  from emmain where emtype='SWOR' and emsex ='F' and emdateterm is null group by emrace
    select emrace, count(empl_id) cntMCiv from emmain where emtype='CIV' and emsex = 'M' and emdateterm is null  group by  emrace
    select emrace,count(empl_id) cntMSw from emmain where emtype='SWOR' and emsex = 'M' and emdateterm is null  group by emrace
    I want to pass a parameter  to all these command objects. I want the user to select a parameter from a list of values. So, I created a parameter object, Bureau. (I get the values for the parameter with this command object: select code_agcy, descriptn from systab1 where code_key = 'UNIT'). I want the user to be able to get the counts for each bureau.
    How do I pass the parameter that the user picked to those command objects. I tried doing this:
    select emrace, count(empl_id) cntFCiv  from emmain where emtype='CIV' and emsex ='F' and emdateterm is null
    and emunit = '{?Bureau}' group by emrace
    But it did not work. Any help will be greatly appreciated.
    Thanks.

  • Catch BO Session info in Crystal Report 2008 to pass to Xcelsius 2008

    Hi All.
    I have an Xcelsius 2008 model with data provided by a Live Office connection.
    I've tried to embed this model, as swf file, in a report Crystal 2008.
    I've published this report within BOE Enterprise, but trying to visualize it, the Live Office connection prompts for BO authentication.
    Is there any way in Crystal Report 2008 to catch current BO session info to pass it to the Live Office connection?
    I would really appreciate any suggestion.
    Thanks a million.
    PS: I'm sorry if this is not the right forum. This thread is available also in Crystal Reports Design section.

    No, we haven't found a solution that we would like to have.
    We are putting in place a workaround to update the Xcelsius SWF file outside of Crystal.  We will have the Crystal Report using the BOBJ scheduler to export to Excel on a file share the cross tab table used in Xcelsius and then have Xcelsius updated using the BOBJ scheduler.  Instead of having the Xcelsuis embedded in Crystal, the SWF file will be posted to the same SharePoint site that we will be posting the PDF file from Crystal.  Not ideal, but it should work.

  • Crystal Reports 2008 - dynamic parameters not returing all data

    I am having the same issue with Crystal Reports 2008. Only returning 135 customers in a dynamic paramaters when the list should be 3288.
    When I re-create the parameter by using a command instead of relying on Crystal to return the data from the db table Crystal returns only 5"pages" of customers to select from.
    I have tried to run the report with this reduced selection & it then crashes.
    Any ideas??

    This article may help you to increase the number of values in the parameter
    KBase Article ID:c2017238
    Article refers to: Crystal Reports XI BusinessObjects Enterprise XI
    Symptom
    For performance reasons, in Crystal Reports XI Release 1 and Release 2 the maximum number of values that are returned for a list of values is set to 1000. If you have a cascading List of Values (for example Country > Region > City), the lowest level (in this case City) will only display a maximum of 1000 values. This means that the higher-level prompts may display far fewer values than you expect. The list of values provides the data for the dynamic parameter list.
    How can you modify the maximum number of values available in a dynamic parameter list?
    Resolution
    To increase the maximum number of values available in a dynamic parameter list, you must add a registry key.
    CAUTION     The following resolution involves editing the registry. Using the Registry Editor incorrectly can cause serious problems that may require you to reinstall the Microsoft Windows operating system. Use the Registry Editor at your own risk. For information on how to edit the registry key, view the 'Changing Keys and Values' online Help topic in the Registry Editor (Regedit.exe).
    It is strongly recommended that you make a backup copy of the registry files (System.dat and User.dat on Win9x computers) before you edit the registry.
    Crystal Reports XI Release 1
    1.     Create a registry key HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 11.0\Crystal Reports\DatabaseOptions\LOV.
    NOTE     Alternatively, you can create the registry key HKEY_CURRENT_USER\SOFTWARE\Business Objects\Suite 11.0\Crystal Reports\DatabaseOptions\LOV and that key will override the settings of the HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 11.0\Crystal Reports\DatabaseOptions\LOV key.
    2.     Add a string value "MaxRowsetRecords" and set the value to the maximum number of values that you desire for your report. For example, a value of 2000 will return up to 2000 values in the lowest level of a cascading parameter. NOTE: The value 0 (Unlimited) will not work with BusinessObjects Enterprise XI or Crystal Reports Server XI, you must specify another value.
    NOTE     The higher the number of values is, the longer it will take the Enter Values dialog box to populate with values.
    3.      After making changes to the registry, restart the affected service or application as required.
    Crystal Reports XI Release 2
    1.     Create a registry key HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 11.5\Crystal Reports\DatabaseOptions\LOV.
    NOTE     Alternatively, you can create the registry key HKEY_CURRENT_USER\SOFTWARE\Business Objects\Suite 11.5\Crystal Reports\DatabaseOptions\LOV and that key will override the settings of the HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 11.5\Crystal Reports\DatabaseOptions\LOV key.
    2.     Add a string value "MaxRowsetRecords" and set the value to the maximum number of values that you desire for your report. For example, a value of 2000 will return up to 2000 values in the lowest level of a cascading parameter. 
    NOTE     The value 0 (Unlimited) will not work with BusinessObjects Enterprise XI or Crystal Reports Server XI, you must specify another value.
    3.     After making changes to the registry, restart the affected service or application as required.
    Regards,
    Raghavendra

  • Database Logon Failed which created by Crystal Report 2008

    this time i meet the famous error again which is database logon failed.
    i created a crystal report 2008 starting from blank report, then connect with odbc
    i use 2008 method
    objRpt.SetDatabaseLogon(db_username, db_password, odbc_name, database_name);
    2008 method will get database logon failed even set database location and verify database again
    then i use 8.5 method and try again for 2008 report. it said field name is unknown for one of formula
    then i drag field again for formula and set database location and verify database again
    it said the same error.
    then i uninstall 8.5 crytal report software in window 7 deployment machine, and do above again, it said the same error
    //'Create a new Stored Procedure Table to replace the reports current table.
            CrystalDecisions.ReportAppServer.DataDefModel.Procedure boTable = new CrystalDecisions.ReportAppServer.DataDefModel.Procedure();
            //'boMainPropertyBag: These hold the attributes of the tables ConnectionInfo object
            PropertyBag boMainPropertyBag = new PropertyBag();
            //'boInnerPropertyBag: These hold the attributes for the QE_LogonProperties
            //'In the main property bag (boMainPropertyBag)
            PropertyBag boInnerPropertyBag = new PropertyBag();
            //'Set the attributes for the boInnerPropertyBag
            boInnerPropertyBag.Add("Connect Timeout", "15");
            //boInnerPropertyBag.Add("Data Source", "MyDataSource");
            boInnerPropertyBag.Add("Data Source", "10.1.1.191");
            boInnerPropertyBag.Add("DataTypeCompatibility", "0");
            boInnerPropertyBag.Add("General Timeout", "0");
            //boInnerPropertyBag.Add("Initial Catalog", "MyCatalog");
            boInnerPropertyBag.Add("Initial Catalog", database_name);
            boInnerPropertyBag.Add("Integrated Security", "False");
            boInnerPropertyBag.Add("Locale Identifier", "1033");
            boInnerPropertyBag.Add("MARS Connection", "0");
            //boInnerPropertyBag.Add("OLE DB Services", "-5");
            //boInnerPropertyBag.Add("ODBC", "-5");
            boInnerPropertyBag.Add("ODBC", "Cheque");
            boInnerPropertyBag.Add("Provider", "SQLNCLI");
            boInnerPropertyBag.Add("Tag with column collation when possible", "0");
            boInnerPropertyBag.Add("Trust Server Certificate", "0");
            boInnerPropertyBag.Add("Use Encryption for Data", "0");
            //'Set the attributes for the boMainPropertyBag
            boMainPropertyBag.Add("Database DLL", "crdb_ado.dll");
            //boMainPropertyBag.Add("Database DLL", "p2sodbc.dll");
            //boMainPropertyBag.Add("QE_DatabaseName", "VEPILOT");
            boMainPropertyBag.Add("QE_DatabaseName", database_name);
            //boMainPropertyBag.Add("QE_DatabaseType", "OLE DB (ADO)");
            boMainPropertyBag.Add("QE_DatabaseType", "ODBC");
            //'Add the QE_LogonProperties we set in the boInnerPropertyBag Object
            boMainPropertyBag.Add("QE_LogonProperties", boInnerPropertyBag);
            boMainPropertyBag.Add("QE_ServerDescription", "MyServer");
            boMainPropertyBag.Add("QE_SQLDB", "True");
            boMainPropertyBag.Add("SSO Enabled", "False");
            //'Create a new ConnectionInfo object
            CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo boConnectionInfo = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
            //'Pass the database properties to a connection info object
            boConnectionInfo.Attributes = boMainPropertyBag;
            //'Set the connection kind
            boConnectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;
            //'*EDIT* Set the User Name and Password if required.
            boConnectionInfo.UserName = db_username;
            boConnectionInfo.Password = db_password;
            //'Pass the connection information to the table
            boTable.ConnectionInfo = boConnectionInfo;
    CrystalDecisions.ReportAppServer.DataDefModel.Tables boTables = objRpt.ReportClientDocument.DatabaseController.Database.Tables;
                CrystalDecisions.CrystalReports.Engine.Tables tables = objRpt.Database.Tables;
                foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
                    if (!string.IsNullOrEmpty(table.Name))
                        //boTable.Name = table.Name;
                        //boTable.QualifiedName = database_name + ".dbo." + table.Name;
                        //boTable.Alias = table.Name;
                        boTable.Name = "sp_ChequeIssueDetRpt";
                        boTable.QualifiedName = database_name + ".dbo.sp_ChequeIssueDetRpt";
                        boTable.Alias = "sp_ChequeIssueDetRpt";
                        objRpt.ReportClientDocument.DatabaseController.SetTableLocation(boTables[0], boTable);
                objRpt.VerifyDatabase();
    http://sourceforge.net/projects/aspchequesprint/files/ChequeIssueDet.rpt/download

    No subreport, only a stored procedure with final two lines are
    print @m_sql
    exec (@m_sql)
    After use generated code in the link above
    Error at boReportDocument.VerifyDatabase();
    Inner Exception : no error
    Message "Logon failed"
    ErrorID : CrystalDecisions.CrystalReports.Engine.EngineExceptionErrorID.LogOnFailed
    HelpLink : null
    stacktrace :  CrystalDecisions.CrystalReports.Engine.ReportDocument.VerifyDatabase()\r\n   at viewReport.Page_Load(Object sender, EventArgs e) 於 d:
    Data
    My Documents
    Visual Studio 2008
    WebSites
    Cheques
    viewReport.aspx.cs: row 1302\r\n   at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)\r\n   at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)\r\n   at System.Web.UI.Control.OnLoad(EventArgs e)\r\n   at System.Web.UI.Control.LoadRecursive()\r\n   於 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    TargetSite : {Void VerifyDatabase()}
    string reportPath = report_path + "ChequeIssueDet.rpt";
                boReportDocument = new ReportDocument();
                //**EDIT** Change the path and report name to the report you want to change.
                boReportDocument.Load(reportPath, OpenReportMethod.OpenReportByTempCopy);
                //Create a new Stored Procedure Table to replace the reports current table.
                CrystalDecisions.ReportAppServer.DataDefModel.Procedure boTable =
                new CrystalDecisions.ReportAppServer.DataDefModel.Procedure();
                //boMainPropertyBag: These hold the attributes of the tables ConnectionInfo object
                PropertyBag boMainPropertyBag = new PropertyBag();
                //boInnerPropertyBag: These hold the attributes for the QE_LogonProperties
                //In the main property bag (boMainPropertyBag)
                PropertyBag boInnerPropertyBag = new PropertyBag();
                //Set the attributes for the boInnerPropertyBag
                boInnerPropertyBag.Add("Database", database_name);
                boInnerPropertyBag.Add("DSN", "Cheque");
                boInnerPropertyBag.Add("UseDSNProperties", "False");
                //Set the attributes for the boMainPropertyBag
                boMainPropertyBag.Add("Database DLL", "crdb_odbc.dll");
                boMainPropertyBag.Add("QE_DatabaseName", database_name);
                boMainPropertyBag.Add("QE_DatabaseType", "ODBC (RDO)");
                //Add the QE_LogonProperties we set in the boInnerPropertyBag Object
                boMainPropertyBag.Add("QE_LogonProperties", boInnerPropertyBag);
                boMainPropertyBag.Add("QE_ServerDescription", "Cheque");
                boMainPropertyBag.Add("QE_SQLDB", "True");
                boMainPropertyBag.Add("SSO Enabled", "False");
                //Create a new ConnectionInfo object
                CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo boConnectionInfo =
                new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
                //Pass the database properties to a connection info object
                boConnectionInfo.Attributes = boMainPropertyBag;
                //Set the connection kind
                boConnectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;
                //**EDIT** Set the User Name and Password if required.
                boConnectionInfo.UserName = db_username;
                boConnectionInfo.Password = db_password;
                //Pass the connection information to the table
                boTable.ConnectionInfo = boConnectionInfo;
                //Get the Database Tables Collection for your report
                CrystalDecisions.ReportAppServer.DataDefModel.Tables boTables;
                boTables = boReportDocument.ReportClientDocument.DatabaseController.Database.Tables;
                //For each table in the report:
                // - Set the Table Name properties.
                // - Set the table location in the report to use the new modified table
                boTable.Name = "sp_ChequeIssueDetRpt;1";
                boTable.QualifiedName = database_name+".dbo.sp_ChequeIssueDetRpt;1";
                boTable.Alias = "sp_ChequeIssueDetRpt;1";
                boReportDocument.ReportClientDocument.DatabaseController.SetTableLocation(boTables[0], boTable);
                //Verify the database after adding substituting the new table.
                //To ensure that the table updates properly when adding Command tables or Stored Procedures.
                boReportDocument.VerifyDatabase();
                //**EDIT** Set the value for the Stored Procedure parameters.
                string m_curUser = "";
                int spid = Convert.ToInt32(Request.Cookies["login_cookie"]["spid"]);
                queryString = "select * from v_All_Session where SPID=" + spid.ToString();
                //string _connectionString = ConfigurationManager.ConnectionStrings["ChequeConnectionString"].ConnectionString;
                using (SqlConnection connection = new SqlConnection(_connectionString))
                    SqlCommand command = connection.CreateCommand();
                    command.CommandText = queryString;
                    connection.Open();
                    using (SqlDataReader datareader = command.ExecuteReader())
                        if (datareader.HasRows == true)
                            while (datareader.Read())
                                if (datareader["UserID"] != System.DBNull.Value)
                                    m_curUser = datareader["UserID"].ToString();
                        datareader.Close();
                    connection.Close();
                boReportDocument.SetParameterValue("@UserID", m_curUser);
                if (string.IsNullOrEmpty(Session["fm_CoCode"].ToString()))
                    boReportDocument.SetParameterValue("@fm_CoCode", Session["fm_CoCode"].ToString());
                if (string.IsNullOrEmpty(Session["to_CoCode"].ToString()))
                    boReportDocument.SetParameterValue("@to_CoCode", Session["to_CoCode"].ToString());
                if (string.IsNullOrEmpty(Session["fm_BankACNo"].ToString()))
                    boReportDocument.SetParameterValue("@fm_BankACNo", Session["fm_BankACNo"].ToString());
                if (string.IsNullOrEmpty(Session["to_BankACNo"].ToString()))
                    boReportDocument.SetParameterValue("@to_BankACNo", Session["to_BankACNo"].ToString());
                if (string.IsNullOrEmpty(Session["fm_BatchNo"].ToString()))
                    boReportDocument.SetParameterValue("@fm_BatchNo", Session["fm_BatchNo"].ToString());
                if (string.IsNullOrEmpty(Session["to_BatchNo"].ToString()))
                    boReportDocument.SetParameterValue("@to_BatchNo", Session["to_BatchNo"].ToString());
    Edited by: Mathew_666 on Jul 19, 2011 4:27 AM
    Edited by: Mathew_666 on Jul 19, 2011 4:28 AM

  • Crystal Report 2008 / JavaScript hyperlink formula/ Issue

    Hi,
    We've developed the Crystal Report using the Crystal Reports 2008 software & integrated it in asp.net web page and also deployed in IIS web server. We have a requirement like opening the sub report in a new window. We have integrated the sub report also in a asp.net web page & passing the parameters in URL & acheived it..
    For the above, we have used JavaScript code like "javascript:window.open('SubReport.aspx','...','..' ...)" in the hyperlink formula field of main report. It works fine while running using VS 2005 in the development box.
    But in production serer (Windows 2003 server), the JS URL in the formula field is not working properly. Instead , it is rendered as a drill down JS url. Like javascript:bobj.event.publish('drilldown',........)
    Can you please help us to resolve this issue?
    (OR) Do we have any other approach to open the web page in new window from CR (same like a popup window)
    Thanks
    Jeyakumar
    Edited by: Jeyakumar Seenivasagam on Nov 21, 2008 12:02 PM

    I understand that the point of this is to allow the URL link to open the Subreport.aspx page in a new window. This can be problematic due to cross-site scripting restrictions. A few years ago we found that it was possible for report writers to add JavaScript to reports. This isn't a problem if the report writers are honest and nice. However, it is possible for JavaScript to be malicious so that ability to include JavaScript was turned off when the app uses our webform viewers. There may be a way to turn it off in the registry though. This is documented for CR XI r2 [here|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do].
    I am not sure if this reg key works for the .NET viewer, though the note specifies DHTML and .NET InfoView, so CR should work also. As you are using CR 2008, I suspect the key would be:
    HKLMSoftwareBusiness ObjectsSuite 12.0Crystal Reports
    You will most likely have to add the Export folder, then add the HTML folder, then add the EncodeHTMLForSingleLineFieldObjects and set it to "no".
    Please note that this is a hack / workaround found for CR XI r2. The functionality you are looking to exploit was removed for a reason. As such if the above does not work for CR 2008, it will not be considered to be a "bug" and we will not be able to send this to R&D for a resolution.
    Ludek

  • Fields in Stored Procedure does not appear in Crystal reports 2008.

    hi,
    I am now using crystal reports 2008 evaluation copy for 30 days. I am trying to create a stored procedure with parameter, here is my sample Stored Procedure code;
    DELIMITER $$
    DROP PROCEDURE IF EXISTS `puerto`.`SP_FindEmployees`$$
    CREATE DEFINER=`root`@`localhost` PROCEDURE `SP_FindEmployees`(SIDNo VARCHAR(10))
    BEGIN
         SELECT * FROM employees WHERE IDNo=SIDNo;
        END$$
    DELIMITER ;
    when i try to call the procedure in sqlyog here is my sample code;
    CALL sp_findemployees('0000000001')
    it is successfull, but when i try to  connect it with crystal reports 2008 I got no fields in my stored procedure andi got this error message ;
    "Database Connector: 'HY00:[MySQL][ODBC 3.51 Driver][mysqld-5.1.33-community]incorect number of arguments for procedure puerto.sp_findemployees; expected 1, got 0 [Database vendor code: 1318]"
    CR2008 was not asking a parameter values.
    But when I try using stored procedure that i've made in MSSQL, CR2008 asking parameters and succefully created the reports needed.
    My Objective is to make a stored procedure  in MySQL by using select statement and filter it with parameter(s) that I will pass and CR2008 will use this stored procedure.
    i also try the view with this code below and it was successfull in CR2008.
    DELIMITER $$
    DROP VIEW IF EXISTS `puerto`.`ep_employees`$$
    CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `ep_employees` AS (SELECT `employees`.`IDNo` AS `IDNo`,`employees`.`FullName` AS `FullName` FROM `employees`)$$
    DELIMITER ;

    hi,
    Crystal Reports 2008 and MySQL 5 , ODBC driver 3.5 and ODBC driver 5.1.
    I use ODBC connector 3.5 because I got errors in ODBC drivers in 5.1.
    Do you have step by step procedure for creating add command dialog box?
    I try creating the add command dialog box
    here's my sample sql statement i don't know if its correct because no data appearing in my crystal report
    Select * from employees where idno=@IDNo
    in Command Parameter Dialog Box
    Parameter Name = @IDNo
    Prompting Text = @IDNo
    Value Type = String
    DefaultValue = 0
    thanks!

  • Integrate Crystal Reports 2008 in Lotus Notes 8.x

    We allready use Crystal Reports 2008 with Lotus Notes 8.x trough NotesSQL 8.5. This works fine.
    Now we want integrate Crystal Reports 2008 directly in Lotus Notes 8.x. so that the user can start reports directly from his Lotus Notes Application. Of course, data has to be retrieved in realtime (not with data stored in the report) and he should be able to pass parameters from a lotus notes form.
    All informations we found are quit old (Crystal Reports 8.5 and Lotus Notes R5). Does anyone has an idea how to start and where to find new documentations? Is there maybe even a sample application availabl?
    Any help is welcome!

    Hello Alain, I have the same troubles. I have some databases with Crystal Reports 9. But no solution for Crystal Report 2008.
    Which dll's are needed?

  • Visual Studio 2008 using Crystal Reports 2008

    I'm trying to pass parameters to a Crystal Reports 2008 rpt file but keep getting a runtime message saying "Missing Parameter Values".
    Has anyone experienced this problem?
    Does anyone have a snippet of code where values are being passed from C#.Net to a crystal 2008 report.
    Thanks in advance....

    Hi Steven,
    You can select version and  download code samples from [here|https://boc.sdn.sap.com/codesamples]
    Here is code for parameters :
            string Reportpath = Server.MapPath("CrystalReport.rpt");
            ParameterFields boParameterFeilds = new ParameterFields();
            ParameterField boParameterFeild = new ParameterField();
            ParameterValues boParametervalues = new ParameterValues() ;
            ParameterDiscreteValue boParameterDiscreteValue = new ParameterDiscreteValue();
            ParameterRangeValue boParameterRangeValue = new ParameterRangeValue();
             CrystalReportViewer CR;
             CR =  new CrystalReportViewer();
             CR.ReportSource = CrystalReportViewer1.ReportSource;
             boParameterFeilds = CrystalReportViewer1.ParameterFieldInfo;
             boParameterFeild = boParameterFeilds["Country"];
             boParametervalues = boParameterFeild.CurrentValues;      
             boParameterDiscreteValue = new ParameterDiscreteValue();
             boParameterDiscreteValue.Value = "Canada";
             boParametervalues.Add(boParameterDiscreteValue);
            boParameterDiscreteValue.Value = "USA";
            boParametervalues.Add(boParameterDiscreteValue);
            boParameterFeild = boParameterFeilds["sales"];
            boParametervalues = boParameterFeild.CurrentValues;
            boParameterRangeValue.EndValue = "10000";      
            boParameterRangeValue.StartValue = "25000";
            boParametervalues.Add(boParameterRangeValue);     
            CrystalReportViewer1.ParameterFieldInfo = boParameterFeilds;        
    Hope this helps !!
    Regards,
    Shweta

Maybe you are looking for

  • Condition Type PBXX

    Hi, I created a PO in our production system. Following are the condition types which gets picked based on the process 1. When i create a material and a inforecord in the PO the condition type which is used in J3AP 2. When i create a material and not

  • How to listen to internet radio using iTunes

    Before I upgraded I used to be able to go to a list of radio stations all over the country to listen to local news but cannot do so anymore. How do I find such using the new version of  iTunes

  • Oracle.jbo.TooManyObjectsException but validated unique keys?

    11gR1 ADF I have some code similar to the code that copies the transient cart to the persistent card from the FOD, and I've receiving the TooManyObjectsException error even though I've validated that the key is unique.             for(Row tItemRow :

  • Character Set Syntax In Creating A New Database

    What is the correct line of syntax for this block of code in order to make the default character set WE8ISO8859P1? I tried the following but the database will not accept the Swedish or French characters. create database DEL1 controlfile reuse logfile

  • How to get the return value of a method

    hi there here is the code i write a method public void time(int x,int y){ int xx; int yy; xx++; yy++; x=xx; y=yy; i want to use the return value of x and y at another place,who can tell if it is possible. thank u very much