I have the next case i am using a gridView and i want export a Excel the content the gridView but with exception of any columns. its is possible.. for example i have a GridView with 7 columns and i need export a excel..but only five column of the grid its possible?
public
void Export(String sFilepath, RadGridView grvExportExcel)
{
try
{
ExportToExcelML exporter = new ExportToExcelML(grvExportExcel);
exporter.SummariesExportOption =
SummariesOption.ExportAll;
exporter.RunExport(sFilepath);
}
catch (Exception)
{
throw;
}
}
Thanks for your help.
Best wish
Elver Cano
10 Answers, 1 is accepted
you can set the DoNotExport Option for hiden Columns:
exporter.HiddenColumnOption = HiddenOption.DoNotExport
If you set the IsVisible property of the not required columns in the grid to false it should remove them from the export. You can make them visible again after exporting.
Best regards,
Bernd
Bernd is right. The way to exclude columns from an exported RadGridView is to set their IsVisible property to false and use the DonNotExport option for hidden columns in the export method:
this
.radGridView1.SuspendLayout();
this
.radGridView1.Columns[0].IsVisible =
false
;
ExportToExcelML exporter =
new
ExportToExcelML(
this
.radGridView1);
exporter.HiddenColumnOption = HiddenOption.DoNotExport;
exporter.RunExport(
"c:\\export.xls"
);
this
.radGridView1.Columns[0].IsVisible =
true
;
this
.radGridView1.ResumeLayout(
false
);
All the best,
Martin Vasilev
the Telerik team
Can I provide the Excel worksheet's name ?
Can I merge two radgrids into 1 excel sheet, preferably into two separate worksheets ?
Can I add in rows such as legend into the spreadsheet to accompany the data ?
Alex
Thank you for contacting us.
This thread covers only the RadGridView for WinForms control. Please open a new support thread in appropriate ASP.Net section. This will allow those ASP.NET users who are interested in the same topic to find the answer more easily.
All the best,
Martin Vasilev
the Telerik team
can this be done ?
thank you
Thank you for writing.
We do not support the described feature. We will implement it in a future release if we have more
customers request the same.
Let me know if you have any other questions.
Greetings,
Martin Vasilev
the Telerik team
Dear team,
We are working on ERP and we are finding best tool for our reporting. after research we found Telerik after some requirement full fill after we stuck in export excel sheet. we want all grid to export in single excel file we have tested in PDF there has option for merge but there not good view in PDF because page size fixed. we want in excel please suggest what we can do so that we can continue and final with telerik other wise we have to find another solution. we had checked many user has same requirement from many year ago and hopefully your team do good work for this feature.
Best Regards
Ashish
Hi Ashish,
This is now supported and you can export each grid in a separate sheet. You can use the new exporter and set the FileExportMode property. Detailed information is available here: Export to Excel.
I hope this helps.
Regards,
Dimitar
Progress Telerik
Hello Dimitar,
Thanks for reply. we want to export all grid in single sheet how we can do.
Hello Elver,
This can be achieved by using the SpreadProcessing library. This would require to manually iterate the grids and add the data to the document. There is an example of this in our Demo application (see attached).
Please let me know if there is something else I can help you with.
Regards,
Dimitar
Progress Telerik