This company has not been in touch for a long time. It has never been used before. First, it reviews the workflow engine and various email and text messages, and then deploys a Reporting Server.
Reporting Service deployment is not mentioned here. In vs2010, you can directly add a reporting report.
This is a blank template. When the Template already exists, the data will be poor. A new dataset will be added to the template.
When the dataset has a template, return to the reporting template page and design the format on it. Right-click in the blank space and choose insert-table (or other charts) to select a data source.
In this case, the report template is the same as the Web Control to set fields.
The template setting is complete. Then write the corresponding HTML for loading the page aspx as follows:
<Rsweb: reportviewer id = "rvreport" runat = "server" font-names = "verdana" font-size = "8pt" waitmessagefont-size = "14pt" interactivedeviceinfos = "(SET) "waitmessagefont-names =" verdana "width =" 100% "Height =" 90% "> <localreport reportpath =" reportfiles \ repaircountreport. rdlc "> <datasources> <rsweb: reportdatasource performanceid =" objectperformance1 "name =" dataset1 "/> </datasources> </localreport> </rsweb: reportviewer> <asp: objectdatasource id = "objectdatasource1" runat = "server"> </ASP: objectdatasource>
The following code loads data in the CS file:
Private void initdatagrid () {string betweenbegin = betweenbegin. value; string betweenend = betweenend. value; If (string. isnullorwhitespace (betweenbegin) | string. isnullorwhitespace (betweenend) {prompthelper. showmessagejbox ("tip", "Enter the query interval", this); Return ;}// by default, it is selected, that is, the petrol station name is selected as the group string groupbyvalue = ""; if (ckouname. checked) {groupbyvalue = "1";} else {groupbyvalue = radiobuttonlist1.selectedva Lue;} sqlwhere = "and (t1.actualfinishdate between '" + betweenbegin + "' and '" + betweenend + "')"; string ouname = ouname. value; If (! String. isnullorwhitespace (ouname) & ouname! = "Petrol station name") {sqlwhere + = "and t3.ouname like '%" + ouname + "%'" ;}// obtain data first sqlhelper helper = new sqlhelper (); sqlparameter [] par = new sqlparameter [] {New sqlparameter ("@ sqlwhere", sqldbtype. varchar, 1000), new sqlparameter ("@ groupby", sqldbtype. varchar, 2)}; par [0]. value = sqlwhere; par [1]. value = groupbyvalue; dataset dataset1 = helper. executedataset (commandtype. storedprocedure, "proc_repaircountreport", par); this. rvreport. visible = true; this. rvreport. localreport. datasources. clear (); objectperformance1.selectparameters. clear (); objectperformance1.selectparameters. add ("sqlwhere", sqlwhere); this. rvreport. localreport. datasources. add (New reportdatasource ("dataset1", dataset1.tables [0]); this. rvreport. localreport. refresh ();}
Even if the entire report has been completed, let's see the results.