BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
private void LoadReport()
{
List<ReportDataSource> rptDatasources = new List<ReportDataSource>();
ReportDataSource rptDatasource1 = new ReportDataSource();
rptDatasource1.Name = "DataSet1";
rptDatasource1.Value = bindstudent();
rptDatasources.Add(rptDatasource1);
ReportDataSource rptDatasource2 = new ReportDataSource();
rptDatasource2.Name = "DataSet2";
rptDatasource2.Value = headerrpt();
rptDatasources.Add(rptDatasource2);
this.ReportViewer1.DataSources = rptDatasources;
this.ReportViewer1.ReportServiceUrl = VirtualPathUtility.ToAbsolute("~/api/RDLCReport");
}
// header report
private List<divisions> headerrpt()
{
List<divisions> division = new List<divisions>();
division.Add(new divisions { year = "2015", date = DateTime.Parse("05/05/2015"), barcodecode = "00007" });
return division;
}
[Serializable]
class divisions
{
public string year;
public DateTime date;
public string barcodecode ;
}
// Details Report
private List<Students> bindstudent()
{
List<Students> stud = new List<Students>();
stud.Add(new Students { name = "basil", studentID = "100001", address = "25,st.charles st" });
stud.Add(new Students { name = "sam", studentID = "10002", address = "33,wellow st" });
stud.Add(new Students { name = "rosee", studentID = "100003", address = "31,Feter st" });
return stud;
}
[Serializable]
class Students
{
public string name;
public string studentID;
public string address;
}
Thanks
Pratheep
How to design header,details, and footer in report |
We can add the header and footer in Report design surface area itself by right clicking the report surface and choose the insert option and select the page header or page footer option. Then we can add the Report Items in page header and footer surface by right clicking the page header and footer surface and choose the insert option and add the Report items.
Please refer to the below MSDN documentation for more detail,
|
barcodecode also need to show at header |
We have generated the barcode using our “Syncfusion.Pdf.Base” assembly with code modules and pass/set the generated barcode base64string to image by using field expression (=Code.Convert("ABCD 12345")).
Code Modules:
Reference to Assemblies and classes.
We have prepared the sample and it can be downloaded from below location,
Sample: http://www.syncfusion.com/downloads/support/directtrac/general/ze/ReportViewerSample-1914587009.zip
Note: In your shared sample, you have not added the WebAPI restful service to process the report. In ReportViewer control, the report is processed in server side using WebAPI controller. So, add the WebAPI restful service and config the WebAPI controller in global.asax file.
Please refer to the below UG documentation link to create the sample in ASP.NET web platform,
You can obtain the ASP.Net ReportViewer samples from the below build installed location,
%userprofile%\AppData\Local\Syncfusion\EssentialStudio\version\Web\Samples\Web
|