Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NoData Event
Message
From
28/01/2003 09:35:46
 
 
To
27/01/2003 22:31:29
General information
Forum:
Visual FoxPro
Category:
Crystal Reports
Title:
Miscellaneous
Thread ID:
00746073
Message ID:
00746170
Views:
25
Here's some sample code that may help..
LOCAL loEventHandler
LOCAL loCrystal AS CRAXDRT.Application
LOCAL loReport AS CRAXDRT.Report
LOCAL llSuccess

* Instantiate the RDC
loCrystal = CREATEOBJECT("CrystalRuntime.Application")

* Get the report object
loReport = loCrystal.OpenReport("C:\CR\Inventory.RPT")

* Instantiate the event handler class
loEventHandler = CREATEOBJECT("ReportEventHandler")

* Bind the event handler to the events in the section
llSuccess = EVENTHANDLER(loReport, loEventHandler)

IF llSuccess
  * If the event binding was successful, print the report
  loReport.PrintOut(.F.)

  * Unbind the event handler
  EVENTHANDLER(loReport, loEventHandler, .T.)
ENDIF

* Define the event handler class
DEFINE CLASS ReportEventHandler AS session OLEPUBLIC

  IMPLEMENTS IReportEvent IN ;
    "c:\program files\crystal decisions\report designer component\craxdrt9.dll"

	PROCEDURE IReportEvent_NoData(pCancel AS LOGICAL) AS VOID ;
    HELPSTRING "Fires this event when there is no data"
 				
    * Write a message to the log
 	  STRTOFILE("No Data Event." + CHR(13) + CHR(10), "C:\CR\EventLog.TXT", .T.)
	ENDPROC

	PROCEDURE IReportEvent_BeforeFormatPage(PageNumber AS Number) AS VOID ;
    HELPSTRING "Fires this event before formatting a page"
				
    * Write a message to the log
	  STRTOFILE("Before Format Page Event. Page No: " ;
      + TRANSFORM(PageNumber, "999") + CHR(13) + CHR(10), ;
      "C:\CR\EventLog.TXT", .T.)
  ENDPROC

	PROCEDURE IReportEvent_AfterFormatPage(PageNumber AS Number) AS VOID ;
    HELPSTRING "Fires this event after formatting a page"
				
    * Write a message to the log
    STRTOFILE("After Format Page Event. Page No: " ;
      + TRANSFORM(PageNumber, "999") + CHR(13) + CHR(10), 
      "C:\CR\EventLog.TXT", .T.)
  ENDPROC

  PROCEDURE IReportEvent_FieldMapping(reportFieldArray AS VARIANT, ;
    databaseFieldArray AS VARIANT, useDefault AS LOGICAL) AS VOID ;
    HELPSTRING "Fires this event if database is changed while verifing database"
				
  * Write a message to the log
  STRTOFILE("Field Mapping Event.", "C:\CR\EventLog.TXT", .T.)
  ENDPROC
ENDDEFINE
>hi guys...
>
>i'm trying to use Crystal Reports' NoData event, but don't know
>how to use it in Visual Foxpro. can anyone help ?
>
>i'm using CR 8.5, VFP 7
>
>thx....
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform