dcsimg
Results 1 to 7 of 7

Thread: Error occurred during local processing

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Posts
    669

    Error occurred during local processing

    Hi

    I have below code but i am getting error - Error occurred during local processing The report definition for report
    d:\rpt1.rdlc has not been specified. Object reference not set to an instance of the Object.

    RptViewer.ProcessingMode = ProcessingMode.Local
    RptViewer.LocalReport.DataSources.Clear()
    RptViewer.LocalReport.DataSources.Add(New ReportDataSource("DataSet1", ds.Tables(0)))
    RptViewer.LocalReport.ReportEmbeddedResource = "C:\\rpt1.rdlc"
    RptViewer.RefreshReport()


    Thanks

  2. #2
    Frenzied Member
    Join Date
    Dec 2014
    Location
    VB6 dinosaur land
    Posts
    1,177

    Re: Error occurred during local processing

    Try this
    Code:
    RptViewer.ProcessingMode = ProcessingMode.Local
    RptViewer.LocalReport.ReportPath = "C:\\rpt1.rdlc"
    RptViewer.LocalReport.DataSources.Clear()
    RptViewer.LocalReport.DataSources.Add(New ReportDataSource("DataSet1", ds.Tables(0)))
    RptViewer.RefreshReport()

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Posts
    669

    Re: Error occurred during local processing

    Hi

    Now i am getting this error - The tablix ‘Tablix1’ is in the report body but the report has no dataset. Data regions are not allowed in reports without datasets. I have simple report added . I have not created any Dataset , Since i am creating programmatically . How i can bind this to report

    Thanks

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    102,947

    Re: Error occurred during local processing

    I'm not sure whether it is a problem or not but you shouldn't be using double slashes in a file path in VB. That's a C# thing, where a slash needs to be escaped because it is itself the escape character. There is no escape character in VB string literals.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Posts
    669

    Re: Error occurred during local processing

    Hi

    Now i am getting this error - The tablix ‘Tablix1’ is in the report body but the report has no dataset. Data regions are not allowed in reports without datasets. I have simple report added . I have not created any Dataset , Since i am creating programmatically . How i can bind this to report


    con = New SqlConnection(ConfigurationManager.ConnectionStrings("Cnn0").ConnectionString)
    con.Open()

    Dim ad As SqlDataAdapter = New SqlDataAdapter()
    ad.SelectCommand = New SqlCommand("SELECT * FROM tmp1", con)
    Dim ds As DataSet = New DataSet("ds")
    ad.Fill(ds)

    RptViewer.ProcessingMode = ProcessingMode.Local
    RptViewer.LocalReport.ReportPath = "c:\rpt1.rdlc"
    RptViewer.LocalReport.DataSources.Clear()

    RptViewer.LocalReport.DataSources.Add(New ReportDataSource("DataSet1", ds.Tables(0)))

    RptViewer.RefreshReport()

    Thanks

  6. #6
    Frenzied Member schoemr's Avatar
    Join Date
    Apr 2016
    Location
    South Africa
    Posts
    1,118

    Re: Error occurred during local processing

    Hi, unfortunately you must assign a dataset to a tablix. It cannot be done in any other way. So just create a "fake" dataset that only returns one field with no data. Then set the fake dataset as the dataset for the tablix.
    Don't miss the whole point of the dance...

    https://www.youtube.com/watch?v=qHnIJeE3LAI

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Posts
    669

    Re: Error occurred during local processing

    Hi

    Wht i understood is that Dataset is a must . Programmatically we cannot create and then bind.
    Thanks

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width