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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

IPageSetup versus direct access

Thread ID:





72977 Apr 14,2008 06:09 PM UTC Apr 24,2008 07:35 AM UTC WinForms 1
Tags: XlsIO
Asked On April 14, 2008 06:09 PM UTC


I am working on performance of my component.

I noticed that in your examples you do things like:
IPageSetup pageSetup = ( IPageSetup )sheet.PageSetup;
pageSetup.LeftHeaderImage = bmp;
pageSetup.LeftHeader = "&G";

I was wondering if this convention is more or less performant than access the properties directly ..
sheet.PageSetup.LeftHeaderImage = bmp;

I have also noticed this done for IStyle. My problem is that each cell could be different so to set a default column style doesnt really work for me.

Also, could you explain what a IMigrantRange is and when it might be used?


Yavanaarasi G [Syncfusion]
Replied On April 24, 2008 07:35 AM UTC

Hi Kelley,

Sorry for the delay in responding.

1.more or less performant:

Generally if you create object it takes more time, direct access is better performance. But both the codes are same.

2.Default column style doesn't work:

I am not able to reproduce the issue that you mentioned here. I have created a simple sample and tested this issue in the following environment winxp with servicepack2, office 2003, v6.2.0.40, .Net Framework 2.0. But here it works fine.

Here is the code snippet:

IStyle columnStyle = workbook.Styles.Add("ColStyle");
columnStyle.ColorIndex = ExcelKnownColors.Blue;
//Set the Tempate Default Style[ Select All + Changing Formatting in MS Excel]
IStyle columnStyle1 = workbook.Styles.Add("ColStyle1");
columnStyle1.ColorIndex = ExcelKnownColors.Red;
//Set the Tempate Default Style[ Select All + Changing Formatting in MS Excel]
sheet.SetDefaultColumnStyle(3, columnStyle1);

Please refer the sample in the below link which illustrates the above:

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample and send us the modified sample so that we could sort out the cause of the issue and provide you a solution?

Please provide the system details and the office version in which the issue caused.

3.what a IMigrantRange is and when it might be used?:

"IMigrantRange" is an optimal way for writing simple strings and strings with styles, which improves the performance.

Here is the code snippet:

IMigrantRange migrantRange = sheet.MigrantRange;
migrantRange.Value = "INVENTORY REPORT";
migrantRange.CellStyle.Font.Bold= true;

Also please refer our shipped browser sample to know about migrantRange:


Please let me know if you have any other concerns.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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