SharkBait
New member
- Joined
- Mar 7, 2005
- Messages
- 4
Hello,
Ive gone though 3 pages of search about printing in .net here in the forums and I and I am not too much further along.
Ive used an example of code in my Begining VB.Net book and am I able to use the SteamReader to print out a text file that has been manually created.
What I am trying to print consists of a header (with text and graphics), a main body which would be information that is within a msFlexGrid and then a footer with more text.
Its a sales program really. So a Bill To: Ship To: as the header (billto being left justified and shiptp being center justified), the body has the items, qtys, prices, extended prices, and then tallied up at the bottom of it (right justified for extended and total), and then some shipping info and terms as the footer.
In the PrinterDocument_PrintPage() function, the posts I have read use things like:
Which I assume when I get to the FlexGrid I would loop through it and insert the items in the line argument. But if I have 5 items in a line that have to be formatted, can this be done? Or do I have to set up differnet formats of the DrawString function with the positions I want them set to and then cycle through the grid?
I am just lost when it comes to the printing. It seems to have a really high learning curve to it but once you get it, then its easy?!?
This is the only thing holding me back from finalizing my re-code project from going from VB6 to VB.Net
Thank you for any information, etc. This seems to be over my head but I really want to figure this out.
Cheers,
Ive gone though 3 pages of search about printing in .net here in the forums and I and I am not too much further along.
Ive used an example of code in my Begining VB.Net book and am I able to use the SteamReader to print out a text file that has been manually created.
What I am trying to print consists of a header (with text and graphics), a main body which would be information that is within a msFlexGrid and then a footer with more text.
Its a sales program really. So a Bill To: Ship To: as the header (billto being left justified and shiptp being center justified), the body has the items, qtys, prices, extended prices, and then tallied up at the bottom of it (right justified for extended and total), and then some shipping info and terms as the footer.
In the PrinterDocument_PrintPage() function, the posts I have read use things like:
Code:
e.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, yPos, New StringFormat())
Which I assume when I get to the FlexGrid I would loop through it and insert the items in the line argument. But if I have 5 items in a line that have to be formatted, can this be done? Or do I have to set up differnet formats of the DrawString function with the positions I want them set to and then cycle through the grid?
I am just lost when it comes to the printing. It seems to have a really high learning curve to it but once you get it, then its easy?!?
This is the only thing holding me back from finalizing my re-code project from going from VB6 to VB.Net
Thank you for any information, etc. This seems to be over my head but I really want to figure this out.
Cheers,