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

[Solved] RadGrid export ExcelML and Pdf

1 Answer 83 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Osismii
Top achievements
Rank 1
Osismii asked on 08 Aug 2013, 03:48 PM
Hello everyone and thanks for the responses already (:


My problems are the following:
I have a RadGrid that contains child grid, and is working perfectly, however, at the export to ExcelML I need to add a header, I use for this purpose the ExcelMLExportRowCreated checking only if it is a HeaderRow, however, and since I also have child grids, so there are multiple HeaderRows adding the header multiple times. Is there any way to check if it's masterTable or not?

In addition to this I also have a problem in formatting the child grids to pdf. To apply the style that is currently on the grid used I set  UseItemStyles = true however only works properly in the master. Is there any way to use the style applied in child grids also in the export?

Thank you

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 13 Aug 2013, 08:20 AM
Hello Osismii,

Thank you for contact us.

I am afraid there isn't a way to check whether the current header row is a master table or detail table. Nevertheless since the master table's header row is the first one you could use flag to distinguish the header rows. Check out the following code snippet.
bool isFirstHeader = true;
protected void RadGrid1_ExcelMLExportRowCreated(object sender, Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLRowCreatedArgs e)
{
    if (e.RowType == GridExportExcelMLRowType.HeaderRow && isFirstHeader)
    {
       //your code here
        isFirstHeader = false;
    }
}

As to your second question this is a known bug and our developers will give their best to fix it in a near future. Meanwhile you could use the approach described in the PDF help article under Appearance section.

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
Grid
Asked by
Osismii
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or