Enabling Report Listener in AccountMate 6.5 for LAN

June 2005

Introduction

Microsoft has opened the report architecture in Visual FoxPro 9.0. A new ReportListener base class allows developers to create their own customized report output. Several companies have developed Report Listener products to integrate with existing VFP-based applications.

AccountMate has developed Report Listener program hooks for its reporting engine in the latest AccountMate 6.5 for LAN (AM65/LAN) product. The design does not restrict AccountMate users to a particular Report Listener product. This also allows AccountMate resellers to develop a new Report Listener to work with AM65/LAN.

The rest of this document discusses how to enable Report Listener in AM65/LAN. As an example, it also describes the steps to download and install XFRX Report Listener from the AccountMate Download Center of our website and to enable XFRX within AM65/LAN.

Note: AccountMate has the license to distribute XFRX Library, so end users on AccountMate 6.5 for LAN do not need to purchase a separate license to use XFRX Library together with AM65/LAN.

Supported Report Listener

The Report Listener program hooks in AM65/LAN have been tested to be compatible with the following third-party Report Listeners.

§         XFRX by Eqeus.com (www.eqeus.com)

§         FRX2Any by FRX2Any (www.frx2any.com)

Other Reading Materials

Refer to the following articles from the Microsoft website for more information on how Report Listener works in Visual FoxPro 9.0.

§         Listening to a Report

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfoxtk05/html/ft05b6.asp

§         Visual FoxPro Report Writer in Action

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfoxgen9/html/VFP9Reports2.asp

§         What’s New in the Visual FoxPro 9.0 Report Writer

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfoxgen9/html/VFP9Reports1.asp

§         Report Output Application

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_foxhelp9/html/8e6bfe13-c83f-4c73-9037-689fbdb7c7db.asp

§         How to generate and then e-mail a report by using Visual FoxPro 9.0

http://support.microsoft.com/default.aspx?scid=kb;en-us;895277

Downloading and Installing XFRX Report Listener

1.      Access the AccountMate Download Center website at www.accountmate.com/download.

2.      Select the link for Software Updates.

3.      Select to download the XFRX Report Listener.

4.      You will be prompted for a Support ID and Password.

  • This information is used validate whether you have an active maintenance plan for your AccountMate product.

5.      The XFRX Report Listener Library will be saved to your computer as AMLAN65_XFRX.zip.

6.      Copy the following library files from the downloaded ZIP file into the AM65/LAN application folder. These files do not need to be registered.

  • XFRX.FXP
  • XFRXLIB.FLL
  • HNDLIB.DLL
  • ZLIB.DLL

7.      The XFRX Report Listener provides both Report Preview and Export/Email capabilities.

Enabling XFRX for Report Export and Email

1.      Adding records to Amrlis.dbf.

a.      Copy Amrlis.dbf from the downloaded ZIP file to the AM65/LAN application folder.

b.      Delete the corresponding records if you choose not to activate all the output formats.

c.      Note that each output option calls a user-defined function “XFRXListener”, which will be implemented in Step 2 below.

d.      The AccountMate report interface form will display different output formats for Export and Email options based on the records in Amrlis.dbf.

2.      Add the following user-defined function to Amaddon.prg; then re-compile Amaddon.prg.

function XFRXListener(tcRptID, tcFrxName, tcOutput, tcFileType)

 

local llDoNotOpen, llSilent, lcFileType, lcEmailType

 

*/ Report Listener object set to public to be accessible by AmrpvwXFRX.scx

public loXFRXListener

loXFRXListener = evaluate([XFRX("XFRX#LISTENER")])

 

do case

   */ Previewing report

   case tcOutput = OUTPUT_TO_PREVIEW

      */ Use XFRX listener

      loXFRXListener.TargetType = "XFF"

      loXFRXListener.TargetFileName = ""

      select CurReport

      report form (tcFrxName) object loXFRXListener

      do form AmrpvwXFRX.scx

 

      */ Resize Shortcut Pane

      =oFormat.Scr_Resize()

 

   */ Exporting or emailing report

   case tcOutput = OUTPUT_TO_FILE or tcOutput = OUTPUT_TO_EMAIL

      llDoNotOpen = .t.

      llSilent = .t.

      lcFileType = iif(tcFileType = "HTM", "HTML", tcFileType)

 

      if tcOutput = OUTPUT_TO_EMAIL

         pcFileName = sys(2023) + "\" + juststem(justfname(tcFrxName)) + "." + ;

            tcFileType

      endif

 

      =loXFRXListener.SetParams(pcFileName, , llDoNotOpen, , llSilent, , lcFileType)

      report form (tcFrxName) object loXFRXListener

 

      if tcOutput = OUTPUT_TO_FILE

         =AmMsg("I", AmTranMemo("SENT_TO") + pcFileName + ".")

      else

         =SendMail(pcEmailAddr, iif(type("pcRptCaption") = "C", pcRptCaption, ""), ;

            "", pcFileName, "", .f.)

         if file(pcFileName)

            erase (pcFileName)

         endif

      endif

 

   */ Printing report

   otherwise

      report form (tcFrxName) &tcOutPut

 

endcase

 

release loXFRXListener

 

return

3.      Run any report in AM65/LAN and click the Export or Email button on the report form toolbar. A selection of different output options will be displayed. Select any of those options will export or email the report in the selected format.

Enabling XFRX for Report Preview

1.      Perform the steps defined in the preceding section.

2.      Copy the following files from the downloaded ZIP file to the AM65/LAN application folder.

  • AmrpvwXFRX.scx/sct
  • XFRXLib.vcx/vct
  • XFRXFind.bmp/msk
  • XFRXFirst.bmp/msk
  • XFRXLast.bmp/msk
  • XFRXNext.bmp/msk
  • XFRXPage.bmp/msk
  • XFRXPrev.bmp/msk
  • XFRXPrint.bmp/msk
  • XFRXQuit.bmp/msk
  • XFRXBook.bmp/msk

3.      Copy the following code to the SetPrintJob() function of Amaddon.prg; then re-compile Amaddon.prg.

if tlBeforePrint

   */ Using XFRX for report preview

   if tcOutput = OUTPUT_TO_PREVIEW

      pcRptFunction = "XFRXListener(tcRptID, lcFrxName, tcOutput, '')"

   endif

endif

4.      Run any report in AM65/LAN and click the Preview button on the report form toolbar. This will bring up the XFRX report preview window.

 

 

This information is provided "AS IS" without warranty of any kind. AccountMate Software Corporation disclaims all warranties, either express or implied. In no event shall AccountMate Software Corporation be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits, or special damages, even if AccountMate Software Corporation has been advised of the possibility of such damages.