Hi all,

VFP9 SP2

Trying to get into using reportlisteners to solve a particular reporting need. We produce invoices here and there has been a request to have them printed with terms and conditions on the back. We have duplex laser printers and can print certain reports from foxpro double sided no problem.

I can't see a way of doing it with the normal report writer and thought it was a good exercise to start using report listeners.

My normal invoice print run is to build up the data in a cursor and have the normal REPORT FORMAT command. If we wanted to include T's and C's I have a separate layout (tandc.frx) to run that off. Now to combine them I thought the most logical place to call the tandc band would be after the page footer had completed. I have had a good read of the foxpro help and I also bought the book "The visual foxpro report writer: pushing it to the limit and beyond" with the updated chapter for VFP9. Looked through the examples but can't see any that show how do do what I want, which is:

Set up reportlisteners etc and output to duplex printer.
Run my normal report up to the point of page footer.
Run tandc report which will be one page only.
continue with invoice layout.
...

Here's some code I have been playing with.

CLOSE ALL
USE tandc
SELECT 0
use _samples + 'Northwind\orders' ORDER customerid
SET PRINTER TO NAME "Virtual PDF Printer"

oMylisten = newobject('_ReportListener', home() + 'ffc\_ReportListener.vcx')
oMylisten.ListenerType = 0   && page at a time
oMylisten.AddReport('orders.frx', 'for shipcountry="Germany "','OBJECT oMylisten')

oMylisten2 = newobject('_ReportListener', home() + 'ffc\_ReportListener.vcx')
oMylisten2.ListenerType = 0
oMylisten2.AddReport('Tandc.frx', '','OBJECT oMylisten2')

SELECT orders
oMylisten.RunReports()

SELECT tandc
oMylisten2.RunReports()

The documentation talks of an afterband event for the reportlistener class but can't see what you need to do to get it to call the other report.

Anyone done this kind of thing and have a few pointers?

TIA

--
* Peter Cushing *
IT development and support

Signature


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to