A few days ago, an accidental chance was Odetocode.com, I saw a few articles about SQL Reporting Services, which was highly inspired, so I combined with the Reporting Services online series, my confusion is temporarily solved.
.
Rendering the required reports in the .aspx page by direct delivery parameters (rendering reports using the ReportViewer control), accept the required reports in the .aspx page. The main solution is as follows:
1. Open the ReportViewer project with vs.net, the project folder is in the related folder of your installed SQL Reporting Services (see Figure 1).
2. Open the ReportViewer.cs file, write the following method (see Figure 2), then recompile this item.
3. Newly built a report file RDL with parameters, in detail, please refer to my previous article.
4. Create a new .aspx file, refer to compile ReportViewer.dll, drag into this control to the .aspx page (see Figure 3), can directly set the report path and report server path and related properties in the ReportViewer's properties column, or Set in the .aspx.cs Page_Load (see Figure 4).
5. In order to test the transmission parameters, then build an HTM page to add a link, join the parameters to be passed in the connection (see Figure 5).
6. Accept the passed parameters in the .aspx.cs code, and transmit the received parameters to the report, which uses the method in Figure 2 (see Figure 6).
7. After running, you can get reports of your parameters (see Figure 7), there is no query parameter box because the parameters of the ReportViewer property is set to false, which looks better. Summary: The most important place is still in step 2, in fact, we can add other similar methods to achieve the results they want. If you want to pass 2 or 3 values, it is also the same, as long as 2 or 3 parameters are set in the report file. Also add questions about exporting print, in fact, you can set the exported format directly in the .CS code, such as this.reportViewer1.Format = "PDF"; this page will be opened directly with Acrobat. The above is purely used experience, if there is a place, please refer to you, you also welcome everyone to discuss.