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

Excel ML Export Styling

3 Answers 98 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mihai Dinculescu
Top achievements
Rank 1
Mihai Dinculescu asked on 05 Nov 2011, 03:17 PM
Hello

I've been able to set some properties like header, footer, margins, orientation, etc but I got stuck on others:
- header/footer right alignment
- PaperSize property
- PrintHeadings property
- Zoom property
- set scaling to "fit all columns on one page".

Any help will be greatly appreciated.

3 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 10 Nov 2011, 12:17 PM
Hello Mihai,

Straight onto your questions:

- header/footer right alignment
var wopt = a.WorkBook.Worksheets[0].WorksheetOptions;
wopt.PageSetup.PageHeaderElement.Data = "&R TEST";

- PaperSize property

The is no paper size property at this point. It may be added in a future release of RadControls for ASP.NET AJAX.

- PrintHeadings property

I'm not sure what this property is supposed to do. Please be more descriptive of your requirements.

- Zoom property
Not available in the current implementation. Will be added in a future version.

- set scaling to "fit all columns on one page".
Not available out of the box. You can set it manually this way:
RadGrid1.GridExporting += (s, a) =>           
{
    a.ExportOutput = a.ExportOutput.Replace("</WorksheetOptions>", "<FitToPage/></WorksheetOptions>");
};

Regards,
Daniel
the Telerik team
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 their blog feed now
0
Mihai Dinculescu
Top achievements
Rank 1
answered on 10 Nov 2011, 12:56 PM
Thank you Daniel for the answers.

<FitToPage/> makes Excel fit the whole sheet on 1 page, while I only need It only to fit the columns. It looks like the "fit all columns on one page" requires the zoom to be calculated when the file is generated. It would be nice if you guys implement something that does this in the future. I imagine that fitting columns on 1 page is quite a used setting in Excel.

I'm not sure what PrintHeadings does either. I've taken it from a Macro which I had to replicate. Doesn't seem important so forget about it :)

It would be nice to have the PageSize property implemented in the future versions.
0
Daniel
Telerik team
answered on 11 Nov 2011, 07:17 PM
Hello Mihai,

I have some good news for you. Most of these features will be available for the upcoming release of RadControls for ASP.NET AJAX which is expected in the next week.
I've also updated your Telerik points as a sign of gratitude for the suggestion.

Regards,
Daniel
the Telerik team
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 their blog feed now
Tags
Grid
Asked by
Mihai Dinculescu
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Mihai Dinculescu
Top achievements
Rank 1
Share this question
or