The report should now be displayed in your page and feature full interactivity. If it is not included, the report renders as an interactive Crystal Report object. Directly load your report: If the “mode=pdf” parameter is included, the report renders as an embedded PDF document. This example uses the ReportDocument component because it is the easiest of the choices. Create a Crystal Report using the appropriate tools (Crystal Report Designer) and save it in the /Content/Reports path of the web application.Ĩ. The viewer control has many ways to preview reports. Create a Controller (CrystalReportingController) containing a method (named "Report") that returns a PageView object referencing the above RazorView, along with any parameters passed in the GET query string through the "Your_Model_Class" model object.ħ. Create a Razor View containing a loop that delegates any GET parameters passed in the Controller call (refer to step #6 below) and an that points to the aforementioned ASPX _Parameters = "" įoreach (KeyValuePair kvp in ) _ReportDocument.SetParameterValue(kvp.Key, kvp.Value) ĥ. _ReportDocument.SetDatabaseLogon(_UserID, _Password) ĬrystalReportViewer1.ReportSource = _ReportDocument įoreach (KeyValuePair kvp in _ReportParameters) If (!string.IsNullOrEmpty(_UserID) & _Password != null) ReportDocument _ReportDocument = new ReportDocument() ĭictionary _ReportParameters = new Dictionary() The core of this page's code-behind is as follows: Create an ASPX page containing a CrystalReportViewer control.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |