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. Image for the cookie policy date
close icon

setting the sheet.PageSetup.PrintTitleRows =

I am creating excel reports and I am trying to set row 7 to repeat on each printed page. From what I can tell the way to do this is

File: PageSetup: Sheet: Rows to repeat at top
the value if set manually via excel is $7:$7

If I set sheet.PageSetup.PrintTitleRows = "$7:$7" in code I receive exception
Message "Value cannot be null.\rParameter name: input" string

StackTrace " at System.Text.RegularExpressions.Regex.Match(String input)\r at Syncfusion.XlsIO.Parser.Biff_Records.Formula.Area3DPtg..ctor(String strFormula, IWorkbook parent)\r at Syncfusion.XlsIO.Implementation.PageSetupImpl.ParsePrintTitleRows(String value)\r at Syncfusion.XlsIO.Implementation.PageSetupImpl.set_PrintTitleRows(String value)\r at prairieFyre.Reporting.Rendering.RenderExcel.FormatPrintArea() in C:\\Working\\CCS\\Source\\prairieFyre\\Reporting\\Rendering\\RenderExcel.cs:line 199\r at prairieFyre.Reporting.Rendering.RenderExcel.BuildSheet() in C:\\Working\\CCS\\Source\\prairieFyre\\Reporting\\Rendering\\RenderExcel.cs:line 184\r at prairieFyre.Reporting.Rendering.RenderExcel.Render(Object report) in C:\\Working\\CCS\\Source\\prairieFyre\\Reporting\\Rendering\\RenderExcel.cs:line 1248" string

I can set it to "B7:07" without exceptions however, when I open the report that gets saved and select File: Print Preview I receive an error
"Print titles must be continquous and complete rows or columns".

I am running XlsIO v4.402.0.51 and I have tried opening the file in both Excel 2007 and Excel 2003 (11.5612.5606) with the same result.

I currently have an item logged against me for this. I was wondering if you could tell me if the Print Title Rows functionality works in the version of xlsio that i have (4.402.0.51) and if not when it will work.

Thanks!

3 Replies

MW Melba Winshia Syncfusion Team January 24, 2007 07:07 AM UTC

Hi Rob,

You can use PrintTitleColumns and PrintTitleRows properties of the PageSetup class to designate row and column headers that you want to have repeated on all pages of your printed worksheet. Please refer the following code snippet that illustrates the above:

[C#]

1) PrintTitleRows:

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

2) PrintTitleColumns:

//Print Columns 1 to 3
sheet.PageSetup.PrintTitleColumns = "$A$1:$C$65536";

[VB.NET]

1) PrintTitleRows:

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

2) PrintTitleColumns:

'Print Columns 1 to 3
sheet.PageSetup.PrintTitleColumns = "$A$1:C$65536"

Please refer the following sample which implements the above said feature:

printtitle.zip

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

Regards,
Melba




RC Robert Chapman January 24, 2007 07:26 PM UTC

Set the value as you indicated
Saved the report
Opened xls via excel
Select File: Print Preview and receive the error that
"PrintTitle must be congiuous and complete rows or columns"

I have attached the report so you can see the error



>Hi Rob,

You can use PrintTitleColumns and PrintTitleRows properties of the PageSetup class to designate row and column headers that you want to have repeated on all pages of your printed worksheet. Please refer the following code snippet that illustrates the above:

[C#]

1) PrintTitleRows:

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

2) PrintTitleColumns:

//Print Columns 1 to 3
sheet.PageSetup.PrintTitleColumns = "$A$1:$C$65536";

[VB.NET]

1) PrintTitleRows:

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

2) PrintTitleColumns:

'Print Columns 1 to 3
sheet.PageSetup.PrintTitleColumns = "$A$1:C$65536"

Please refer the following sample which implements the above said feature:

printtitle.zip

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

Regards,
Melba




Syncfusion.zip


AD Administrator Syncfusion Team January 25, 2007 11:49 AM UTC

Hi Rob,

I was able to reproduce the problem in the xls file given by you. However I created a test sample to reproduce the issue. But I was not able to reproduce the issue. Here is the sample that I used to test this issue.

printtitle.zip

Here is the output file generated:

Sample.xls

Could you please try running this sample and let us know if the same problem exists. If not could you please modify the sample to show the problem so that I can reproduce the issue. This would help us in investigating this issue further.

Best Regards,
Melba

Loader.
Live Chat Icon For mobile
Up arrow icon