Print Title on every page

This is my code:


sheet.PageSetup.PrintTitleColumns = “$A:$G”;
sheet.PageSetup.PrintTitleRows = “$7:$9”;
sheet.PageSetup.SetFooter(1, “Page &P of &N”);


It is not printing the titles. It is printing the footer.

Help!

Hi,


Thanks for your query.

You should evaluate your issue by inserting the rows to repeat and columns to repeat values in Page Setup dialog box of the sheet in Ms Excel manually to see how it goes there. Aspose.Cells follows MS Excel standards and specifications. Also, could you provide your template Excel file, so we could evaluate your issue precisely to figure it out soon.

Thank you.

In response to your email about this; How do I provide the template?

Thanks

How do I send the template?


Did you get the Excel Doc?

Hi,


Thanks for the template file.

What’s wrong with the template file? I have opened your Excel file (probably it is your output file via Aspose.Cells APIs) into Ms Excel manually and checked the PageSetup dialog for the worksheet, I can see the Print title rows and columns values are inserted fine, see the screen shot for your reference:
http://prntscr.com/864b7v

By the way, if you are talking about it does display all the data in a single page when taking the print preview of the sheet, well, since your there is not much data to display where you are using Landscape orientation and you are using all the columns as print titles columns, so you are getting a single page only. If you have more data and more pages with less number of repeated columns and you are using Portrait orientation, then you can see those repeated rows/columns at the top also. If you still have any confusion, please provide your expected file that you may manually create in MS Excel for your data, we will check and help you on how to do it via Aspose.Cells APIs.

Thank you.

How do I send the template?


Did you get the Excel Doc?

I attached aq longer report. This one has 2 pages. I just print it out and it doesn’t print the column headers (titles) on the second page.

I have 6 reports that need to do this. If I find out what is wrong with this one I should be able to fix them all.
Thanks,
Suzanne

I’m not posting correctly.


Here is a new longer report that does not print on the second page.

Thanks,
Suzanne

Hi,


Thanks for the new files.

Well, you have not sent your expected file with your desired Print title rows/columns set, so could you provide us an Excel file which shows your desired results when taking the print preview of the sheet or printing it in Ms Excel manually, so we could help you and suggest you accordingly. By the way, I can see the values for repeat rows/columns are set fine in PageSetup dialog box (you may confirm it by opening the file into Ms Excel and open the PageSetup dialog box to check those values). I am afraid, as you are using long list of columns to be repeated as print title columns (A:G), so this might not be possible to render all the data table to be pasted on each page, this is MS Excel behavior. If I understand you correctly you might want row 6 to be repeated as column headers for each and every page, if this is true, please do not set/use PrintTitleColumns attribute and only use PrintTitleRows in your code as following:
e.g
Sample code:

sheet.PageSetup.PrintTitleRows = “$6:$6”;


Let us know if I can be of any further help.

Thank you.

Thank you for finding my error.


<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;
mso-fareast-font-family:“Times New Roman”;color:#333333;mso-ansi-language:EN-US;
mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>sheet.PageSetup.PrintTitleRows
= “$6:$6”;
<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;
mso-fareast-font-family:“Times New Roman”;color:#333333;mso-ansi-language:EN-US;
mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>
<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;
mso-fareast-font-family:“Times New Roman”;color:#333333;mso-ansi-language:EN-US;
mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>Works!!!
<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;
mso-fareast-font-family:“Times New Roman”;color:#333333;mso-ansi-language:EN-US;
mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>
<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;
mso-fareast-font-family:“Times New Roman”;color:#333333;mso-ansi-language:EN-US;
mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>Thank you

Hi Sue,


It’s good to know that you are up & running again. Please feel free to contact us back in case you need our further assistance with Aspose APIs.