Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem with the Selection Formula and a Parameter Field.

Hello everyone,

In my report the report displays fine (except too man records are shown) if I don't put in my Selection Formula. However, if I use a selection formula that references a Parameter Field, when the form first displays it will prompt me for the Value of the Parameter Field. I have set all this in C# in Visual Studio and as I said it does not prompt me if I don't have a Selection Formula. Can we use a Parameter Field in a Selection Formula?

public partial class ReportForm : Form

{    

          private readonly string _batchNumber;   

          public ReportForm(string batchNumber)   

          {       

                    _batchNumber = batchNumber;        

                    InitializeComponent();   

           }   

          protected override void OnLoad(EventArgs e)   

          {       

                    APGreenSheets report = new APGreenSheets();       

                    DataSet data = AccountsPayableController.FillDataSet();       

                    report.SetDataSource(data);       

                    report.SetParameterValue("BatchRef", _batchNumber);       

                    crystalReportViewer1.ReportSource = report;       

                    crystalReportViewer1.RefreshReport();       

                    base.OnLoad(e);  

          }

}

My Selection Formula in question (I used the Wizard to write this): {AP_HistoryHeader.strBatchRef} = {?BatchRef}

Visual Studio 2015/2013 (Same Behavior)

CrystalReports for Visual Studio 13.0.14 or 13.0.15

I will attach any files you wish me to.

Thanks in advance,

Randy

Tags:
replied

OK, then remove the RefreshReport line.

Set the parameter value to "" nothing or use .Reset(). it's using the same value you first set.

Don

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question