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

Print title must be contiguous

Thread ID:





55793 Feb 5,2007 02:08 PM UTC Feb 6,2007 10:48 AM UTC WinForms 1
Tags: XlsIO
Robert Chapman
Asked On February 5, 2007 02:08 PM UTC

Attached is an xls file I created with the following print options:
m_WorkSheet.PageSetup.PrintArea = A1:F105;
m_WorkSheet.PageSetup.CenterHorizontally = true;
m_WorkSheet.PageSetup.CenterVertically = false;
m_WorkSheet.PageSetup.LeftMargin = 0.2362;
m_WorkSheet.PageSetup.RightMargin= 0.2362;
m_WorkSheet.PageSetup.TopMargin = 0.5118;
m_WorkSheet.PageSetup.BottomMargin = 0.5118;
m_WorkSheet.PageSetup.HeaderMargin = 0.4330;
m_WorkSheet.PageSetup.FooterMargin = 0.4330;

if (m_totalColWidth < C_MAX_COLUMNS_FIT_ONE_PAGE)
m_WorkSheet.PageSetup.FitToPagesWide = 2;
m_WorkSheet.PageSetup.FitToPagesWide = 1;
m_WorkSheet.PageSetup.PrintTitleRows = "$B$7:$F$7";
m_WorkSheet.PageSetup.PrintTitleColumns = "$B$7:$B$105";
m_WorkSheet.PageSetup.FitToPagesWide = 0;
m_WorkSheet.PageSetup.IsFitToPage = false;
m_WorkSheet.PageSetup.FitToPagesTall = 0;

When I select File: Print on the report I receive an excel error that the Print Titles must be contiguous. (try to print the attached file to see error).

So I posted and received some input and the Sample Printtitles project - it works fine.

So I added some code to the sample project to read and set print options on the xls file attached - same thing.
sheet.PageSetup.FitToPagesTall = 0;
sheet.PageSetup.IsFitToPage = false;
sheet.PageSetup.Orientation = ExcelPageOrientation.Portrait;
sheet.PageSetup.PrintTitleRows = "$B$7:$F$7";
sheet.PageSetup.PrintTitleColumns = "$B$7:$B$105";

Can you please provide some guidance to get this to work. I do not need to worry about printing column titles but definately column headers which is row 7 on the attached file.



Melba Winshia [Syncfusion]
Replied On February 6, 2007 10:48 AM UTC

Hi Rob,

If you want to repeat row 7 on each printed page please use the following code snippets.

//Set Print Title Rows. Repeat row 7
sheet.PageSetup.PrintTitleRows = "$A$7:$IV$7";

If you want to repeat column 2 on each printed page please use the following code snippets.

//Print Columns 2
sheet.PageSetup.PrintTitleColumns = "$B$1:B$65536";

Here is the modified sample:


Here is the output file generated:


Please take a look at the sample above and let me know if you have any other questions.



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