Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cesar
  Where is Cesar?
 
 Brazil
 Cesar
 To: Pollor Beer
  Where is Pollor Beer?
 St Peters burg
 Russia
 Pollor Beer
 Tags
Subject: RE: How to export a report to other format?
Thread ID: 248815 Message ID: 248855 # Views: 5 # Ratings: 3
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Wednesday, December 23, 2009 9:18:47 PM         
   


> I want to ask from you all dear and respectable programmers that..
> HOW TO EXPORT A REPORT TO ANOTHER FORMAT?
> thanx and regards.


Exporting Reports to other formats:

HTML:
SET CLASSLIB TO ADDBS(HOME()) + 'FFC_REPORTLISTENER' 
ox = CREATEOBJECT('htmlListener') 
ox.TargetFileName = 'C:\MyHTMLOutput' 
REPORT FORM meuReport OBJECT ox 



TIFF:

loListener = newobject('MPTiffListener', 'Europa.vcx') 
IF VARTYPE(loListener) = 'O' 
   loListener.TargetFileName = .Arquivo_Destino.value 
   loListener.QuietMode = .T. 
   erase (loListener.TargetFileName) 
   REPORT FORM (nome_arquivo) object loListener 
   RELEASE loListener 
ELSE 
   MESSAGEBOX("Could not create file") 
ENDIF 




BMP, PNG, JPG, GIF, EMF, TIFF

&& List of constants that determine the image type of report
#DEFINE EMF_Report 100 
#DEFINE TIF_Report 101
#DEFINE JPG_Report 102
#DEFINE GIF_Report 103
#DEFINE PNG_Report 104
#DEFINE BMP_Report 105

LOCAL loListener AS OBJECT 
loListener =.NULL. 

SET CLASSLIB TO HOME() + 'FFC_REPORTLISTENER' 
loListener = CREATEOBJECT('ReportListener') 
DO (_REPORTOUTPUT) WITH 3,loListener 

REPORT FORM YourReport.Frx OBJECT loListener 

* Use the constant you want to determine the image type
* in the 3rd parameter
loListener.OUTPUTPAGE(1,cArquivo,JPG_Report)



PDF Output

The vast majority of options use PDF Printers. A great option for this is to use Lisa Slater Nicholls' PDFListener
Check this article for all the details and download files

PDF POWER TO THE PEOPLE
http://spacefold.com/articles/PDFPower.aspx


Another wonderful option is to use Luis Navas' PDFx Listener class
The last version for download is found here:
http://weblogs.foxite.com/luisnavas/archive/2008/10/06/7025.aspx

Complete information here:
http://weblogs.foxite.com/luisnavas/archive/2008/08/05/6453.aspx



RTF Output, very nice to be used in OpenOffice or MS-WORD

Use the RTFListener by Vladimir Zhuravlev
https://www.foxite.com/downloads/default.aspx?id=166



Regards,

Cesar
My Blog

ENTIRE THREAD

How to export a report to other format? Posted by Pollor Beer @ 12/23/2009 3:48:18 PM
RE: How to export a report to other format? Posted by Jun Tangunan @ 12/23/2009 3:54:02 PM
RE: How to export a report to other format? Posted by tushar @ 12/23/2009 3:57:30 PM
RE: How to export a report to other format? Posted by Pollor Beer @ 12/23/2009 6:35:54 PM
RE: How to export a report to other format? Posted by tushar @ 12/23/2009 6:46:58 PM
RE: How to export a report to other format? Posted by Mike Gagnon @ 12/23/2009 8:56:39 PM
RE: How to export a report to other format? Posted by Cesar @ 12/23/2009 9:18:47 PM