We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to design header/details/Footer in report

Thread ID:

Created:

Updated:

Platform:

Replies:

126960 Oct 18,2016 03:06 PM Oct 20,2016 08:39 AM ASP.NET Web Forms 1
loading
Tags: ReportViewer
Pratheep
Asked On October 18, 2016 03:06 PM

Hi

How to design header,details, and footer in report and barcodecode also need to show at header

   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



Attachment: report_d0ed0766.rar

Yuvaraj Devarajan [Syncfusion]
Replied On October 20, 2016 08:39 AM

Hi Pratheep, 
 
Thanks for contacting Syncfusion support. 

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, 
 
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   


Regards, 
Yuvaraj D. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;