Results 1 to 4 of 4

Thread: Problem in ReportViewer using remote mode

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Thumbs up Problem in ReportViewer using remote mode

    Hi friends,

    I am using reports in my application. In reportviewer i am using local report in my code.Its working well. But for print icon display is needed in my application.So i am using server report. But errors occurred in the code.

    The Error is " datasource is not a member of Microsoft.Reporting.WebForms.ServerReport". What can i do? I can't run the application using serverreport.
    For ur's reference i put the code using local report

    Page.Title = "Reports Based On Company"
    dsGetValue = New DataSet
    objReport = New clsReport
    ReportViewer1.ProcessingMode = ProcessingMode.Local
    ReportViewer1.LocalReport.DataSources.Clear()
    Dim report As LocalReport = ReportViewer1.LocalReport
    dsGetValue = New DataSet

    If paramCompanyName = "All" Then
    'Temp DataTable to Concatenate the Address fields
    dtTempTimeSheet = New DataTable
    'Temp DataSet to Concatenate the Address fields
    dsgetTempSheet = New DataSet
    dtTempTimeSheet.Clear()
    dsgetTempSheet.DataSetName = "PmsDataSet"
    ' Add the new table
    dtTempTimeSheet = dsgetTempSheet.Tables.Add("DataTable3")
    ' Define the columns
    With dtTempTimeSheet
    .Columns.Add("strCompanyName", System.Type.GetType("System.String"))
    .Columns.Add("strRelationshipType", System.Type.GetType("System.String"))
    .Columns.Add("strAddress1", System.Type.GetType("System.String"))
    .Columns.Add("strContactNo", System.Type.GetType("System.String"))
    .Columns.Add("strWebsite", System.Type.GetType("System.String"))
    End With

    dsGetValue = objReport.getDetailedReportForCompany(paramstrRelationshipType, paramCompanyName)

    For intloop = 0 To dsGetValue.Tables(0).Rows.Count - 1
    dbrow = dtTempTimeSheet.NewRow
    With dbrow
    .Item("strCompanyName") = dsGetValue.Tables(0).Rows(intloop)(0)
    .Item("strRelationshipType") = dsGetValue.Tables(0).Rows(intloop)(9)
    .Item("strAddress1") = dsGetValue.Tables(0).Rows(intloop)(4) + "," + dsGetValue.Tables(0).Rows(intloop)(10)
    .Item("strContactNo") = dsGetValue.Tables(0).Rows(intloop)(6)
    .Item("strWebsite") = dsGetValue.Tables(0).Rows(intloop)(2)
    'Add New Row
    dtTempTimeSheet.Rows.Add(dbrow)
    End With
    Next

    End If


    'This Case Works If The Selected Company Name Is All
    If paramCompanyName = "All" Then

    Select Case dsgetTempSheet.Tables(0).Rows.Count
    Case Is > CInt(0)
    report.ReportPath = "ReportsNewUI/CompRelType.rdlc"
    Case Else
    report.ReportPath = "ReportsNewUI/ReportWithError.rdlc"
    End Select
    Try
    Dim strDatasource As New ReportDataSource()
    strDatasource.Name = "PmsDataSet_DataTable3"
    strDatasource.Value = dsgetTempSheet.Tables("DataTable3")
    report.DataSources.Add(strDatasource)
    Catch ex As Exception

    End Try

    'This Case Works If The Selected Company Name Is All
    ElseIf paramCompanyName <> "All" And paramstrRelationshipType = "All" Then
    dsGetValue = objReport.getDetailedReportForCompany(paramstrRelationshipType, paramCompanyName)
    Select Case dsGetValue.Tables(0).Rows.Count
    Case Is > CInt(0)
    'report.ReportPath = "ReportsNewUI/detailedReportForCompanyDetails.rdlc"
    report.ReportPath = "ReportsNewUI/ReportWithCompanyInformation.rdlc"
    Case Else
    report.ReportPath = "ReportsNewUI/ReportWithError.rdlc"
    End Select
    Try
    Dim strDatasource As New ReportDataSource()
    strDatasource.Name = "PmsDataSet_DataTable3"
    strDatasource.Value = dsGetValue.Tables("DataTable3")
    report.DataSources.Add(strDatasource)
    Catch ex As Exception

    End Try
    ElseIf paramCompanyName <> "All" And paramstrRelationshipType <> "All" Then
    dsGetValue = objReport.getDetailedReportForCompany(paramstrRelationshipType, paramCompanyName)
    Select Case dsGetValue.Tables(0).Rows.Count
    Case Is > CInt(0)
    'report.ReportPath = "ReportsNewUI/detailedReportForCompanyDetails.rdlc"
    report.ReportPath = "ReportsNewUI/ReportWithCompanyInformation.rdlc"
    Case Else
    report.ReportPath = "ReportsNewUI/ReportWithError.rdlc"
    End Select
    Try
    Dim strDatasource As New ReportDataSource()
    strDatasource.Name = "PmsDataSet_DataTable3"
    strDatasource.Value = dsGetValue.Tables("DataTable3")
    report.DataSources.Add(strDatasource)
    'Send Paramteres To Report File
    'Dim StatusParameter As New ReportParameter()
    'StatusParameter.Name = "strCompanyName"
    'StatusParameter.Values.Add("Company Name" & " " & paramCompanyName)
    'Dim parameter() As ReportParameter = {StatusParameter}
    'report.SetParameters(parameter)

    Catch ex As Exception

    End Try
    End If

    Finally
    dsGetValue = Nothing
    objReport = Nothing

    I hope ur's reply soon.

    Thanks
    Failing to plan is Planning to fail

  2. #2
    Lively Member
    Join Date
    Aug 2008
    Location
    North Carolina
    Posts
    114

    Re: Problem in ReportViewer using remote mode

    Try putting a "/" in front of "ReportsNewUI/detailedReportForCompanyDetails.rdlc" making it "/ReportsNewUI/detailedReportForCompanyDetails.rdlc" for your Report Path. Everything i have seen on server reports shows that syntax.

    i had a problem and received a similar message using local reports and it turned out to be a syntax error on my part. Hope this helps.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Problem in ReportViewer using remote mode

    Which line errors out and is it datasource or datasources?

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Thumbs up Re: Problem in ReportViewer using remote mode

    Hi Mendhak,

    This line gives error. report.DataSources.Add(strDatasource)

    while i am changing ,

    ReportViewer1.ProcessingMode = ProcessingMode.Local
    Dim report As LocalReport = ReportViewer1.LocalReport

    Local => Remote

    LocalReport =) ServerReport.

    Thanks
    Failing to plan is Planning to fail

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width