ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel - XML Page Breaks (https://www.excelbanter.com/excel-programming/382008-excel-xml-page-breaks.html)

[email protected]

Excel - XML Page Breaks
 
Hello:
I am trying to generate an XML file that will be opened in Excel and
would like the Excel Workbook to print 20 records each on a page. Could
someone please send me a sample code on how to write page break tags in
XML.

Thank you,
Clement


[email protected]

Excel - XML Page Breaks
 
On Jan 26, 11:39 am, "
wrote:
Hello:
I am trying to generate an XML file that will be opened in Excel and
would like the Excel Workbook to print 20 records each on a page. Could
someone please send me a sample code on how to write page break tags in
XML.

Thank you,
Clement


No replies?


Angie Baby

Excel - XML Page Breaks
 
Hi Clement,
Excel requires page breaks to be defined by row number in the <PageBreaks
tag which typically follows the </WorkSheetOptions end tag. Here's an
example that creates page breaks at row 30 and row 60:
..
..
</WorkSheetOptions
<PageBreaks xmlns="urn:schemas-microsoft-com:office:excel"
<RowBreaks
<RowBreak
<Row30</Row
</RowBreak
<RowBreak
<Row60</Row
</RowBreak
</RowBreaks
</PageBreaks
..
..
It would be nice if you could just use the page break tag after writing a
specific row to the file so that you can build page breaks as you go...it
would be a nice enhancement. As far as I know, this example is the only way
that it can be done at this time.

Hope this helps,

Angie

" wrote:

On Jan 26, 11:39 am, "
wrote:
Hello:
I am trying to generate an XML file that will be opened in Excel and
would like the Excel Workbook to print 20 records each on a page. Could
someone please send me a sample code on how to write page break tags in
XML.

Thank you,
Clement


No replies?



Angie Baby[_2_]

Excel - XML Page Breaks
 
Just an additional note on your 20 row requirement...you can save all your
page break rows to an array and then plug in the values with a loop when
you're writing that part of the file.

"Angie Baby" wrote:

Hi Clement,
Excel requires page breaks to be defined by row number in the <PageBreaks
tag which typically follows the </WorkSheetOptions end tag. Here's an
example that creates page breaks at row 30 and row 60:
.
.
</WorkSheetOptions
<PageBreaks xmlns="urn:schemas-microsoft-com:office:excel"
<RowBreaks
<RowBreak
<Row30</Row
</RowBreak
<RowBreak
<Row60</Row
</RowBreak
</RowBreaks
</PageBreaks
.
.
It would be nice if you could just use the page break tag after writing a
specific row to the file so that you can build page breaks as you go...it
would be a nice enhancement. As far as I know, this example is the only way
that it can be done at this time.

Hope this helps,

Angie

" wrote:

On Jan 26, 11:39 am, "
wrote:
Hello:
I am trying to generate an XML file that will be opened in Excel and
would like the Excel Workbook to print 20 records each on a page. Could
someone please send me a sample code on how to write page break tags in
XML.

Thank you,
Clement


No replies?




All times are GMT +1. The time now is 05:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com