Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Thu Jul 11, 2013 1:06 pm

Hi,

Is there a way we can retreive the headers from an Excel file, without having to completely load it into a datatable? (which causes much load time for very big files).

Regards,
Calago

calago
 
Posts: 8
Joined: Thu Oct 20, 2011 9:09 am

Fri Jul 12, 2013 3:05 am

Dear Calago,

Thanks for your inquiry.
Please try the code snippet as below to get headers.
Code: Select all
            // Get text and image in the left header
            string headerLeftText = worksheet.PageSetup.LeftHeader;
            Image headerLeftImage = worksheet.PageSetup.LeftHeaderImage;

            // Get text and image in the center header
            string headerCenterText = worksheet.PageSetup.CenterHeader;
            Image headerCenterImage = worksheet.PageSetup.CenterHeaderImage;
           
            // Get text and image in the right header
            string headerRightText = worksheet.PageSetup.RightHeader;
            Image headerRightImage = worksheet.PageSetup.RightHeaderImage;     

If you have other any problem, please feel free to contact us.

Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Wed Jul 17, 2013 9:57 am

Hello Calago,

Have you tried the code provided by AMY? Has the issue been resolved? Could you please update the thread if convenience?

If there are any questions, welcome to get it back to us.

Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.XLS