Local Table as Datasource for localreport


S

Steve Blain

I have a web page that runs a method to process some data and returns a
datatable if there are errors. I am trying to display the returned table
using a localreport with the reportviewer. How do I set the table to be the
datasource for the report? Usually we use an objectdatasource to call a
method which returns the table. I am assuming there is a way to bypass that
step but I don't see what it is. Thanks for any help.
 
Ad

Advertisements

S

Steve Blain

Here is what I did to solve my problem: (vb.net code)

Dim instance As New ReportDataSource("Sch_Upfree_Errors_DataTable1",
ErrorTable)
Me.ReportViewer1.LocalReport.DataSources.Add(instance)
Me.ReportViewer1.LocalReport.DataSources.Item(0).DataMember = "ErrorTable"

DataTable1 is the only data table defined in the Sch_Upfree_Error Reort
Dataset in the project, ErrorTable is the name of the local table that holds
data to be printed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top