Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1440
Can't keep empty header while exporting to Excel
posted

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

Parents
No Data
Reply
  • 28407
    posted

    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

     

     

     

     

     

Children