Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Prompted For Parameters
Message
Information générale
Forum:
ASP.NET
Catégorie:
Rapports
Divers
Thread ID:
01461921
Message ID:
01462113
Vues:
43
I suppose you have already checked the parameter names to make sure they all match. That's the sort of thing that usually trips me up.

>I have a Contacts detail report. I'm getting prompted for parameters and I cannot figure out why. I'm using a Crystal Reports project
>that I wrote.
>
>My Crystal Reports project has 3 classes: CrystalLogonInfo, CrystalReportInfo, and CrystalReportViewer.
>
>The CrystalLogonInfo struct has properties for the DB login info. The CrystalReportInfo class has 2 List collections for
>ParameterNames and ParameterValues, and properties for an instance of the LoginInfo struct and a ReportDocument. The
>CrystalReportViewer is a wrapper for the CrystalViewer control.
>
>The project is very small and until now worked fine. The source is here www.marois-consulting.com/files/CystalReports.zip.
>
>
>I my Contacts project I am using my CR project to show the Detail report. I am Setting it up like this:
>
>
>private void _RunReport()
>{
>    CrystalLogonInfo LogonInfo = new CrystalLogonInfo();
>    LogonInfo.ServerName = Properties.Settings.Default.ServerName;
>    LogonInfo.DatabaseName = _Database;
>    LogonInfo.IntegratedSecurity = true;
>
>    CrystalReportInfo ReportInfo = new CrystalReportInfo();
>    ReportInfo.Report = new rptContactDetail();
>    ReportInfo.LogonInfo = LogonInfo;
>
>    ReportInfo.SetParamValue("@FirstName", txtFirstName.Text);
>    ReportInfo.SetParamValue("@LastName", txtLastName.Text);
>    ReportInfo.SetParamValue("@Title", txtTitle.Text);
>    ReportInfo.SetParamValue("@CompanyName", txtCompany.Text);
>    ReportInfo.SetParamValue("@Street1", txtStreet1.Text);
>    ReportInfo.SetParamValue("@Street2", txtStreet2.Text);
>    ReportInfo.SetParamValue("@City", txtCity.Text);
>    ReportInfo.SetParamValue("@State", txtState.Text);
>    ReportInfo.SetParamValue("@ZipCode", txtZipCode.Text);
>    ReportInfo.SetParamValue("@Category", cboCategory.Text);
>    ReportInfo.SetParamValue("@Subcategory", cboSubcategory.Text);
>
>    frmReportViewer Viewer = new frmReportViewer();
>    Viewer.ViewReport(ReportInfo);
>    Viewer.ShowDialog();
>}
>
>
>In the CR project the ViewReport method sets the ReportInfo property on the viewer:
>
>
>private CrystalReportInfo _ReportInfo = null;
>public CrystalReportInfo ReportInfo
>{
>    get { return _ReportInfo; }
>    set 
>    {
>        _ReportInfo = value;
>
>        _SetupLogonInfo();
>        _SetupParameters();
>    }
>}
>
>
>Then, the SetupParameters method does this:
>
>
>private void _SetupParameters()
>{
>    if (_ReportInfo != null && _ReportInfo.ParameterNames.Count > 0)
>    {
>        int Index = 0;
>
>        foreach (string ParamName in _ReportInfo.ParameterNames)
>        {
>            _ReportInfo.Report.SetParameterValue(ParamName, _ReportInfo.ParameterValues[Index]);
>            Index++;
>        }
>
>        ReportSource = _ReportInfo.Report;
>        Refresh(); 
>    }
>}
>
>
>I have 2 reports in my Contacts project. The ContactSingle report works fine using this CR class. The ContactsDetails report
>keeps prompting me for params.
>
>Anyone see what's wrong?
Linda Harmes
HiBit Technologies, Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform