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

Excel Page Setup

Hi,
In excel, in the 'Page Setup' window, you can set up 'Rows to repeat at top' to e.g "$2:$2" to repear the header on each pages.

Please see my attached screen shot.

I try to
//repeat the header
sheet.PageSetup.PrintTitleRows="$2:$2";

"Value cannot be null.\rParameter name: input"

Any idea?

Lan




RepeatTopRow.zip

4 Replies

AD Administrator Syncfusion Team February 28, 2007 06:25 PM UTC

Try to do the same operation in MS Excel and see what result will be returned by property that you were trying to set.


MW Melba Winshia Syncfusion Team March 1, 2007 09:50 AM UTC

Hi Lan,

You can use PrintTitleRows and PrintTitleColumns 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#]

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

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

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

PrintTitleRows.zip

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

Regards,
Melba


AD Administrator Syncfusion Team March 5, 2007 06:07 PM UTC

Hi Meliba,
Thanks for the sample. It is what I want.

Lan


MW Melba Winshia Syncfusion Team March 8, 2007 12:12 PM UTC

Hi Lan,

Thanks for the update!

Kindly let me know if you have any other questions.

Regards,
Melba

Loader.
Live Chat Icon For mobile
Up arrow icon