Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27186

VS 2010 Print multiple line multiple category Document

$
0
0
I have searched this forum for help on a printing issue that I have. There are lots of printing issues threads but I don't seem to be able to find any that address my particular problem.

I am trying to create a delivery schedule printout based on data from a MySQL database table.

Here is a typical situation:

Print the report header which includes the date range for the report.

Start by sorting data by date then by the delivery location then by the items to be delivered.

After printing the header I start by printing the date
I follow that by the delivery location
And finally by the items to be delivered.

I can reach the bottom of the page at any point in the process and when there are more items to print I set
hasmorepages to true which then starts the new page but when I start printing the next page how do I tell the program that I am on the third date in the range and on the fifth delivery location and the 15th item for that delivery to that location on that date?

What complicates it even more is that as I go through the original record set I get a delivery date then I get a location code which I then have to look up in a second table and finally I get the item numbers and I have to look up the description in a third table.

I currently solve this problem by setting variables that hold the for next values (IE: For x = WhereIWas to record count) as well a variable that holds the name of a goto label that indicates what for next loop I was in when I hit the end of the page and then when I re-enter the routine I use a select case to goto that location.

This is VERY clumsy and I'm sure it has to be the sloppiest code in the world so if anyone can point me in the direction of how to do this correctly I would really appreciate it.

Richard

Viewing all articles
Browse latest Browse all 27186

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>