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

Similar Messages

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

  • 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 database command parameter to sub-report

    I'm trying to pass a runtime parameter from a main report to a database command parameter in a sub-report, and having some trouble.
    My main report has parameter fields (Vendor, Manufacturer, etc) that the user selects at runtime - the result set includes Item Code - that part is working fine.  Where I'm having trouble is with linking to the sub-report.  My sub-report has a stored command that takes a parameter (ItemCode) and counts the number of times it's shown up on an invoice.  When I created the command, it asked for a value for the parameter, and won't accept a blank entry.  Now, whenever I try to run the main report, it asks for the ItemCode parameter for the sub-report - which kind of defeats the purpose.  I've tried linking from ?Pm-OITM.ItemCode in the main report, but the Subreport Links window doesn't show the Command parameter to link to.
    How do I take a field from the main report and pass it to a sub-report to be used as a parameter in a stored database command? 
    I'm running CR 2008, and SAP B1 2007 PL 42 on MS SQL 2005, and I'm still pretty new at CR, so details help.
    Thanks.

    Go to change subreport links and add Item Code from main report and then you can see the sureport stored procedure parameter in the Subreport parameters list, select the parameter and do not select any field from subreport.
    You will be able to see the stored procedure parameter in the list only when the Item Code and the parameter are of same data type.
    Regards,
    Raghavendra

  • 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

  • Pass a value from a sub report back to a main report

    This may not be possible but i though i would see if i had any options.
    I have a main report with sales data and a sub report with budget data in the footer. Neither are linked to each other as i do not have a common field.
    I was hoping to bring a value through from the sub report to the main report or vice versa for a calculation. Its just one calc to work out the percent of sales against budget. sales/budget total.
    stuck!
    Any help would be appreciated.

    Thanks for the reply but this has not worked.
    I created a formula field on the main report HEADER @myValue with:
    Whileprintingrecords;
    Shared numbervar myValue:=0;
    Then I created a formula field in the sub report @myValue with:
    Whileprintingrecords;
    Shared numbervar myValue;
    myValue:= {@Budget-Month};
    @budget-month being the field i want to pass through to the main report.
    I placed this formula in the same section as the @budget-month formula field which is in the report footer
    Then i created a formula field @AVG, added it to a new section below the current fields and used the below
    Whileprintingrecords;
    Shared numbervar myValue;
    //calculation using MyValue
    {@myValue}/{@Sales Total}
    I get an error with the @myValue part in this formula "a number or currency amount is required here"
    I did have to change the Shared number from your formula to shared numbervar as number was not accepted. Does that matter?

  • How to pass parameters between main and sub vi during parallel execution using the VI server technique?

    Hello All,
    I am working with the following example (from previous postings on this
    board) that demonstrates how to run a sub vi in parallel with the main
    vi.  I'd like to pass parameters between the main and sub such as
    the control (delay) and indicator (value) parameters of my subvi
    example.  Does any one know how to do this?  Parallel
    execution is important for me, I cannot just paste the subvi icon into
    my main diagram (two nested while loops...)
    Many thanks,
    Luis
    Message Edited by cascao on 08-16-2005 08:42 PM
    Message Edited by cascao on 08-16-2005 08:42 PM
    Attachments:
    VI_Server_technique.vi ‏32 KB
    SubVI_1.vi ‏19 KB

    cascao wrote:
    Hello All,
    I am working with the following example (from previous postings on this
    board) that demonstrates how to run a sub vi in parallel with the main
    vi.  I'd like to pass parameters between the main and sub such as
    the control (delay) and indicator (value) parameters of my subvi
    example.  Does any one know how to do this?  Parallel
    execution is important for me, I cannot just paste the subvi icon into
    my main diagram (two nested while loops...)
    Many thanks,
    Luis
    Luis, you can use the VI Server methods 'Set Control Value' and 'Get Control Value', as demonstrated in the attached examples.
    -Franz
    Attachments:
    VI Server.zip ‏26 KB

  • Passing parameters to web based oracle forms

    Hi,
    How can I pass parameters from web page to oracle form applet? OR is there anyway i can know (within a form) if that form is run from a client/server or from web. This is just to set some parameters depending on the condition: client/server or web application.
    thank you

    To know if you are on the Web use the get_application_property built-in, check out the online help for it.
    To pass parameters - if you are using the forms servlet you can pass parameters on the URL that calls your Forms application.

  • 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

  • How to pass BigDecimal as currecny to Crystal Reports using JRC 11

    Im using JRC to load and view crystal reports.ie loading crystal reports that are created (not by me) using Crystal Reports v 10. My work is just load those rpt files using JRC thick client.
    rpt files are bound to .mdb (MS Access) database and DB is password protected.  One of the table in database has currency data type. I'm creating a POJO class to implement the table structure. To match with Currency type, Im using BigDecimal type in my pojo class. when i open the .rpt file in crystal report designer, it shows with default currency symbol (i.e $ and  £) But the when i load the same report via JRC, It doesnot show the symbol at all.
    When I change this to String and pass symbol, it is coming up properly. But in some places, the reports use sum function of 2 curency fields. So in this case, string cannot be used.
    Any help would be appreciated.
    Thanks.

    Sorry. I did not get your point directly.
    So I'd recommend not directly relying on internal handling of BigDecimal. You can still report off the value.
    So you are telling me not to use BigDecimal? If not what should I use? Please be bit more explanative.
    Thanks.

  • Pass multi value parameter to sub report in Drill through report, ssrs

    I have two reports 1 is subreport and other is main report. Date Field are placed in both reports. i have groups in main report,
    one group is task. In the task fields one persons is working in 3 project, two project are same company and 1 is for other and it give me count for each project. I
    want when i click on link it send multivalue parameter to subreport and it just show matching records.
    Asif Mehmood

    As I understand what you need is to use LookupSet function. 
    Suppose if your dataset is like this (for simplicity I'm showing only required fields)
    PersonID Project Company
    ID1 P1 C1
    ID1 P2 C1
    ID1 P3 C2
    ID1 P4 C2
    ID1 P5 C3
    If you want to get the full project list for the person just send the PersonID alone and filter using it in the subreport. You can keep the project/company parameters optional in that case and put a default value. This would be the easiest thing.
    Now if you want pass the project parameter also you need to pass it like this
    =Join(LookupSet(Fields!Person.Value,Fields!Person.Value,Fields!Project.Value,"DatasetName"),",")
     This would act like a self lookup and return you full list of projects for the person and then you can use this to set the parameter value in the subreport.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Can I pass parameters from Procedure to omniportlet?

    hi,
    i have an Omniportlet that I need to pass a parameter of Employee Number.
    I create a procedure in PLSQL after that i make a Form based in this procedure, To use the Employee Number and I can pass this parameter to a form and it works, however I can't pass the parameter to the Omniportle.
    Can somebody help me?

    Hi,
    Program unit syntax :
    PROCEDURE sample(blk_nm varchar2,itm_nm varchar2,btn_nm varchar2) IS
    ---local variables declaration (if any)
    begin
    end;
    To call program unit from trigger:
    sample ('myblock','myitem','mybutton');
    Suresh
    null

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

  • Unable to run Store Procedure based deski report in Infoview

    Hi All,
    I have a Deski report which is created using Store Procedure. I am able to run report in Full Client Deski. But I am unable to run / schedule same report thorough infoview.
    More details about report
    - Report uses 3 store procedures. When I ran report in infovew I get error message as "SP2 Dataprovider did not refresh properly".  -- SP2 is Dataprovider name.
    - Same report I am able to run in Dev environment. After migration to Model, report fails to run in model infoview.
    - I am able to Run report only for 1st. When I refresh and run with same parameter report shows error.
    Any input will be great help.
    Thanks,
    NV

    Hi,
    Could you please test the following solutions to resolve the issue.
    Solution1:
    Test the issue by inserting the following parameter in .SBO file.
    <Parameter Name="Force SQLExecute">Always</Parameter> .
    Solution2
    Just put SET NOCOUNT OFF in the end of the stored procedure SQL.
    If the above doesnu2019t works then please try the following solution.
    Solution3
    Make the new connection from the scratch using ODBC connection and test the issue.
    I hope this will help you.
    Regards,
    Sarbhjeet Kaur

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

Maybe you are looking for

  • Address Book no longer works after installing Lion on MAC Book Air.

    Ive checked my updates and it is not one of them. I am new to MAC and I am clueless as to what to do. Any suggestions?

  • What happens if you lose/break your iPad host computer?

    I am migrating over to iOS from Android and I seriously dislike both iTunes and iTunes Wi-Fi sync, but the iPad is a great device. Now, I had a question about the iPad. I have a Windows laptop and a new iPad. What would happen to the media on the iPa

  • Can't get netcfg to work properly

    I'm currently trying to setup my netcfg.  I can connect wirelessly without any problems by the following process: ifconfig wlan0 up iwconfig wlan0 essid "networkid" wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf dhcpcd wlan0 However, w

  • QuarkXPress 8 and iMac Incompatible?

    We've been having a long running issue with XPress 8 and one of our Macs which is a late 2009 27" iMac and an ATI Radeon HD 4850 video card. XPress will cause the system to crash on lanch; a red sort of "overlay" will begin on the screen at the top a

  • Sqlldr WHEN clause with function call ?

    I have a requirement to load data from a file with each row being checked for good data. But that check is wrapped inside a function, as it is somewhat complex. So I woul like to load the data with a WHEN clause like this WHEN ( "CHECK_IF_GOOD(:field