Groups | Blog | Home
all groups > sql server reporting services > december 2005 >

sql server reporting services : ReportViewer Help



Paula
12/1/2005 12:11:44 PM
I use the following code to display a report in the ReportViewer. The report
and the shared datasource are in another .NET solution. The report displays,
but the data does not. Can anyone help me figure out how to make the
report data display?

private DataTable LoadReportData()
{

DataSet ds = new DataSet();
ds.ReadXml("C:\\Reports\\ReportsSharedDataSource.rds");
return ds.Tables[1];
}

protected void Page_Load(object sender, EventArgs e)
{
this.ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.
ProcessingMode.Local;
this.ReportViewer1.LocalReport.ReportPath =
"C:\\Reports\\ActivitySummaryReport.rdl";
this.ReportViewer1.LocalReport.DataSources.Add(new Microsoft.
Reporting.WebForms.ReportDataSource("ReportsSharedDataSource",
LoadReportData()));
this.ReportViewer1.LocalReport.EnableExternalImages = true;
}

Thanks,

Teo Lachev [MVP]
12/1/2005 9:58:36 PM
Assuming that Tables[1] actually returns data and your report bindings are
correct, try:

reportViewer1.RefreshReport()

--
HTH,
----------------------------------------------
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/

-------------------------------------------------
[quoted text, click to view]

Pedro
12/4/2005 12:40:46 AM
How many tables do you have in your dataset?
Remeber that tables are 0 indexed, so if you had only one table in your
dataset you would want to return Tables[0].

[quoted text, click to view]

AddThis Social Bookmark Button