Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Number of copies problem
Message
De
22/02/2007 13:23:26
Emerson Reed
Folhamatic Tecnologia Em Sistemas
Americana - São Paulo, Brésil
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
Number of copies problem
Divers
Thread ID:
01198080
Message ID:
01198080
Vues:
62
In the following code, when I choose to print all the pages or a range and change the number of copies, VFP print the desired number of copies, but if I choose to print only one page and change the number of copies, VFP always print only one copy.

Sample:
Print range = 1-2 and copies = 2 -> correctly print 2 copies of pages 1 and 2
Print range = 1 and copies = 2 -> incorrectly print 1 copy of page 1

Someone could help me to solve this?
* Create a Report Listener object
Local loReportListener
loReportListener = Newobject("MyReportListener")
loReportListener.ListenerType = 0

* Create a cursor that will be the report data source and insert some records
Create Cursor curTest (field1 c(100))
Local i
For i=1 To 64
   Insert Into curTest Values (Str(i)+" test, test, test, test, test, test, test, test, test, test, test, test, test")
Endfor
Select curTest
Go Top

* Create a report on the fly
Create Report Test1 From curTest
Create Report Test2 From curTest
Create Report Test3 From curTest

* Run the report using the new report engine (object-assisted output)
Report Form Test1 Object loReportListener Nopageeject To Printer Prompt
Report Form Test2 Object loReportListener Nopageeject Noreset
Report Form Test3 Object loReportListener Noreset

* Close cursor and delete the report file
Use In curTest
Delete File Test?.fr?
Return

* Create a class derived from _ReportListener base class and add some features
Define Class MyReportListener As _ReportListener Of Addbs(Home()) + "FFC\_ReportListener.VCX"
   * Internal to the class
   Hidden nFromPage, nToPage
   nFromPage = 1
   nToPage = 65534
   *
   Procedure BeforeReport
      If This.CommandClauses.Prompt
         * Save the range selected in prompt to know which page must be printed
         If Not (This.CommandClauses.RangeFrom==1 And This.CommandClauses.RangeTo==-1)
            This.nFromPage = This.CommandClauses.RangeFrom
            This.nToPage = This.CommandClauses.RangeTo
         Endif
      Endif
   Endproc
   *
   Procedure IncludePageInOutput
      Lparameters nPageNo
      Return Between(This.PageNo,This.nFromPage,This.nToPage)
   Endproc
   *
Enddefine
Emerson Santon Reed
"One Developer CAN Make a Difference. A community CAN make a future." - Craig Boyd
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform