Why Do Reports Always Print Twice?

Why Do Reports Always Print Twice?

Post by il.. » Wed, 18 Sep 1996 04:00:00



On a custom menu form, I have a button for reports.  When the button
is pressed, a report "switch menu" appears.  The user chooses a report
and it prints.  The problem is that the report ("codes") always prints
twice.  The Paradox dialog box printing and preparing to print goes
through its motions twice.

What am I doing or not doing properly?

Here is the code:
       var
         vform                Form
         rHandle        Report
         rpiHandle      ReportPrintInfo
       endvar

   switchMenu
     case "Premiums Master" :

     case "Shipping Master" :

     case "Contacts..." :

     case "Summary" :

     case "Codes" :
          rpiHandle.name = "codes.rsl"
          rHandle.print(rpiHandle)

            if NOT rHandle.print(rpiHandle) then
               msgStop("Error printing " + rpiHandle.name,
               "Please make sure the report exists and try again.")
            endIf

  endSwitchMenu

 
 
 

Why Do Reports Always Print Twice?

Post by Scottde » Wed, 18 Sep 1996 04:00:00


 rpiHandle.name = "codes.rsl"
          rHandle.print(rpiHandle) --- Prints the 1st time

            if NOT rHandle.print(rpiHandle) then --- prints the 2nd time
               msgStop("Error printing " + rpiHandle.name,
               "Please make sure the report exists and try again.")
            endIf

The only way the program can check for the NOT condition is to try to
print the report. Just eliminate the first statement and you should be OK
Scott

 
 
 

Why Do Reports Always Print Twice?

Post by Mathew Gyokers Eli » Wed, 18 Sep 1996 04:00:00


        I think it's very simple, look at your code:
 rHandle.print(rpiHandle)

            if NOT rHandle.print(rpiHandle) then
               msgStop("Error printing " + rpiHandle.name,
               "Please make sure the report exists and try again.")
            endIf
...

        What you're saying is:
print the report rHandle
then print it again, and if the print command returns false
        because it couldn't print it, then show an error
...

        So instead, get rid of the first .Print command and just
use the if not .print that you've got there.

--
Paradox and Delphi Consultant. Member: Borland Delphi Technical Support
             Most small questions answered for free!

       Paradox Web Page: http://www.pagescape.com/fire/pdox/
          My words are my own, I don't speak for Borland.

 
 
 

Why Do Reports Always Print Twice?

Post by Tom McKe » Wed, 18 Sep 1996 04:00:00



>     case "Codes" :
>          rpiHandle.name = "codes.rsl"

you're calling the print procedure here

Quote:>          rHandle.print(rpiHandle)

and again here

Quote:>        if NOT rHandle.print(rpiHandle) then
>           msgStop("Error printing " + rpiHandle.name,
>           "Please make sure the report exists and try again.")
>        endIf

Just call the second instance of print above and you'll accomplish
what you want.

-Tom

Tom McKeon
Softbite International


 
 
 

Why Do Reports Always Print Twice?

Post by David F. Kelto » Thu, 19 Sep 1996 04:00:00


It appears that you are calling the print() method twice, or am I missing
something??

--
David


> On a custom menu form, I have a button for reports.  When the button
> is pressed, a report "switch menu" appears.  The user chooses a report
> and it prints.  The problem is that the report ("codes") always prints
> twice.  The Paradox dialog box printing and preparing to print goes
> through its motions twice.

> What am I doing or not doing properly?

> Here is the code:
>        var
>          vform                Form
>          rHandle        Report
>          rpiHandle      ReportPrintInfo
>        endvar

>    switchMenu
>      case "Premiums Master" :

>      case "Shipping Master" :

>      case "Contacts..." :

>      case "Summary" :

>      case "Codes" :
>           rpiHandle.name = "codes.rsl"
>           rHandle.print(rpiHandle)

>             if NOT rHandle.print(rpiHandle) then
>                msgStop("Error printing " + rpiHandle.name,
>                "Please make sure the report exists and try again.")
>             endIf

>   endSwitchMenu

______________________________________________________________________
: Datacraft Systems, Inc. - Interactive Data-Driven Web Sites!
: URL: http://www.db.com  - Multi-user Database Development and Design
: Philadelphia - New York - Washington DC

 
 
 

1. Printing reports always goes to 3x5 paper size

Within the past few days every time I run a report it
automatically goes to the custom paper size and sets itself to
3x5.  The setup is for 8 1/2 x 11 at the outset but I cannot
seem to override this setting when running reports.  

The only option I can think of is to reload the software.  Any
ideas?    

Other printing with other software seems to be ok.    

Printing on HP laserjet 4+.

The same database and reports work fine on another computer.

2. How to use Connection Pooling and VB 6

3. Report always prints portrait instead of Landscape when activated from form button

4. Formating fields in SQL Server

5. Printing reports always goes to 3x5 paper size

6. NT Performance Monitor (SQL Server)

7. Reports always print on legal size paper, VFP 5

8. 2 SQL server configuration Help

9. Print Reports to file ? Can it be done

10. Printing Access reports or using Access to print/preview reports

11. Code report print <> Manual report print

12. Why print a blank page at the end of a report