` Printed Icetips Article

Icetips Article



Par2: Calling Crystal Reports from Clarion
1998-11-11 -- Ignacio Quijas Rivera
 
Steps to call a Crystal Reports Dll and You can Print from
Clarion 4bABC, a Report.rpt Already developed in CR
I am no using OCX, This Works fine for me

This Steps were Developed from a example that I recived from Kenneth Shan
Thanks Kenneth Shan

1.- Declare this Variables
     ShowRpt             LONG,AUTO
     ReportName       CSTRING(100)
     PreviewWin        CSTRING(100)

2.- With Lib Maker Utility You must Create your crpe32.lib
!!!!!!!!!!!Creating Library
      Is so easy, you execute Lib Maker
      Look for crpe32.dll
      and Save
3.- In Clarion IDE
      Aplication
          Insert Module
             ExternalDll
                Name
                    crpe32.lib that you have created from Lib Maker
4.- Inside Global Map (Priority Default) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Prototypes
   MODULE('crpe32.lib')

PEPrintReport(*CSTRING,SIGNED,SIGNED,*CSTRING,SIGNED,SIGNED,SIGNED,SIGNED, |
                                SIGNED,SIGNED),SIGNED,RAW,PASCAL
      PECloseEngine(),PASCAL
      PEOpenEngine(),PASCAL
   END

5.- In Windows Manager Code Executable Secction   !!!!!!!!!!!!!!!!!!!! Open
Crystal Reports Engine
     Init Priority Last
     PEOpenEngine()
6.- In Windows Event Handling   !!!!!!!!!!!!!!! Closing Crystal reports
Engine
      CLose Window
     PECloseEngine()

  If you want to Print forward Printer

7.- Put on Screen a Button to Print    !!!!!!!!!!!!!!  Printing Report.RPT
from Clarion
    Embedded Accepted
    PreviewWin = 'Ignacio Quijas Presenta...'
    ReportName = 'CartasPorte.rpt'
   ShowRpt=PEPrintReport
   (ReportName,1,0,PreviewWin,0,0,640,680,0,0)

If you want to Previw the report  and after Print to printer

7.- Put on Screen a Button to Print    !!!!!!!!!!!!!!  Printing Report.RPT
from Clarion
    Embedded Accepted
    PreviewWin = 'Ignacio Quijas Presenta...'
    ReportName = 'CartasPorte.rpt'
   ShowRpt=PEPrintReport
   (ReportName,0,1,PreviewWin,0,0,640,680,0,0)



Printed November 21, 2024, 7:17 am
This article has been viewed/printed 35352 times.