Hi,
I have some fields that the label is empty. When I export the XamDataPresenter to Excel using DataPresenterExcelExporter, the header becomes the name of the Field, instead of keeping it empty. Is there any way to avoid this?
I have checked the HeaderLabelExporting event, but the Label in the field object becomes the same as the name, looks weird.
Regards,
Jason
Hi mailtochungg,
Wire up the DataPresenterExcelExporter's HeaderLabelExporting Event
void exporter_HeaderLabelExporting(object sender, HeaderLabelExportingEventArgs e) { //throw new NotImplementedException(); if (e.Field.Name == "EmployeeID") { e.Label = string.Empty; } }
Sincerely, Matt Developer Support Engineer
Hi Matt, this will work but I have to know which label is empty in advance. The layout definition in my project is saved to database and it can be changed anytime. i am looking for a more generic solution.
HI,
Use this code snippet
void exporter_HeaderLabelExporting(object sender, HeaderLabelExportingEventArgs e) { if (e.Field.Label.ToString() == string.Empty) { e.Label = string.Empty; } }
HI ,
I was unable to reproduce this issue in builds 11.2.1012 and 11.2.2076.
Can you tell me what build you are using?
Hi Matt, I am using 10.3.20103.2164. The Header is not empty in the HeaderLabelExporting event. I can see that this is fixed in 11.2.2076. Thanks.