Page Break for report
-
Hi, I am using VB to grab information from Monarch Pro and output it into a printable format, I have been putting it into a txt file and need a way to input a page break into the output, I am able to use Word if that helps. I can also use other methods of parcing the data, I just need a little push in the right direction, it would be best to put the information into a format that a user could open,print and go.
-
Hi, I am using VB to grab information from Monarch Pro and output it into a printable format, I have been putting it into a txt file and need a way to input a page break into the output, I am able to use Word if that helps. I can also use other methods of parcing the data, I just need a little push in the right direction, it would be best to put the information into a format that a user could open,print and go.
Chris Dykes wrote:
I have been putting it into a txt file and need a way to input a page break into the output,
There is no such thing as a pagebreak in a text file. The closest you're going to get is the FormFeed character (ASCII code 12). Of course, there are other formats you could use besides straight text. But, keep in mind that pagebreaks are a function of the application doing the printing, not of the document. The document needs to convey that there should be a pagebreak at a certain point in the document and signal that by including the appropriate formatting codes in the file. Exactly how to do this depends on the file format chosen and the application printing it.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Chris Dykes wrote:
I have been putting it into a txt file and need a way to input a page break into the output,
There is no such thing as a pagebreak in a text file. The closest you're going to get is the FormFeed character (ASCII code 12). Of course, there are other formats you could use besides straight text. But, keep in mind that pagebreaks are a function of the application doing the printing, not of the document. The document needs to convey that there should be a pagebreak at a certain point in the document and signal that by including the appropriate formatting codes in the file. Exactly how to do this depends on the file format chosen and the application printing it.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007So if I use Word to print the document I would format it to what Word requires for page breaks?
-
So if I use Word to print the document I would format it to what Word requires for page breaks?
You'd more than likely be using Word's object model to build the document, which will probably include a method to insert a pagebreak.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007