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 add title for single exporting

 

The following code example shows how to add the title for exporting in excel, word and pdf documents.

  1. Render the Grid control.

JS

 

 

MVC

 

 

 

 

ASP.NET

 

 

2. In excel exporting, you have to add the title for the exported file by using the ActiveSheet” property of the “IWorkBook” class and then set the Range for the title using “Range” property and then added the title using “Text” property of the Range.

MVC

 

ASP.NET

 

3. For word document you have to add the header using “Header” property of the “HeadersFooters” and append the text to the header using “AppendText” property.

MVC

 

 

 

ASP.NET

 

4. For pdf document we have added header by adding the template using “PdfPageTemplateElement” class and added the title for the template using “DrawString” method.

MVC

ASP.NET

 

The following output is displayed as a result of the above code example.

Figure: how to add the title for exporting

 

C:\Users\farveen.thameeztheen\Desktop\Capture1.PNG

Figure: Word Exporting with Title

 

 

C:\Users\farveen.thameeztheen\Desktop\Capture3.PNG

Figure: Pdf Exporting with Title

 

Figure: Excel Exporting with Title

 

Article ID: Published Date: Last Revised Date: Platform: Control:
6821 05/13/2016 05/13/2016 ASP.NET MVC Grid
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.