Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Report preview doesn't work...
Message
From
02/11/2000 10:22:05
 
 
To
02/11/2000 09:53:21
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00437103
Message ID:
00437114
Views:
31
>Hi!
>
>What could cause the following situation...
>
>I do the command...
>
>REPORT FORM (ConvFilename(Reports.filname)) NOCONSOLE PREVIEW TO PRINTER PROMPT
>
>Some reports (not all) Quickly open up the Preivewi screen
>then immediately close it without displaying the report.
>
>When I press the button a second time ..
>And execute the same command it works just fine..
>
>Why do I have to call this command twice for some reports???
>
>I looked at a few things...
>
>For example...
>-The table in the detail band is selected...
>-I tried variations of the command i.e.
>REPORT FORM (ConvFilename(Reports.filname)) TO PRINTER PROMPT PREVIEW
>
>REPORT FORM (ConvFilename(Reports.filname)) NOCONSOLE PREVIEW TO PRINTER PROMPT
>REPORT FORM (ConvFilename(Reports.filname)) PREVIEW
>
>And all do the same thing..
>
>Any ideas...?

I get an error when trying to use both PREVIEW and TO PRINTER PROMPT.

I would try something like this:
lcReport = ConvFilename(Reports.filname)

IF llPreview
    REPORT FORM (lcReport) PREVIEW
ELSE
    REPORT FORM (lcReport) TO PRINTER PROMPT
ENDIF
Also, beware that you might get an error when using the PROMPT clause on non default printers (KB-article):


SYMPTOMS
When a print request is sent to a non-default printer with the Microsoft Visual FoxPro REPORT FORM ... PROMPT command, Visual FoxPro may cause an error, generate a GPF, quit or print to the wrong printer. The text of the error message is:

Error loading printer driver



RESOLUTION
To resolve this problem you must programmatically change the FoxPro printer.

You can use code to get the name of the printer before you print, set the printer to that name and then issue the REPORT FORM command.

The following Microsoft Knowledge Base article explains how you can specify that a Visual FoxPro report be sent to a particular printer:

Q162798 HOWTO: Use SET PRINTER TO NAME to Specify Report Destination
In most instances, this method is acceptable. However, there may be some instances that require more control over the report options, such as number of copies, paper source, paper size, and page ranges.
Previous
Reply
Map
View

Click here to load this message in the networking platform