what all is required in the method calls to load an rdl into asp.net project via c#

Evannatibq

New Member
I am trying to figure out the steps to call/load a rdl file into an existing asp.net application. I have the rdl files uploaded to an ssrs server and I am developing a custom ui that utilizes the ssrs endpoint (sql2008r2) for the retrieval and filtering of the reports. Where I am looking for some guidance is on what exactly needs to be provided to the report for loading it? Initally I started out with trying to use local processing but based upon what I have read as well as the environmental requirements I need to use report processing for generating the reports.In the aspx file I have added the report viewer:\[code\]<asp:UpdatePanel ID="ReportViewPanel" runat="server" UpdateMode="Conditional"> <ContentTemplate> <rsweb:ReportViewer ID="MyReportViewer" runat="server"> </rsweb:ReportViewer> </ContentTemplate></asp:UpdatePanel>\[/code\]And in the code behind once a link is clicked I try to load the report as follows:\[code\]//code that creates the report link buttons based on what is returned from endpoint protected void RenderReportLinks(System.Web.UI.WebControls.Panel p, List<ReportItems> items){ p.Controls.Add(new LiteralControl("<ul class='HorizontalList'>")); foreach (var r in items) { p.Controls.Add(new LiteralControl("<li>")); LinkButton lb = new LinkButton(); lb.Text = FormatReportNames(r.Name); lb.ToolTip = GenerateReportDescription(r); lb.CommandArgument = r.Path; //path on ssrs server /<servername>/folder/reportname lb.Click += new EventHandler(ReportLink_Click); p.Controls.Add(lb); p.Controls.Add(new LiteralControl("</li>")); } p.Controls.Add(new LiteralControl("</ul>"));}void ReportLink_Click(object sender, EventArgs e){ LinkButton rpt = (LinkButton)sender; MyReportViewer.LocalReport.ReportPath = rpt.CommandArgument + ".rdl"; ReportViewPanel.Update();}\[/code\]Currently when I run this the control does not render or display anything on the page.I know I need to use ServerReport instead of LocalReport but what I am unclear on is what all needs to be a part of the method to retrieve and render the report. Is the datasource part of the rdl definition or do I need to reference/load that as well? (No I did not create the reports I have just been tasked with loading them). The SSRS server is on a different server than the web client, is there anything I need to consider for this? And finally each report has parameters do I have to pass these in or can the user be prompted?When loading a report via code is the action to collect all the parameters first (login, report params, datasource) and then pass it to the report as an object that returns to the viewer a report with results. Or can it be parital where the report is loaded (blank) and then the user interacts with it similar as to if the user clicked on the report title from the report management page?I would really appreciate any suggestions or referencesThanks in advance-cheers
 
Back
Top