none
reportViewer error RRS feed

  • Question

  • I get the following error at this line:

    bytes = reportViewer.ServerReport.Render(

    "Excel", Nothing, mimeType, encoding, extension, streamids, warnings)
     

    This report requires a default or user-defined value for the report parameter 'CountyCode'. To run or subscribe to this report, you must provide a parameter value. (rsReportParameterValueNotSet)

    But the rptCounty.CountyCode has  01,65,66,67

     

    Dim reportViewer As New ReportViewer()

     

    Dim m_Cred As ReportServerCredentials = New ReportServerCredentials()

     

    'Set Processing Mode
     

    reportViewer.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote

    reportViewer.ServerReport.ReportServerUrl =

    New Uri(ConfigurationManager.AppSettings("ReportServerURL"))

    reportViewer.ServerReport.ReportPath =

    String.Format("{0}RptNonCompliance", ConfigurationManager.AppSettings("ReportServerFolder"))

     

    For Each rptCounty As MLncRpt_County_Obj In

    rptCountyList

     

    'set report parameter

     

    Dim rptParam As New ReportParameter("CountyCode", rptCounty.CountyCode, False

    )

    reportViewer.ServerReport.SetParameters(

    New

    Microsoft.Reporting.WinForms.ReportParameter() {rptParam})

    bytes = reportViewer.ServerReport.Render(

    "Excel", Nothing

    , mimeType, encoding, extension, streamids, warnings)

     

    'Write report out to temporary Excel file

    ReportName = rptCounty.CountyName &

    "NonComplianceReport.xls"

     

    Dim reportPath As String = ReportDirectoryPath & "\"

    & ReportName

    fs =

    New

    FileStream(reportPath, FileMode.Create)

    fs.Write(bytes, 0, bytes.Length)

    fs.Close()

     

    Try

     

    'send email

    SendEmail(rptCounty.EmailAddresses, reportPath, rptCounty.CountyName)

     

    Catch ex As

    System.Net.WebException

     

    Finally

     

    'Remove the temp file once it emailed

    File.Delete(reportPath)

     

    End

    Try

     

    Next

     
    www.helixpoint.com
    Tuesday, July 12, 2011 2:04 PM