This is a migrated thread and some comments may be shown as answers.

Fit exported excel file to one page horizontally

1 Answer 127 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kavita
Top achievements
Rank 1
Kavita asked on 25 Sep 2013, 01:09 PM
Hello telerik,
I have used Radgrid Export To Excel with format='ExcelML'.
I want exported excel sheet to fit all columns of grid into single page horizontally so that I can print it directly.
How can I achieve this?

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 30 Sep 2013, 08:40 AM
Hi Kavita,

Thank you for contacting us.

In order to fit all columns into a single page when printing you have to set WorksheetOptionsElement's FitToPage to true. Check out the following code snippet:
protected void RadGrid1_ExcelMLWorkBookCreated(object sender, Telerik.Web.UI.GridExcelBuilder.GridExcelMLWorkBookCreatedEventArgs e)
{
    e.WorkBook.Worksheets[0].WorksheetOptions.FitToPage = true;
}

I hope this information helps.

Regards,
Kostadin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
General Discussions
Asked by
Kavita
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or