Passing parameters to external Crystal 2008 report

I have to invoke the viewer.reportsource twice in order for the parmeters to a Crystal Report to take effect.
Here is my environment:
CR 2008
VS 2005
VB
SQL Server 2008
External Crystal Report
I am using the Report Document Object.  Here is the code I am using
' The following is a Class used to configure a Crystal report Document
'    Structure struRptParms '
        ' This structure will be used to hold Crystal Reports Parameter Keys and Parmeter Values
        Public strRptParmKey As String
        Public aryRptParmValues As ArrayList
    End Structure
    ' aryRptParms is an ArrayList property of this class that contains the ParmKeysAndValues for the report
        ' Step 1 - Instantiate a Crystal report document for the Report and then
        '           load the report into the report document
        '   a) instantiate the ReportDocument class.      
        docCrystalReportDocument = New ReportDocument
        '   b) Load the report by a Call to the Load() method of the ReportDocument instance
        '       and pass it the reportPath string variable.
        docCrystalReportDocument.Load(strRptPathAndName)
        ' Step 2 - Create the links to the Data Source for the Report
        '   a)instantiate the ConnectionInfo class
        Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()
        '   b) set the ServerName property of the ConnectionInfo instance.
        myConnectionInfo.ServerName = strRptDataSource.ToString
        '   c) Set the DatabaseName and IntegratedSecurity properties of the ConnectionInfo instance.
        myConnectionInfo.DatabaseName = strRptDataBase.ToString
        myConnectionInfo.IntegratedSecurity = True
        ' Step 3) Connect the report to the datasource by entering a call to the
        '           SetDBLogonForReport() method, by passing in the ConnectionInfo instance and the Crystal report.
        SetDBLogonAndDataSourceForReport(myConnectionInfo, docCrystalReportDocument)
        ' Step 3a) Connect subreports to the datasource by entering a call to the
        '           SetDBLogonForReport() method, by passing in the ConnectionInfo instance and the Crystal report.
        Dim mySubReportDocument As ReportDocument
        For Each mySubReportDocument In docCrystalReportDocument.Subreports
            SetDBLogonAndDataSourceForReport(myConnectionInfo, mySubReportDocument)
        Next
        ' Step 4) Pass the parameter keys and parameter values to the report by calling
        '           the SetParameterValue() method from the Report Document class. Do this for
        '           each instance of parameter keys and values passed in via aryRptParms property
        Dim struMyRptParms As New struRptParms
        For Each struMyRptParms In aryRptParms
            docCrystalReportDocument.SetParameterValue(struMyRptParms.strRptParmKey.ToString, struMyRptParms.aryRptParmValues.ToArray())
        Next
        ' Step 5) Connect the Crystal Report to the report viewer by binding the ReportSource property of the
        '       CrystalReportViewer to the ReportDocument instance
        Me.vwrCrystalReport.ReportSource = docCrystalReportDocument
        Me.vwrCrystalReport.ReportSource = docCrystalReportDocument

Jonathon,
Thank you for reading my post and taking the time to reply. 
The report design does not have Save Data turned on.
I moved the parameter passing before logging on to the data base - that did not fix the problem.
Thank you again for taking the time.

Similar Messages

  • Save Crystal 2008 report as XI -- or can you run 2008 report in XI?

    Hi,
    Is it possible to save a report created in Crystal 2008 report as an XI verion? 
    If not, is it possible to run a report created in Crystal 2008 report in XI and Crystal Report Server XI if none of the new features in 2008 are used?
    I want to purchase an additional copy of the application, and am trying to decide which version I can use when the bulk of the reports are run on CRS XI...
    - JD

    Good feedback, I've a couple of  things I'm still curious about...
    1. Does the warning pop up every time you open the report created in 2008 in XI? 
    2. Including on the XI REPORT SERVER rather than the desktop client?
    I ask as I'm concerned that if I create reports and upload them to the XI server it'll cause no end of user annoyance if they have to click through a warning message every time the want to run/load the report.

  • How to pass parameters from a dashboard or report to any OA Framework-based

    In Metalink Note:276708.1, about Oracle E-Business Intelligence Minipack L (4.0.9).
    Common Features for Dashboards and Reports section say:
    You can now pass parameters from a dashboard or report to any OA Framework-based application page.
    How to do pass?
    Regards,
    Arone

    Nobody help me?

  • Passing Parameters to Procedure based sub report thru JRC

    Hi
    I am using storedprocedure based main report with a subreport and i am trying to invoke these reports with JRC.
    I am passing parameters to main report then it is asking parameters for subreport then i placed following statement by placing subreport name
    param2.setReportName("detailed_aging_report_wk.rpt");
    but after using this statement it is prompting for main report parameters.
    How i can pass the same parameter values to both main and sub reports?
    Thankyou.

    Here is a snippet code that demonstrates how to pass a parameter to a subreport, you can accommodate it and test it and see if you still have the same behaviour. What you need to do is to add the code to set the parameter of the main report.
    <%
    /* Applies to: XI
    * Date Created: April 4, 2005
    * Description:     This sample demonstrates how to pass parameters to a report that
    *                    contains a subreport using the Crystal Reports Java
    *                    Reporting Component (JRC) SDK.        
    * Author: HP, CW
    try {
         //check to see if the report source already exists
         Object reportSource = session.getAttribute("reportSource");
         //if the report source has not been opened
         if (reportSource == null)
              //---------- Create a ReportClientDocument -------------
              ReportClientDocument oReportClientDocument = new ReportClientDocument();
              //---------- Set the path to the location of the report soruce -------------
              //Open report.
              oReportClientDocument.open("jrc_set_subreport_parameters/jrc_set_subreport_parameters.rpt", 0);
              //Get the report source
              reportSource = oReportClientDocument.getReportSource();
              //Cache report source. 
              //This will be used by the viewer to display the desired report.
              session.setAttribute("reportSource", reportSource);
         //---------- Create the Parameter Field Objects -------------
        //Create a Fields collection object to store the parameter fields in.
        Fields oFields = new Fields();
        //----------- Initialize the parameter fields ----------
        //Set the name and value for each parameter field that is added.
        //Values for parameter fields are represented by a ParameterFieldDiscreteValue
        //or ParameterFieldRangeValue object.
        //NOTE: Be sure to map the names of the parameters and their
        //respective types against the correct type that the parameter
        //field values was defined to accept in Crystal Reports.
        //NUMBER VALUE PARAMETER. 
        Integer numberValue = new Integer("55");
        //STRING VALUE PARAMETER.
        String stringValue = "String parameter value.";
        //BOOLEAN VALUE PARAMETER.
        Boolean booleanValue = new Boolean("true");
        //DATE VALUE PARAMETER.
        Calendar calendar = Calendar.getInstance();
        calendar.set(2004, 1, 17);
        Date dateParamVal = calendar.getTime();
        //DATE-TIME VALUE PARAMETER.
        Calendar calendar2 = Calendar.getInstance();
        calendar2.set(2002, 5, 12, 8, 23, 15);
        Date dateTimeParamVal = calendar2.getTime();
        //CURRENCY VALUE PARAMETER.
        Double currParamVal = new Double(555.99);
        //TIME VALUE PARAMETER.
        Calendar calendar3 = Calendar.getInstance();
        calendar3.set(2002, 5, 12, 13, 44, 59);
        Date timeParamVal = calendar3.getTime();
        //Set all of the parameter values using the utility function.
         //Since we are passing parameters to the subreport, it is here that we set the
         //subreport name; if you are not passing a parameters to a subreport, the
         //report name will be an empty string
         setDiscreteParameterValue(oFields, "NumberParam", "SubreportA", numberValue);
        setDiscreteParameterValue(oFields, "StringParam", "SubreportA", stringValue);
        setDiscreteParameterValue(oFields, "BooleanParam", "SubreportA", booleanValue);
        setDiscreteParameterValue(oFields, "DateParam", "SubreportA", dateParamVal);
        setDiscreteParameterValue(oFields, "DateTimeParam", "SubreportA", dateTimeParamVal);
        setDiscreteParameterValue(oFields, "CurrencyParam", "SubreportA", currParamVal);
        setDiscreteParameterValue(oFields, "TimeParam", "SubreportA", timeParamVal);
        //Push Fields collection into session so it can be retrieved by the viewer and set
        //at view time.
        session.setAttribute("parameterFields", oFields); 
         //Redirect to the viewer page to render the report
         response.sendRedirect("CrystalReportViewer.jsp");
    catch(ReportSDKException sdkEx) {
         out.println(sdkEx);
    %>
    <%!
    * Utility function to set values for the discrete parameters in the report.  The report parameter value is set
    * and added to the Fields collection, which can then be passed to the viewer so that the user is not prompted
    * for parameter values. 
    private void setDiscreteParameterValue(Fields oFields, String paramName, String reportName, Object value) {
         //Create a ParameterField object for each field that you wish to set. 
        ParameterField oParameterField = new ParameterField();
        //You must set the report name.
        //Set the report name to an empty string if your report does not contain a
        //subreport; otherwise, the report name will be the name of the subreport
        oParameterField.setReportName(reportName);
        //Create a Values object and a ParameterFieldDiscreteValue object for each
        //object for each parameter field you wish to set.
        //If a ranged value is being set, a ParameterFieldRangeValue object should
        //be used instead of the discrete value object.
        Values oValues = new Values();
        ParameterFieldDiscreteValue oParameterFieldDiscreteValue = new ParameterFieldDiscreteValue();
        //Set the name of the parameter.  This must match the name of the parameter as defined in the
        //report.
        oParameterField.setName(paramName);
        oParameterFieldDiscreteValue.setValue(value);
        //Add the parameter field values to the Values collection object.
        oValues.add(oParameterFieldDiscreteValue);
        //Set the current Values collection for each parameter field.
        oParameterField.setCurrentValues(oValues);
        //Add parameter field to the Fields collection.  This object is then passed to the
        //viewer as the collection of parameter fields values set.
        oFields.add(oParameterField);
    %>
    Cheers

  • Passing Parameters in a URL to Reports - Need Help Urgently !

    I have created Image Maps (content area) where I pass parameters in the URL as follows :
    <area shape="rect" coords="335,66,528,83" href="http://townland:7778/pls/portal30/PORTAL30.RPT_SUMKWH.show_parms?meter=PMS 11BBA01">
    <area shape="rect" coords="400,55,600,90" href="http://townland:7778/pls/portal30/PORTAL30.RPT_SUMKWH.show_parms?meter=PMS 11BBA02">
    I am having a problem passing this meter parameter to the report [I am generating this report (RPT_SUMKWH) using SQL Query] :
    I have tried the following :
    1) I tried referencing this parameter in the 'Additional PL/SQL code, before displaying page' section of my Report as :- wwpro_api_parameters.get_value('meter', 'RPT_SUMKWH')
    but this did not work (this made the package body invalid).
    2) I then tried using the meter parameter as a bind variable in my SELECT Query of the Report, then, in the 'Customisation Form' section, I place :- wwpro_api_parameters.get_value('meter', 'RPT_SUMKWH') under Default Value, however, when I go back to my Image Map content area & ty to click on the URL, I get an error "Page does not display" .
    How do I then pass this parameter to my report, where do I place the code to make the call for the parameter being passed from the Image Map URL in the content area??
    AVD

    Hi,
    You will have to encode your parameter value. The problem is because of the spaces in the value. Whenever there any special
    characters in the value it should be encoded.
    example
    select '<area shape="rect" coords="335,66,528,83" href="http://townland:7778/pls/portal30/PORTAL30.RPT_SUMKWH.show_parms?meter='||
    <portal_schema>.wwutl_htf.url_encode('PMS 11BBA01')||'">pams</a>' url
    from meters
    The above is just an example. Please change the names to suit your requirements.
    Thanks,
    Sharmila

  • Are Crystal 2008 reports compatible with runtime version XI

    Hi,
    Our software incorporates Crystal runtime version XI.  We advise clients to purchase Crystal XI if they wish to modify our report templates.
    A number of clients have complained that Crystal XI is no longer available to buy.
    My query is that if we recommend Crystal 2008 and the clients modify their templates (basic reformatting edits), will these revised templates work in our application?
    Thanks.

    Dave,
    I was wondering if you could arrive at some conclusion regarding making an application (that works in Crystal XI) work with Crystal 2008. The product I am working on, works fine with Crystal XI. But now for cleints that have Crystal 2008, I was wondering what would be the best bet to make that application compatiable? Certainly we do not want to have two seperate application coded separatly for Crystal XI and Crystal 2008.
    I will appreciate any information you can share on this.
    Thanks - Prashant

  • Passing Parameters to anf from Sub-Reports

    I have a report with two subreports in it, and I want to be able to tell the main report about the data in the sub-report so I can supress a detail section if the sub-report contains certain data.  How do I pass a parameter from the sub-report to the main report?

    Passing a variable from subreport to main report and vice versa
    Declare a variable as shared in the subreport.
    Shared numberVar NoOfrecords;
    Assign some value to this variable,
    Shared numberVar NoOfrecords :=Count()
    Then in the main report, create a formula and in that formula again declare the vairable and use it as u like
    //Declaration
    Shared numberVar NoOfrecords;
    //If you want to supress a section based on this count,then
    if NoOfrecords = 0 then TRUE
    click ok..
    NOTE:
    For the shared variable to return the correct value in the main report, you must place @MainFormula in a main report section that is beneath the section containing the subreport. This ensures Crystal Reports evaluates the @SubFormula before @MainFormula.
    Very Important : Dont just create the formula, u have to place this forula somewhere as mentioned above. If u dont want to show this formula value,then hide it by changing its colour to white or by some other way. If u dont place the formula in the report,it wont work.
    and same thing applies when passing values from main report to subreport.
    In this case define the @MainFormula first and then @SubFormula.
    I have used this successfully in my report.

  • Passing  parameters from  BSP to BW report

    How to pass parameters from a BSP application to BW in order to execute the BW report

    In BW template
    a different URL is generated for selection made in each input field.
    I have 4 different URL's now.
    and when I push the Execute button a URL is generated which looks incomplete and it does not show all the parameters(  lot of things are happeninng inside like authorizatins, session handling etc).
    The URLS are shown below
    URL genarated when the query is executed in the browser:
    http://coles33.co.lsil.com:1080/SAP/BW/BEX?variable_screen=X&template_id=0QUERY_TEMPLATE&INFOCUBE=ZAMOEMP1&QUERY=ZAIMREP1
    After selecting Location:
    http://coles33.co.lsil.com:1080/SAP/BW/BEX?SAP-LANGUAGE=E&PAGENO=1&CMD_ID=1&REQUEST_NO=0&VAR_VALUE_EXT_2=CA01&F4CMD=FINISHED
    After selecting org:
    http://coles33.co.lsil.com:1080/SAP/BW/BEX?SAP-LANGUAGE=E&PAGENO=1&CMD=PROCESS_VARIABLES&INDEX=3&VAR_VALUE_HELP_SET_LINE=3&REQUEST_NO=0&VAR_VALUE_HELP_SET_5=5
    After pushing Insert:
    http://coles33.co.lsil.com:1080/SAP/BW/BEX?SAP-LANGUAGE=E&PAGENO=1&CMD=PROCESS_VARIABLES&REQUEST_NO=0&CMD=PROCESS_VARIABLES&SUBCMD=VAR_NEW_LINES&VARID=WNTEST1%200001
    After making second selection for org:
    http://coles33.co.lsil.com:1080/SAP/BW/BEX?SAP-LANGUAGE=E&PAGENO=1&CMD=PROCESS_VARIABLES&INDEX=4&VAR_VALUE_HELP_SET_LINE=4&REQUEST_NO=0&VAR_VALUE_HELP_SET_15=15
    After selecting FLSA:
    http://coles33.co.lsil.com:1080/SAP/BW/BEX?SAP-LANGUAGE=E&PAGENO=1&CMD_ID=2&REQUEST_NO=0&VAR_VALUE_EXT_5=EX&F4CMD=FINISHED
    after selecting date:
    NO URL GENERATED
    After pushing Execute:
    http://coles33.co.lsil.com:1080/SAP/BW/BEX?SAP-LANGUAGE=E&PAGENO=1&CMD=PROCESS_VARIABLES&REQUEST_NO=0&CMD=PROCESS_VARIABLES&SUBCMD=VAR_SUBMIT&VARID=
    I am not able to understand how to call this url from BSP page.( I also have multi-selection for location and org)
    regards
    Aditya

  • Passing parameters dynamically to crystal report from oracle

    Hi,
    I have a Crystal Report that is based on an Oracle Stored Procedure. This was created using Crystal Reports XI R2 and it is published on a Infoview environment.
    There are 2 parameteres in  an Oracle Stored Procedure, of which one parameter is Region which contains values like AP,GJ,HP,MP,TN. The report run daily at scheduled time in infoview and the output of the report for each region is passed and stored in that particular region folder for easy access to enduser. The other parameter is a refcursor.
    Now my issue is i want to add new region value like KA. As i am new to crystal reports i am unable to understand how to do this also if possible can any one send me liknk which explains the procedure how to run a report that is based on an Oracle Stored Procedure.
    Thanks in advance.

    Hello,
    Typically when you create the report this way the Store Procedure will query the table for values and present those in a drop down list in the report Prompts when viewing. Or if it's not interactive then simply typing in 'KA" into the parameter UI should/could return data.
    So it all depends on how you have this configured and how it was set up in the CMC when the report was scheduled. The BOE Administrator may have manually added the filter for each state or it's part of the report itself and other than updating the table field values is all that is required.
    So it's not clear what role you play in the Admin group of BOE but it appears to be fairly simple to do. If you are not the Administrator find out who is and that person can explain it to you also.
    I'll move this post to the Business Objects Enterprise Forum for someone there to give you specific details.
    Thank you
    Don

  • Passing parameters to a Crystal Reports JavaBean connection

    Hi,
    I'm trying to pass a parameter to a CR XI JavaBean connection. So far I can read and show a String parameter in the report, but I'm unable to pass it to the getResultSet(String aParameter) method that provides the ResultSet.
    The Crystal Reports editor shows a dialog box asking for the "Parameter 1". I've tried with the parameter name and with an arbitrary value, but it just doesn't work.
    Any comment from anyone who has been able to figure this out would be really welcome. The Crystal Reports documentation isn't very useful.
    Best regards,
    - Juan

    I'm about to throw Crystal Reports thru the window. There is no documentation, their knowledge base is a wasteland, the samples included are just the simplest ones, it seems there is nobody from their company colaborating in their forums This company is incredible.
    As far as I can tell, you need to set the parameters for the ResultSet method as if it was a stored procedure, but I found no useful documentation about this for Java / JSP pages.
    So far, my JavaBean method is:
         public ResultSet getResultSet(String minAge, maxAge) throws SQLException {
            // I don't use the parameters yet. I just want to execute this ResultSet
             try {
                  return getConnection()
                       .createStatement()
                       .executeQuery("SELECT * FROM notes");
             } catch (Exception e) {
                 e.printStackTrace();
                 _log.error(e);
                 return null;
         }An the parameters code is:
        public Fields getParameters() {
            if (_parametros == null) {
                 ParameterFieldDiscreteValue val1 = new ParameterFieldDiscreteValue();
                 val1.setValue("100");
                 ParameterFieldDiscreteValue val2 = new ParameterFieldDiscreteValue();
                 val2.setValue("200");
                   Values vals1 = new Values();
                   vals1.add(val1);
                   Values vals2 = new Values();
                   vals2.add(val2);
                   ParameterField field1 = new ParameterField();
                   field1.setName("minAge");
                   field1.setReportName("");
                   field1.setCurrentValues(vals1);
                   ParameterField field2 = new ParameterField();
                   field2.setName("maxAge");
                   field2.setReportName("");
                   field2.setCurrentValues(vals2);
                   Fields fields = new Fields();
                   fields.add(field1);
                   fields.add(field2);
                   _parameters = fields;
            return _parameters;
        }Any comment of any kind about this would be really welcome.
    Regards,
    - Juan

  • Pass  parameters VS2005 to Crystal XI

    Hi
    I would like to pass a parameter (the same) from VS2005 to CR report and subreport and use it in a sql query (mysql). How to do it?

    Hi Tomas,
    You are using unsupported environment.
    Crystal report XI is not supported with VS 2005.
    I would suggest you to first upgrade Crystal Reports From XI to XIR2.
    You can download CR XI R2 SP2 from here:
    [https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/bobj_download/main.htm]
    Updation process is [here|Integrating crystal report into the visual studio standard edition IDE;
    Regards,
    Shweta

  • Passing parameters with spaces in Oracle reports

    I hav a system that passes a query string to a servlet and generates an Oracle Report. All of the varibles worked Ok as long as they don't have spaces in them. Whenever a parameter with spaces is encountered,it generates an error. i tried to enclose it in single or double quotes but it didn't work. I also tried to insert the Url Encode for spaces which is %20 but it also generated an error. pls help me on this one...

    I suppose you're working with GET instead of POST. Try to use the POST method; this gives you the possibility to work with a URL without parameters behind the question mark. This might be the solution to your problem.

  • Crystal 2008 - Report Index Bursting, what is this?

    The help in CR defines it as this, but could someone please elaborate.
    "The Saved Data Indexes dialog box appears when you select the Report Bursting Indexes command from the Report menu.
    Use this dialog box to select the fields you want indexed within your report's saved data. You can increase the performance of a Crystal report by indexing its saved data. Indexes you specify are created when you refresh the report's data."
    We have some reports that are timing out, will this help?

    Hello,
    It may help but with reports with saved data only. What it does is some DB's and tables are not indexed for optimum reporting and if those tables are used as the report data source CR has to do the indexing which can affect performance. What the function does is build a saved data field index so when previewed the report can render the reports pages quicker.
    For your issue though I doubt this will help as it would appear your problem is CR is waiting for your data to come from the database.
    Some Options would be for you to add indexing to your DB or possibly using a Stored Procedure or something server side to speed up the data collection process and do most of the filtering server side rather than client side.
    No info about your data source to go on so not sure what the issue may be.
    Thank you
    Don

  • GoLinks and passing parameters to external sites

    I am trying to have a goImageLink (or goLink or goButton) that takes the user to another site. The destination url is expecting parameters.
    Example: http://www.abc.com?param1=xyz&param2=wxy
    I've seen a few examples of something similar to this, and I am just wondering why there isn't any other way to do it? Am I required to manually build the URL in a managed/backing bean?

    JRolls,
    there is not mandatory to use a managed bean, you can use the EL to build parameter but you must have the values!
    where are the values for the parameter??
    <af:goLink destination="http://www.abc.com?param1=#{EL...}&param2=#{EL...}"/>
    use EL to refer to managed bean or a value from bindings already available in your page.
    I hope to get your mean correctly.

  • How to pass parameters from Forms to Reports

    dear all,
    i'm running a report from a form using run_product(), now i want
    to pass a parameter from a form to report, say i want to display
    all the employees of deptno=10, so what parameter should i give
    in run_product() and what modifications should i make in the
    report???
    thanks and regards
    Tariq.

    Yeah,
    You can pass parameters to from form to report using
    Parameter list. E.g. You want to display all employees of Dept
    10.
    1. Create report with one user paramter say p_dept
    2. Now Using Parameter list and Run Product you can call report,
    see following procedure.
    /* This Procedure passes department number as a paramter to
    Report and displays Report.
    Author - Mr. Adinath R. Kamode
    Parameter - Deptname (p_dept)
    PROCEDURE CALL_REPORT (V_DEPT IN NUMBER)
              V_PLIST          PARAMLIST;               -
    - Parameter List and Name
              V_PLISTNAME           VARCHAR2
    (30) := 'RPTLIST';
    BEGIN
    -- Check existance of Parameter List
              V_PLIST := GET_PARAMETER_LIST(V_PLISTNAME);
              IF ID_NULL (V_PLIST) THEN
                   V_PLIST := CREATE_PARAMETER_LIST
    (V_PLISTNAME);
                   IF ID_NULL (V_PLIST) THEN
                             MESSAGE('Error in
    creating parameter list.');
                             MESSAGE('.');
                             RAISE
    FORM_TRIGGER_FAILURE;
                   END IF;
    -- Add parameter data , name must be same as in Report
         ADD_PARAMETER(V_PLIST,'P_DEPT',TEXT_PARAMETER,TO_CHAR
    (V_DEPT));     
    -- Don't display parameter Form
         ADD_PARAMETER(V_PLIST,'PARAMFORM',TEXT_PARAMETER,'NO');
    RUN_PRODUCT
    (REPORTS,'DEPT.RDF',ASYNCHRONOUS,RUNTIME,FILESYSTEM,V_PLIST,NULL)
    ELSE
              DESTROY_PARAMETER_LIST(V_PLIST);
    END IF;
    END;
    Adi

Maybe you are looking for