×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

PRINTER PROMPT

PRINTER PROMPT

PRINTER PROMPT

(OP)
Good afternoon people

With the below method of printing a report, is there a way to set the total pages in the print diaglog

CODE

REPORT FORM (lcReport) NOCONSOLE TO PRINTER PROMPT 

RE: PRINTER PROMPT

Do you mean "Set" or "see"? Have you checked in Help, you have this clause: "[RANGE nStartPage [, nEndPage]]"

If you need more help, please specify VFP version. And be more specific about what you want.

RE: PRINTER PROMPT

I think of a recent case where I only needed one page of a contract for signing. This has nothing to do with VFP, I printed a PDF page from a PDF viewer.
The only way I knew the page is because I can see the PDF document before even starting to print or preview it.

In that sense, the option to pick pages from a preview and only print selected pages isn't a norm. It only seems so if you see viewing a document or PDF as preview.
Preview is the preview of what will be printed and you can overall cancel it overall or not.

Nevertheless, I'm not sure what the VFPX foxy previewer print toolbar offers. I know you can choose to redirect output to an Excel sheet from preview, this works with a reportlistener and the print pass of its rendering methods. As you can do such a redirect I'm quite sure that rendering method could also simply skip pages and only print some.

But the classic way is specifying pages or number of copies (if you meant that) before going to print.

And since a report is data and not document driven and you only know how the data spans pages with a rendered preview, the usual way is to preview the report, remember page numbers you want, cancel, specify page numbers and go back to print, perhaps that time without preview.

If your report is composed of certain groups of data it would be easier to make the choice on the level of data and not based on pages.

Bye, Olaf.


Olaf Doschke Software Engineering
https://www.doschke.name

RE: PRINTER PROMPT

(OP)
Thanks Mike,
I will have a look at this

Alastair

RE: PRINTER PROMPT

(OP)
Hi Mike,
I have had a quick look at this class.
What I really want to do is get the total page count into the print dialog box.
Is there a way to pass parameters to the dialog box such as pagecount?

Alastair

RE: PRINTER PROMPT

If I do REPORT FORM TO PRINTER PROMPT I get a Windows OS printer choice dialog also allowing me to choose to print all pages or a range.

What do you mean with "set total pages"? AS Tore asked initially did you actually mean see or set?

To make a choice, eg only print page 2 works, any page choice you do will be based on having seen a preview, doesn't it? So does it really matter what the dialog displays you will need to print with preview first, then pick pages.

The easiest solution will be using foxypreviwer with REPORT FORM (lcReport) NOCONSOLE PREVIEW, because you'll see preview, number of pages, have a printer setting button to get to the dialog you also see with PROMPT and then know what you want to print and can set pages accordingly.

Bye, Olaf.

Olaf Doschke Software Engineering
https://www.doschke.name

RE: PRINTER PROMPT

Alastair,

You can't customise the dialogue that appears as a result of the TO PRINTER PROMPT clause (as far as I know). But there is nothing stopping you from creating your own dialogue, and displaying it immediately before your REPORT FORM.

That dialogue would be a normal VFP form, arranged to look similar to the standard Print dialogue. You would use APRINTERS() to populate the list of available printers. To get the total number of pages, you would have to do a dummy pass of the report, capturing the value of _PAGETOTAL at the end (in other words, put an On Entry expression in the report's Summary Band properties; the expression would store the value of _PAGETOTAL in a variable, which you can then use to populate the "total pages" box in in your dialogue).

After dispalying the dialogue, you would print the report as usual, without the TO PRINTER PROMPT clause. You would SET PRINTER to the printer chosen in the dialogue. You would use the RANGE clause to specify which pages to print. And you would issue the REPORT FORM command multiple times, depending on the number of copies selected.

I know it sounds a bit complicated, but it would give you total control over the dialogue and the information that it returns.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: PRINTER PROMPT

(OP)
Hi Mike,
Yes, I feared that would be what I would have to: Build a dialog box.
When I use 'TO PRINTER PROMPT', in the dialog box it where there is the option to select "All" or "Pages", the page number in the text box is 1-65534.
That is what I am trying to change. What I see there.

Alastair

RE: PRINTER PROMPT

I guess it depends how badly you want to do this. I can see that, if the report is only, say, 23 pages, then it is better to show 1-23 than 1-65534. But that's at the expense of creating your own dialogue form, with all the design and coding and testing that involves.

Personally, I'd be inclined to leave it as it is. If someone comes up with any easy way of doing what you want, then go for it. If not, devote your energies elsewhere.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: PRINTER PROMPT

Yes, since this prompt comes when the print is initializing before it knows how many pages will result from the FRX, there always is this default range 1-65536

This changes with foxyPreviwer, in that you can first see the preview and pages and then click for printer choice and printer preferences, as the preview toolbar then has a printer settings button going into that dialog.

So again, I recommend you use foxypreviewer and the problem solves itself. The preview shows the number of pages and so for example when someone knows he needs the last page, he can set printer preferences to that page number.

The prompt dialog is appearing with the highlighted button of the preview toolbar:


Bye, Olaf.

Olaf Doschke Software Engineering
https://www.doschke.name

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close