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

Similar Messages

  • 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

  • Multi pass bursting of a Crystal report on business view with a bex query

    In BO CMC, we have a group with a list of user.
    The idea is to burst (via the multi pass bursting method) a Crystal report for this list of user with the constraint that this report should only contains data of the store linked to the user.
    Our data comes from a SAP BI cube.
    The link between a Store and a User comes from an other system.
    We have build a bex query and use it as a data source of a Crystal Data Foundation.
    In this Data Foundation we have an other table storing the user ID and the Store ID.
    These 2 tables are linked in this Data Foundation on the Store ID.
    Business element and Business View have also been created on top of this Data Foundation.
    We have impletemented a filter in this Data Foundation to filter out data on the user id. This user id will be filled when bursting the report for all requested users thanks to this function :.
    As a user is linked to one store, the data foundation will filter the data coming from the bex query and show only the data of the user's store.
    We have build a crystal report using the business view created above as data source. We have made some test on a small amount of data and it works, data are correctly filter out and the reports shows only the data from one store.
    But the problem is that we have a lot of stores (more than 600) and doing this way implies that the bex query will always return the data for all the stores as the filter will occurs in the data foundation and not on the bex query.
    We need to find a way to make the bex query returning only the data of the store linked to the user for which we burst the report.
    As we have more than 600 stores this was an idea to avoid managing more than 600 under BO groups or more than 600 different filters.
    This solution do not work when the bex query result set is too large.
    Does anyone has an idea on how to implement such "dynamic" filter in the bex query? The parameter is the user ID but the filter to be applied on the bex query is on the store ID.
    We are under BO XI release 2, Crystal XI Release 2 and we have installed the BO release 2 integration kit for SAP

    Hi,
    what about setting up the data level security in BW ?
    Ingo

  • How to create a Crystal Report to connect to Oracle

    Hi,
    When I create a Crystal report to connect to SQL Server, I create a stored procedure to get all data I need and connect to it from Crystal Report.(In the stored procedure, I created temp tables, used cusor etc to run data.) But now I need to use a Oracle database. I heard I need to create a package and put this stored procedure in this package. Questions:
    1. if I need to create a package, how can I call the stored procedure from it?
    2. Can I create temp table in this procedure too? I need to create some temp tables to join together to get complex data.
    3. if I want the return data from stored procedure, do I still "select ... from ..." or there is another other ways?
    I am so desperated. Please help. I know this are very silly questions. But please.

    Hi Jenny,
    We are also using Crystal Reports for our Oracle Database, we normally just select the tables we want to use or create our own SQL query.
    However, if you really want to use Oracle stored-procedure (which performs faster than a SQL query because the stored procedure is compiled in advance), you can look at this document:
    http://support.businessobjects.com/communityCS/TechnicalPapers/scr_oracle_stored_procedures.pdf
    Hope this will answer your questions.

  • Passing parameters to a BW Report iView dynamically

    Hi All,
    I want to pass parameters to a BW Report iView at runtime. The requirement is as such:
    I have got some screen selection in a webDynpro iView and I need to pass all those selected values to a BW Report iView based on the user selection. eg. start date and end date selection.
    This is on priority please help me as soon as possible.
    Thanks in advance,
    Murtuza

    Hi Rajat,
    I will try to describe my requirement once again. The iview A is the webDynpro iview and iview B is the BW Report iview. Now I want to make some selections in dropdown ,calendars and input fields in ivew A and then make a call to the iview B with all those parameters so that iview B can fire a query based upon the parameters.
    ie. if I selected say startdate as today's date then this should be passed as a parameter to the BW Report iview and i need to set the application parameter for the BW Report ivew. Hope the reuirement is clear now. Please help me.
    Thanks,
    Murtuza

  • Passing 'ALL' value into Two Parameters in SAP Crystal Reports

    Hi,
    I have one report made it from sql command in that there is 2 parameters one is C_Type and other is C_Type_HV both shows the records like 01,02,03,05 both the parameters are used in command where clause and also that report contain one sub report for showing summary made it from sql command in that command both the parameters are passing through where clause of command now i want to add 'ALL' as a value in both the parameters how i can do this in sap crystal report.
    for referance I give u both the query of report
    With Regards,
    Ganesh

    Hi Ganesh,
    Please have a look at this thread on how to add 'ALL' as a value for the prompt.
    All values in parameter
    -Abhilash

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

  • Crystal report subreport connect DB Problem

    I have rpt file was set the connect DB(AAAA). This file have two reproject (main report and subreport)
    The subreport parameter is linked to main report.
    These two report will get the data from DB by the parameter.
    Server Name:AAAA, Database Name: AAAA, UserID: AAAA, Password:AAAA
    for testing and save it.
    I am trying to build a MFC project with crystal report 13
    My project call this rpt file and pass a parameter to main
    The crystal report main report and subreport can get correct infomation where connect to the DB(AAAA)
    but when I connect to the other DB.
    My project only the crystal report main report can get the correct infomation, the subreport cannot get correct infomation.
    it show a diolog to ask me "enter the parameter".After passing a corrent parameter, the result also not corrent.
    The program code:
    CrystalDecisions::Windows::Forms::CrystalReportViewer^  crystalReportViewer1;
    ReportDocument boReportDocument = gcnew ReportDocument();
    boReportDocument->Load(strFilePath);
    String^ strUser = gcnew String (ReportPara->strUser);
    String^ strPassword = gcnew String (ReportPara->strPassword);
    String^ strServer = gcnew String (ReportPara->strServer);
    String^ strDatabase = gcnew String (ReportPara->strDatabase);
    boReportDocument->DataSourceConnections[0]->SetConnection(strServer,strDatabase,strUser,strPassword);
    ParameterValues^ pv = gcnew ParameterValues();
    ParameterDiscreteValue^ pdv = gcnew ParameterDiscreteValue();
    pdv->Value =ReportPara->varDate;
    pv->Add(pdv);
    boReportDocument->DataDefinition->ParameterFields[0]->ApplyCurrentValues(pv);
    crystalReportViewer1->ReportSource = boReportDocument;
    I have try to change the subreport DataSourceConnections:
    for (int j; j <boReportDocument->DataSourceConnections->Count;j++)
          boReportDocument->Subreports[0]->DataSourceConnections[j]->SetConnection(strServer,strDatabase,strUser,strPassword);
    but the result is also not corrent
    I have try to pass parameter to the subreport:
    pv->Add(pdv);
    boReportDocument->DataDefinition->ParameterFields[1]->ApplyCurrentValues(pv);
    for (int i; i <boReportDocument->DataDefinition->ParameterFields->Count;i++)
         pdv->Value =ReportPara->varDate;
         pv->Add(pdv)
         boReportDocument->Subreports[0]->DataDefinition->ParameterFields[0]->ApplyCurrentValues(pv);
    but the result is also not corrent
    I have try to set the ReportViewer LogOnInfo
    TableLogOnInfo^ loi;
    loi = boReportDocument->Database->Tables[0]->LogOnInfo;
    oTblLogOnInfos->Add(loi);
    for (int j=0; j<boReportDocument->Subreports[0]->Database->Tables->Count;j++)
          loi = boReportDocument->Subreports[0]->Database->Tables[j]->LogOnInfo;
          oTblLogOnInfos->Add(loi);
    crystalReportViewer1->LogOnInfo = oTblLogOnInfos;
    but the result is also not corrent

    Hi Edwin,
    I assume you are using the runtime for Cr for Visual Studio which is available from the download page correct?
    You don't want to use the .Add method, this actually adds a NEW parameter, you simply want to modify the current parameter value.
    Sorry I don't have and C++ samples.
    Don

  • Using Crystal Report Data Connection in Xcelcius 2008

    The documentation does not explain how data to populate row, column and details is passed to SWF.
    Can some-one please point how CR Data Connection when created in Xcelcius 2008 is used in Crystal Report Design time ? Is it through Flash variables? Basically more details are needed for "when setup properly" clause. How to map Crystal Reports Fields to Xcelcius Definitions.
    Thanks
    Harish Tejwani
    From Doc:
    "With the release of Crystal Reports 2008, it is now possible to embed an Xcelsius-generated SWF file into a Crystal Report and have the SWF consume data from that report. When set up properly, refreshing the data in your Crystal Report will update the embedded SWF.
    To configure your Xcelsius SWF to consume data from its Crystal Rport source data, you must open the Data Manager in Xcelsius and add a new Crystal Report Data Consumer connection. After adding the connection, bind the following ranges to your spreadsheet:  Row Headers, Column Headers, Data"
    "Using Crystal Reports 2008, embed the SWF file into the Crystal Report source data file. When designing your Crystal Report, you will determine what fields/data populate the Row Headers, Comumn Headers, and Data ranges that were designated in your Xcelsius SWF. When set up properly, refereshing your Crystal Report will also refresh the data being sent to and consumed by the embedded SWF. See"

    <div class="content">
    <p>
    Please check the following post to see if there is a solution to the issue you are experiencing:
    </p>
    <p>
    <a href="/node/19014"><span style="color: #0063af">http://diamond.businessobjects.com/node/19014</span></a>
    </p>
    </div>

  • Passing formula values to Crystal Reports from c#

    in an old vb 6 application we used to be able to call a function called PESetFomula in the Crystal Reports viewer and pass it the name of the parameter and the value.
    How do we do that now using Crystal Reports for VS 2013. I don't mean to set the criteria just to pass over parameters and values.
    Bill

    Hi Bill,
    Moving the thread to Crystal reports for Visual Studio Space.
    Using the .net SDK you could use the ReportDocument class to pass the parameter values to the report.
    See the sample applications here:
    http://scn.sap.com/docs/DOC-6929
    http://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports+for+.NET+SDK+Samples
    The developer guide and the API reference guide is here.
    http://scn.sap.com/docs/DOC-7824
    - Bhushan
    Senior Engineer
    SAP Active Global Support
    Follow us on Twitter
    Got Enhancement ideas? Try the SAP Idea Place
    Getting started and moving ahead with Crystal Reports .NET applications.

  • Get error when passing server name to Crystal Reports in Visual Studio 2012

    Hello,
    I work on Visual Studio 2012 with Crystal Report 13.0.12 (both developer and run-time). When I pass the name of the server to the Crystal Reports, I get an error -- Failed to open the connection.  Database Vendor Code 17.  I use SQL OLEDB as the provider.  It worked before.  Not sure what has happened.
    Any help is much appreciated!!!
    John

    Hi,
    See this: Failed to open the connection - database vendor code 17
    --dj

  • Do we have Tool to re-point Dynamic Parameters in multiple crystal Reports

    Hi Experts,
    Do we have any tool to re-point Dynamic Parameters of Multiple reports in a single shot.source of crystal reports is SAP ECC tables.
    Thanks,
    BharathU

    Hello,
    Not sure what this has to do with Database connectivity but the answer is no.
    If you have access to a .NET or Java Developer you can write your own using the SDK.
    Don

  • Passing parameters to multiple sub reports

    Dear Experts,
    I have a crystal report (version 11) that has 4 subreports. I need to pass the same list of parameters to each sub report from the main design. I can not find a global perameter. Is this possible. an example is the date range. I need the user to be able to run the report and put the date range in once and have it passed to all of the sub-reports. thank you for your time.

    Hi,
    Yes, this is very much possible. Here's what you need to do:
    If the parameter is a string, number or date created in the Main Report then you can right-click the 1st subreport and select 'Change Subreport Links' > In the Fields to link to area move the Main Report parameter from the Available Fields area on the left.
    If the Subreport also has parameters then you can select the right-one that needs to be linked from the drop-down. This is directly link the Main report parameter to the Subreport parameter and you would prompted only once.
    Hope this helps!
    -Abhilash

  • Performance Issue when updating parameters in a Crystal Report on Edge 2008

    I have several Crystal reports posted into Edge 2008.  When you select Edit on a parameter to set the parameters to run the report, it takes a noticably long time for the parameter selection window to appear.  Then once you have made your choice, it takes quite a long time to close the parameter selection screen to go back to the scheduling window.
    I thought it might have something to do with reports where I have linked the parameter with a table field and appended the values in the report parameter.  But, it happens even when there is no link to the data for the parameter.
    I've had several users saying it is very frustrating having to wait for the parameter selection.

    I am using two infosets that are not linked together by any primary key. The main infoset has transaction records and the second infoset has only one record (which is a foreign exchange rate). The performance is slow and I am presuming its because there are no linked fileds between the infosets, everytime a record is read from the main infoset it goes to the second infoset and also reads the record there. Is there a way to improve performance? How can I have the report read the second infoset only once and store that value to be used when reading records from the first infoset.

  • Crystal Report ADO Connection Error

    I have a Crystal Reports created against an MS SQL Server DB using an ADO Connection (crdb_ado.dll). I am using a hardcoded user ID and password for logging into SQL Server, everything works fine when I log from Crystal Reports client, I am able to connect to SQL Server and refresh the report.
    When I publish to BOE and access from Infoview or CMC I get an error "[Failed to open the connection.
    xxxx report Details:  [Database Vendor Code: 17 ]]". I use the same account for SQL server under database config for Crystal report within CMC.
    Please see release info below:
    BOE XI 3.1 FP 3.1 (Windows 2008 server)
    Crystal Reports 2008 FP 3.1
    I have checked the  ADO dll version, size etc. on both client and BOE XI server and it looks the same.
    Are there any additional configuration required for this connection to work from BOE XI?
    I enabled log on BOE side and could not get anymore information other than the above message. We also tried with the SQL Server SA account to make sure this is not an access issue.
    Thanks.

    Hi Don,
    Please see answers below:
    >
    > What happens if you set the logon over ride properties for each instance?
    >
    I select the option "Use same database logon as when report is run" and get the error mentioned in the first message.
    > Also need to know what version of SQL Server you are using and if you are using the Native Client or the OLE DB for SQL Server driver?
    >
    We are using SQL Server 2008. I have tried with the OLEDB for SQL driver and with the Native client. In both the cases I am getting the same error. I also tried to change the OLEDB.sbo file as mentioned in note 1204488.
    Thanks.

Maybe you are looking for