ASP.NET c# Übergeben Parameter Crystal-Reports-Bericht

hi
ich bin neu in crystal reports und ASP.NET
Ich habe einen crystal-Reports-Bericht, und alles was ich will ist, zu übergeben einen parameter, der Bericht über meine asp.net Seite

hier ist der code, dass ich m mit

    protected void setParameterField()
{
    string strReportPath = "\\\\fileserver\\crude Accounting\\reports\\MonthReportNew.rpt";
    string weekReportPath = "\\\\fileserver\\crude Accounting\\reports\\" + "WeekWise.rpt";

    try
    {
        if (!System.IO.File.Exists(strReportPath))
        { throw (new Exception()); }
    }
    catch (Exception ex)
    {
        Response.Write("You Might Not Have Permission To View This Report. Please Contact System Administrator");
        Response.Write(Convert.ToString(ex.Message));
        return;
    }

    //Main Report
    ReportDocument cryRpt = new ReportDocument();
    cryRpt.Load(strReportPath);
    //Sub Report - Week
    ReportDocument weekReport = new ReportDocument();
    weekReport.Load(weekReportPath);

    ParameterFields paramFields = new ParameterFields();
    ParameterField paramField = new ParameterField();
    ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
    paramField.Name = "@Document_No";
    paramDiscreteValue.Value = "BAD-0511-PRO-2";
    paramField.CurrentValues.Add(paramDiscreteValue);
    paramFields.Add(paramField);

    CrystalReportViewer1.ParameterFieldInfo = paramFields;
   cryRpt.SetParameterValue("@Document_No", "BAD-0511-PRO-2");
    cryRpt.SetDatabaseLogon("myuserid", "mypassword");        
    CrystalReportViewer1.ReportSource = cryRpt;

}

Ich bin ständig immer Fehlermeldungen, fehlenden parameter-Werten
ich weiß nicht, was falsch mit diesem code..
bitte helfen Sie mir

InformationsquelleAutor Ath An | 2011-05-13

Schreibe einen Kommentar