Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More SSRS Woes
Message
General information
Forum:
Microsoft SQL Server
Category:
Reporting Services
Title:
Miscellaneous
Thread ID:
01507135
Message ID:
01507202
Views:
51
>I'm trying to display an SSRS report in a ReportViewer control in a WinForms application. Here's the Form_Load...
>
>
>private void Form1_Load(object sender, EventArgs e)
>{
>    reportViewer1.ServerReport.ReportServerUrl = new Uri("http://192.168.2.5/reportserver");
>    reportViewer1.ServerReport.ReportServerCredentials.NetworkCredentials = CredentialCache.DefaultCredentials;
>
>    string reportFile = @"C:\Report Project1\Report1.rdl";
>    reportViewer1.ServerReport.ReportPath = reportFile;
>    reportViewer1.ProcessingMode = ProcessingMode.Remote;
>
>    reportViewer1.ServerReport.DisplayName = "Corporate View Report";
>
>    ReportParameter[] parameters = new ReportParameter[3];
>    parameters[0] = new ReportParameter("@ProjectId", "6");
>    parameters[1] = new ReportParameter("@PrimaryWhseId", "8293");
>    parameters[2] = new ReportParameter("@SecondaryWhseId", "8290");
>    reportViewer1.ServerReport.SetParameters(parameters);
>
>    try
>    {
>        reportViewer1.RefreshReport();
>    }
>    catch(Exception ex)
>    {
>        throw ex;
>    }
>}
>
>
>With the reportViewer1.ServerReport.SetParameters(parameters); line uncommented, at this point the form pops ups, the repot is blank, and nothing else happens after that.
>
>If I comment out the parameters and run it the form runs and in the viewer control I get "The request failed with HTTP status 401: Unauthorized".
>
>I can't find any examples of displaying a SSRS report in a WinForms application.
>
>I could really use some help here.

I don't see your using statements so I'm not sure if you are pointing to the right namespaces or not.

ReportViewer1.ServerReport.ReportServerCredentials.NetworkCredentials = System.Net.CredentialCache.DefaultCredentials;
and
ReportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote;

A few others are confusing to me too. Anyway, follow this thread:

http://social.msdn.microsoft.com/Forums/en/sqlreportingservices/thread/4d043d20-c9a0-4a6a-a24f-f7d36ff46fa4

Is anonymous access for Report Services enabled or disabled? Check the different solutions (the fix depends on your network - is it a domain?)

Curious, why did you decide to start off with remote? Did you already do some local reports successfully?
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform