By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,194 Members | 1,655 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,194 IT Pros & Developers. It's quick & easy.

VB 2005 - Print FromPage ToPage?

P: n/a
There have been similar questions raised in the past, however no answers
seem to have been provided, so I thought I'd give it a go.

Scenario 1:
My Windows Forms app generates (say) 10 pages in a Print Preview
Control. These pages are made up of varying sized graphics and text,
therefore each page is unique but does rely on the content of the
previous page to determine the final page layout.

My User wants to print ALL pages, pages 1 & 2 or pages 1 to 4. This
isn't a problem as we all know to exit on the last page we just set
"e.HasMorePages" to False.

Now, my User wants to only print pages 4 to 7, but how can this happen?
As I wrote, each page is reliant on the previous page to know what
images or text will run-over to the next.

Scenario 2:
My Windows Forms app opens a file that is dynamically changing every few
seconds because new information is being added by several other Users.
A report is generated with (say again) 10 pages in a Print Preview
Control. My User decides he would like to print pages 6 to 9. Once
again, how can this happen (without initially taking a snap-shot of the
data) as the .Print Method which generated the original data for the
Print Preview Control will re-generate the data when the
PrintDocument.Print Method is called, thus losing the original
information that was being displayed to the User.

What I guess I'm asking is - How can I print selected pages from an
"existing" Print Preview without having to re-generate the pages and
having to write complex algorithms to determine when to start sending
output to the printer?

Maybe the answer is simple and I'm just missing something here!?!?

In earlier versions of VB I have used 3rd party controls which allowed
you to build your Preview pages and then send whichever pages you wanted
to the Printer without having to re-generate each page. Can we do the
same under VB 2005? What happens if my User wants to print pages 2 to 5
and 7 to 9 from the same document? How are others handling these
situations?

I look forward to reading your replies.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
May 14 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.