How do you use ReportViewer to display a Reporting Services report?

S

S_K

Hi and thanks in advance for your help.

I have a Reporting Services report that I need to display in an
ASP.NET web page using the ReportViewer. However I can't link the
Reporting Services report (.rdl) to the ReportViewer! I have the
ReportViewer.LocalReport.ReportPath set to the path of the .rdl report
but the report still dosen't display.

Can somebody help me on this?

Thanks

Steve
 
D

David Wier

I may miss some steps here, but I'll come as close as I can, from the top of
my head.
It's not as simple as just copying the files -
First - you need to rename the .rdl file to .rdlc
You'll need to create the datasets in your ASP.Net application also
Also - if you're using parameters, you will need to create the controls in
the page, separately, and then use an event of some sort (button, etc) to
trigger running the report

I just copied some code here:
(this is for use with 2 date text parameters - you'll need to make the
reportviewer invisible at the start, then, when executing the code:)
Dim dsSource As ReportDataSource = New
ReportDataSource("DataSetName_DataTableName", MethodName(txtStartDate.Text,
txtEndDate.Text))

rpt.Visible = True
rpt.LocalReport.DataSources.Clear()
rpt.LocalReport.DataSources.Add(dsSource)
rpt.LocalReport.Refresh()

This is fairly close - you'll need to change it up a little for your own
needs, but as you can see, it's not just a drop and use type of situation.
Hopefully this will give you a start

David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
 
S

S_K

Follow-up:
In the previous scenario, when using the smart tag, you would choose 'NONE'
when choosing datasources, but you can choose the .rdlc file

David Wierhttp://aspnet101.comhttp://iWritePro.com- One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup








- Show quoted text -

Thanks that looks like it will work!
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top