We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Header and document margins

Thread ID:

Created:

Updated:

Platform:

Replies:

91135 Nov 5,2009 10:17 AM UTC Nov 9,2009 06:42 AM UTC ASP.NET Web Forms (Classic) 3
loading
Tags: XlsIO
Alexander
Asked On November 5, 2009 10:17 AM UTC

Hello

I'm creating xls document from a template "template_1.xls" (document with landscape orientation and certain document margins) .
After simple manipulation I save result file as "xlsio-result.xls":

ExcelEngine excelEngine = new ExcelEngine();
IWorkbook excelWorkbook = excelEngine.Excel.Workbooks.Open("d:\\template_1.xls");
IWorksheet excelSheet = excelWorkbook.Worksheets[0];
excelSheet.PageSetup.LeftHeader = "Header after xlsio";
excelWorkbook.SaveAs("d:\\xlsio-result.xls");

As you can see in "xlsio-margins.png" image or comparing "template_1.xls" and "xlsio-result.xls" documents header was changed.
Could you explain how to avoid such changing? I want header margins in result document remain the same as they are in a template. Is it possible?

Thanks Alexander.



xls-margins_66979a9e.zip

Geetha M [Syncfusion]
Replied On November 6, 2009 11:22 AM UTC

Hi Alexander,

Thank you for your interest in Syncfusion products.

Could you please let me know if this file is generated using Excel 2007? This is because, I was able to see the same problem with your input file if opened in Excel 2003. It appears that you made set "Align with page margins" of Header / Footer tab of PageSetup, which is not available in Excel 2003.

preview.png

Please try adjusting left margin which is compatible with Excel 2003.

>Modified Template

Regards,
Geetha

Alexander
Replied On November 6, 2009 03:14 PM UTC

Hello Geetha,

Thank you for your reply. Regarding your question, I did create template document using Excel 2007.
If I understood you right there is no way to alter header margins (left and right) in excel 2003 file format isn't it?

Thanks, Alexander.

Geetha M [Syncfusion]
Replied On November 9, 2009 06:42 AM UTC

Hi Alexander,

If you have not set "Align with page margins", (in PageSetup->Header / Footer) and if you have used Margins to align the Header, then it is possible to get and alter the same result.

Regards,
Geetha

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;