Printing using a data reader

csharp United States
  • 17 years ago

    In a PrintPage event I am opening a data reader and reading the records in a while loop.  When I reach the MarginBounds I am setting e.HasMorePages to true followed by a return statement.  When the next page attempts to print and the PrintPage event executes again it runs all of the code within the PrintPage method creating an error condition and does not just continue at the same place in the while loop.  How is the process of printing a large number of records from a database usually handled?


  • 17 years ago

    Could you post the code you are using?

  • 17 years ago

    Thanks for the offer to help James.  Since I posted my request I have switched to using a dataview and variables to keep track of where I am in the printing process and it is now working.  Thanks again.

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“It works on my machine.” - Anonymous