Passing a parameter to a report that appears to be ignored.

I am using VS 2005 and Crystal Reports XI R2
The app I am working on allows users to either email a report as a PDF attachment or preview the report using a CrystalReportViewer. Users select a record number as the report parameter which the app feeds to the report when it calls it.
My problem is that when I use the CrystalReportViewer all the records in the table are reported on, not just the one the parameter refers to. However, there is not a problem when the report is exported to the PDF file. The correct record, and only the correct record is reported on.
The code used for the preview is ...
Private oReport as ReportDocument
Private Sub ConfigureCrystalReports()
        Dim oConnect As IConnectionInfo
        oReport = New ReportDocument()
        Dim reportPath As String = Application.StartupPath & "\" & "Receipts.rpt"
        Try
            oReport.Load(reportPath)
            For Each oConnect In oReport.DataSourceConnections
                oConnect.IntegratedSecurity = True
            Next
            oReport.SetParameterValue("ConstitreceiptDetailsID", "2")
            myCrystalReportViewer.ReportSource = oReport
        Catch ex As Exception
            MsgBox("Error '" & ex.Message & "'")
        End Try
    End Sub
The sub above is called on the load event of the form the CrystalReportViewer is on.
To complicate matters, if I first export the report as a PDF, then view it, it performs perfectly. Only the correct record is shown. Code for this is as below...
Private oReport as ReportDocument
Private Sub ConfigureCrystalReports()
        Dim oConnect As IConnectionInfo
        Dim exportOpts As ExportOptions
        Dim DiskDestOptions As DiskFileDestinationOptions
        Dim strResult As String
        oReport = New ReportDocument()
        Dim reportPath As String = Application.StartupPath & "\" & "Receipts.rpt"
        Try
            oReport.Load(reportPath)
            For Each oConnect In oReport.DataSourceConnections
                oConnect.IntegratedSecurity = True
            Next
            strResult = "C:\Test2.pdf"
            DiskDestOptions = New DiskFileDestinationOptions()
            DiskDestOptions.DiskFileName = strResult
            exportOpts = oReport.ExportOptions
            With exportOpts
                .DestinationOptions = DiskDestOptions
                .ExportDestinationType = ExportDestinationType.DiskFile
                .ExportFormatType = ExportFormatType.PortableDocFormat
            End With
            oReport.SetParameterValue("ConstitreceiptDetailsID", "2")
            oReport.Export()
            myCrystalReportViewer.ReportSource = oReport
        Catch ex As Exception
            MsgBox("Error '" & ex.Message & "'")
        End Try
    End Sub
Clearly I'm doing something wrong with the viewer. If anyone could make any suggestions I would be more than grateful.

Are you using the parameter in your selection formula? If so, see if the following helps:
http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=7896863&sliceId=&dialogID=24902374&stateId=1 0 24906112
Regards,
Jonathan

Similar Messages

  • Passing Multivalued parameter to sub report in SSRS

    Hi Team,
    I tried passing multi valued parameter to sub report in SSRS but the report is blank.
    Rgds,
    Shree

    Hi Shree,
    As per my understanding, the issue is caused by the multiple-value parameters are not passed from the main report to the subreport correctly. Please refer to the steps below to check whether you configure the subreport parameter settings correctly:
    Drag a Subreport control from toolbox to design surface.
    Right-click the Subreport to open the Subreport Properties dialog box, then select the correct report as subreport.
    Click Parameters in the left pane.
    Add parameters as below (Parameter1 is a single-value parameter, Parameter2 is a multi-value parameter in subreport ):
    Name: Parameter1              Value: [@ReportParameter1]
    Name: Parameter2              Value: =Split(join(Parameters!ReportParameter2.Value,","),",")
    Please also directly select or type the same values in subreport to check whether the subreport works well with those parameter values.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Pass a parameter from a report to a customization form of another report

    Hello,
    I want to pass a parameter value from a report to the customization form of another report and display it in the text field in the customization form as a default value. I have 2 variables in the customization form and in one of them, I would like to display the default value from a previous report.
    Thank you
    Jayasree

    1. go to the manage component screen of the report
    2. open the package body (pl/sql source)
    3. search for 'procedure show_parms'
    4. scroll down till you find
    -- call to parameter form rendering engine
    5. copy the procedure call below it
    a) you will have to pass <PORTAL_SCHEMA>.wwv_utlglobl.RUN_AS_NORMAL to p_mode
    b) remove the parameters p_reference_path, p_redirect_url, p_exec_mode, p_page_url ( or you can pass null to them)
    c) 'p_parm_names' will contain your 2 parameters
    d) you can pass values to 'p_parm_values' which you want to be displayed in the parameter forms.
    6. you can call this procedure from a dynamic page and link the dynamic page to your first report

  • Passing a parameter from one report to another one

    dear friends
    i created a report that display the employees who hired between a given period . my sql statement is
    select ename,sal,hiredate
    from emp
    where hiredate between :par_d1 and :par_d2
    i passed the two parameters from the form successfuly
    but i want to pass both parameters (:par_d1 and :par_d2)
    to another report from the current report at runtime buy clicking on a button within the current report
    i just want to know if this possible or not
    thanks alot
    tarek

    <frameset rows="106,*">
    <frame name="header" scrolling="no" noresize target="main" src="head.jsp">
    <frameset cols="*,34%,32%">
    <frame name="main" src="model.jsp?make=<%=request.getParameter("make")%>" scrolling="auto" noresize>
    <frame name="main1" src="year.jsp" scrolling="auto" noresize>
    <frame name="main2" src="engine.jsp" scrolling="auto" noresize>
    </frameset>

  • Resultset of main report passed as parameter to child report stored proc

    Post Author: chicagolad
    CA Forum: Data Connectivity and SQL
    I seem to be in a bind with this issue. I have a main report and sub report. The main report takes in a comma seperated value as a parameter to the stored procedure. The result set of which is used to group 20 sub reports. These subreports use a different stored procedure to which I need to send the group value which is a part of the result set table I get for the main report. Come what may, I am not able to link the main report with the sub report.
    To repeat the question, how do i pass the a result column of the main report as parameter to the sub report stored procedure? Any insight will be much appreciated.
    TIA
    chicagolad

    Raghavendra,
        It seems that no matter what I do, using the parameter ?TagNumber as the item to link from in the main report (Subreport Links) will not give any results no matter which item I link to in the subreport, but if I use the specific data item that the parameter represents, then any of the choices in the lower left "subreport parameter field to use" will work.  So I can simply use the specific data item and everything works fine. It's strange, as last week using the parameter of the main report worked, but as I have a working solution I don't have to resolve that.  (There was data for the parameter value,as I printed the parameter value in the report and the selected value was shown.).
       This is now resolved.  Thanks for your help.
    Don

  • How to pass a parameter from a report to multiple forms in the same page

    Hi:
    i have a report and a lot of forms in the same page. The fact is that i want to stablish a link over a filed in the report which would make some information appear in those forms so that information could be updated. For example: i have a report with company names. Over those names i want to put a link. When the link would be pressed the forms would reflect the information about that comany. Is this possible to be done? how can i do this or something similar?
    Thanks.
    Regards. Urko.

    Please see post Re: session state security
    It has been done for a single form in a page and can be extended to multiple forms as well.

  • Need help on passing a parameter in Oracle report

    Hello guys ...i Have a custom report which takes..TRX number and Org id as input Parameters.where TRX number is mandatory and ORg id is optional.
    here is my question ..if i dont pass the org id,it should take the id of the Organization where i am running the report.how can this functionality achieved...
    thanks....

    Hi,
    You can use NVL function in form, where you are passing the parameters. So replace the *:ORG_ID* with
    NVL(:ORG_ID, :CUR_ORG_ID). Or If you are saving the current Org_id in a table / passing it to the report using another parameter, you can do the same in the report also.
    Regards,
    Manu.
    If this answer is helpful or correct, please mark it. Thanks.

  • In Drill through report pass hyperlink value as parameter to another report using ssrs 2008 R2

    Hi All,
    I have one drill through SSRS report in which if I click one hyperlink in the summmary report it should be passed as parameter for detail report, like this....
    Summary:
    AccountType
    A1
    A2
    If I click A1 then that should be passed as parameter to detail report and display A1 data in detail report
    If I click A2 then that should be passed as parameter to detail report and display A2 data in detail report.
    Please give me some ideas or expression code to achieve this in using SSRS 2008R2. Its very urgent.
    Thanks,
    RH
    sql

    Thanks the folowing is my source data for the parameter I am including to the drill through
    SELECT DISTINCT
    case
    when EA_STATUS in ('E4', 'U4', 'P5', '02', '03', '04','B2','B3','B4','12')
    then CAST('Project' AS VARCHAR(15))
    else CAST('Non-Project' AS VARCHAR(15))
    end as EA_PROJECT_GROUP_DESC
    FROM TEAMS.FMPROD_V_EA
    As you can see it has only 2 values.So how do you suggest I wirte the expression to include in the report.
    The name of the parameter I will be using is EAProjectGroup.but below is the error I am getting trying to run the report
    rsMissingFieldInDataSet] The dataset Trends contains a definition for the Field EA_PROJECT_GROUP_DESC. This field is missing from the returned result set from the data source.
    [rsErrorReadingDataSetField] The dataset Trends contains a definition for the Field EA_PROJECT_GROUP_DESC. The data extension returned an error during reading the field. There is no data for the field at position 45.
    Preview complete -- 0 errors, 72 warnings
    what does the position 45 mean?

  • How to pass parameter to a report for Operator 'LIKE'

    I need to pass a parameter to a report for "LIKE" operator. the parameter for "equal to or is in" operator is 'eq':
    'https://secure-ausomxfts.crmondemand.com/OnDemand/user/analytics/saw.dll?Go&Path=/shared/Company_AFTA-D78SR_Shared_Folder/Work Order Asset Lookup&Options=r&Action=Navigate&P0=2&P1=eq&P2=Account.TEXT_61&P3=&p4=
    What would 'p1' value for 'LIKE' operator?
    Thanks

    Hi, Hope the below helps
    neq - Not equal to or not in
    lt - Less than
    gt - Greater than
    ge - Greater than or equal to
    le - Less than or equal to
    bwith - Begins with
    ewith - Ends with
    cany - Contains any (of the values in &P3)
    call - Contains all (of the values in &P3)
    like - Is like (Type %25 rather than the % wildcard)
    top - In the top n (&P3 contains 1+n, where n is the number of top items)
    bottom - In the bottom n (&P3 contains 1+n, where n is the number of bottom
    items)
    bet - Between (&P3 must have two values)
    null - Is null (&P3 must be 0 or omitted)
    nnul - Is not null (&P3 must be 0 or omitted)
    Venky CRMIT

  • Most urgent:::: passing parameter list  to reports containing record groups

    hi
    can any one help me , i am getting frm-41214 when i pass a paramter list containing record group as data parameter to run_report_object as parameter, calling report from forms 10g, but when i dont pass the parameter list the report runs displaying no data(as it should do), otherwise it dont run and display the frm-41214
    zulfiqar

    Hi!
    To suppress Oracle Reports native Parameter Form just add:
    add_parameter( pl_id, 'pARAMform', text_parameter, 'NO' );
    Andrew Velichko
    Brainbench MVP for Oracle Developer 2000 http://www.brainbench.com
    null

  • Passing a parameter to a formula

    Ok - tried everything and I am at a loss...
    I need to pass a parameter to a report  in order to provide the path of the images to a report. The path is contained in the web.config and extracting that in a code behind variable works fine (szReportsImages).
    Here is the VB code:
                        Dim myReportPath As New IC_General
                        myReportPath.DataDefinition.FormulaFields("ictImagePath").Text = szReportsImages
                        CrystalReportViewer.HyperlinkTarget = "_blank"
                        crReportDocument = myReportPath
    In the CR2008 report I have a Formula field named ictImagePath.
    If I drag the formula filed into the report just to display and see it I get the following error:
    The remaining text does not appear to be part of the formula. Details: errorKind Error in File temp_7c5fa354-24e2-4308-9758-f64932d08a69 {A7A80D2D-8EAF-4997-A57D-6B679B019850}.rpt: Error in formula ICTImagePath: 'C:\Inetpub\wwwroot\Reports\images\' The remaining text does not appear to be part of the formula. Details: errorKind
    What Am i missing here?
    Help!
    Gary

    This always works - but does solve the issue. 
    Since the client might not install in a specific directory - in fact best practices would say don't assume a hard coded path.
    What I need is to get a method to pass the path to the report and then us it in the report image location to provide a full path.
    Gary

  • Pre-populating parameter field when report deployed

    I have two similar reports, where the reports contains several report parameters and a drop down list of of available options are provided based upon the first report parameter.
    The report that works correctly, has the first report parameter pre-populated.  The second does not.  I don't know how the first report parameter in the correct report has been pre-populated (I didn't create it).  It looks like it is pre-populated
    based on the login that you use.  At the moment in the second report, instead of having a drop down menu - the option is greyed out.  However, if I type in a figure for the first report parameter, the drop down menu is available and the options appear
    in a drop down list based on that figure.
    Can someone please tell me how can I pre-populate the report parameter so I can replicate it in my second report?

    Hi chowwbc,
    Based on my understanding, you have two similar reports, you want to make a report parameter pre-populate in your second report.
    In Reporting Service, when we specify the default values for a report parameter and default values are available, the parameter will pre-populate in a report. If you want to select parameter values appear in a drop-down list, you should specify available
    values for a parameter.
    In your scenario, as a parameter is an item within a report, you can’t copy parameter values from first report to second report directly. Since two reports are similar, you can refer to first report to specify default values for parameters in your second
    report. As we tested in our environment, if we specify default values for a report parameter, the parameter will pre-populate in the report. Please refer to screenshot below:
    Reference:
    Report Parameters (Report Builder and Report Designer)
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu

  • Passing a parameter using c#

    Does anybody have a code sample for passing a parameter to a report in C# (2010)?  Any samples I can find refer to older versions of Crystal Reports.
    Thanks!

    example:
                ReportDocument cryRpt = new ReportDocument();
                string filePath = aPath + @"reports\" + report;
                cryRpt.Load(filePath);
                ParameterFieldDefinition PFD = null;
                ParameterValues PValues = null;
                ParameterDiscreteValue Parm = null;
                PValues = new ParameterValues();
                PFD = cryRpt.DataDefinition.ParameterFields["id"];
                Parm = new ParameterDiscreteValue();
                Parm.Value = reparm;
                PValues.Add(Parm);
                PFD.ApplyCurrentValues(PValues);
                cryreportviewer.ReportSource = cryRpt;
                cryreportviewer.Zoom(100);
                cryreportviewer.ToolPanelView = ToolPanelViewType.None;
                cryreportviewer.Refresh();
    "id" is he name of the parameter in the report, hope it helps

  • Passing & as parameter

    How can I pass '&' as parameter to the report..I tried replacing with the escape character but I keep getting
    REP-51002: Bind to report server......failed...any help would be greatly appreciated

    1) has the server started ? meaning without & does report run fine?
    2) put the param value containing & in single / double quotes and try
    3) encode & in %xx form where xx is the ASCII value of & in HEX ( ie url encode special chars). Search for ASCII table in web to see ascii codes for special chars

  • Help Needed in passing parameter to cryst report

    Hello everyone, I am trying to create a report for a single record and as such am trying to pass parameters to a crystal report but I am not sure exactly how to do this. This is my own method that I am employeeing. I do not want to create a data table and put all the info I need in there and then base a report off of it. I do not want to deal with loops and arrays right now. I just want to pass for example parameter JuvenileID = 1 to my crystal report, then create a command under the database expert and set the parameter for my command to the parameter I passed my crystal report. How would I go about in doing this? I am using VS 2010 C#. This is a windows application. I have a dataentry form that is already populated with the info needed for the report. I just need to pass all the controls.text values to the report and populate it that way.

    I'm not sure if I fully understand the issue, but since you have all the data you need in a data entry form that is already populated, why don't you simple create an ADO .NET Dataset and pass that to the report? Much easier to implement, faster execution with the small amount of data you have and less code.
    Dataset sample app is here:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    More info on datasets is here:
    [1511438 - How to use datasets to pass data to crystal reports|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333533313331333433333338%7D.do].
    - Ludek

Maybe you are looking for