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.

Print title must be contiguous

Thread ID:

Created:

Updated:

Platform:

Replies:

55793 Feb 5,2007 09:08 AM Feb 6,2007 05:48 AM Windows Forms 1
loading
Tags: XlsIO
Robert Chapman
Asked On February 5, 2007 09:08 AM

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";
}
else
{
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.

Thanks!


sample103.zip

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

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:

printtitle.zip

Here is the output file generated:

Sample.xls

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

Regards,
Melba

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.

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.

;