Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Absolutely it is.</p> <p>What you are looking for is the ReportViewer control, located in the Microsoft.Reporting.WebForms assembly. It will allow you to place a control right on your web form that will give people an interface for setting report parameters and getting the report.</p> <p>Alternatively you can set all the parameters yourself and output the report in whatever format you need. We use it in our application to output PDF.</p> <p>For instance - this is how we setup a reportviewer object for one of our reports and get the PDF, and then send it back to the user. The particular code block is a web handler.</p> <pre><code>public void ProcessRequest(HttpContext context) { string report = null; int managerId = -1; int planId = -1; GetParametersFromSession(context.Session, out report, out managerId, out planId); if (report == null || managerId == -1 || planId == -1) { return; } CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture; List&lt;ReportParameter&gt; parameters = new List&lt;ReportParameter&gt;(); parameters.Add(new ReportParameter("Prefix", report)); parameters.Add(new ReportParameter("ManagerId", managerId.ToString())); parameters.Add(new ReportParameter("ActionPlanId", planId.ToString())); string language = Thread.CurrentThread.CurrentCulture.Name; language = String.Format("{0}_{1}", language.Substring(0, 2), language.Substring(3, 2).ToLower()); parameters.Add(new ReportParameter("Lang", language)); ReportViewer rv = new ReportViewer(); rv.ProcessingMode = ProcessingMode.Remote; rv.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportServer"]); if (ConfigurationManager.AppSettings["DbYear"] == "2007") { rv.ServerReport.ReportPath = "/ActionPlanning/Plan"; } else { rv.ServerReport.ReportPath = String.Format("/ActionPlanning{0}/Plan", ConfigurationManager.AppSettings["DbYear"]); } rv.ServerReport.SetParameters(parameters); string mimeType = null; string encoding = null; string extension = null; string[] streamIds = null; Warning[] warnings = null; byte[] output = rv.ServerReport.Render("pdf", null, out mimeType, out encoding, out extension, out streamIds, out warnings); context.Response.ContentType = mimeType; context.Response.BinaryWrite(output); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload