Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SFR 5.1F, DoQuery and running a form
Message
From
21/05/2004 08:48:55
 
General information
Forum:
Visual FoxPro
Category:
Stonefield
Miscellaneous
Thread ID:
00904758
Message ID:
00905962
Views:
10
Thank you Del.

>>When the user selected a report and then clicks preview or print I'd like to let the user pick a month from a form and then use that information to create the selected report.
>>
>>How can this be done?
>
>Hi Denis:
>
>I no longer user SFR, but here's what I did a while back. I created some new fields in the reports table, subclassed the report wizard and report engine classes. Among the fields I added are one to hold the class name of the dialog to be presented and another to show the class library in which it resides. Below is the code I added to each of the aforementioned subclasses. Hope this is all I did - it's been a while...
>
>
>* Program....: GLMAREPORTWIZARD.FINISH
>* Author.....: ** Delton Lee, III **
>* Date.......: June 8, 2001
>* Description: Calls Parameter Dialog, if necessary, and fills report
>*............: object properties that will be used in the custom query
>*............: in the DoQuery field.
>* Parameters.: tlPreview - indicates whether report is to be previewed.
>* Returns....:
>* Changes....:
>
>LPARAMETERS tlpreview
>
>LOCAL loParmForm, ;
>		lcClassName, ;
>		llOK
>
>llOK = .T.
>
>WITH THISFORM
>
>	*-- If there's a dialog class specified, run it...
>	IF NOT EMPTY(.oReportEngine.cDlgClass)
>
>		*-- Get the class name and run it
>		lcClassName = ALLTRIM(.oReportEngine.cDlgClass)
>		loParmForm = CREATEOBJECT(lcClassName, .oReportEngine.oReport)
>		loParmForm.Show()
>
>		IF loParmForm.uRetVal = .T.
>
>			llOK = .T.
>			
>		ELSE
>		
>			*-- User clicked the cancel button in the parameter dialog...
>			llOK = .F.
>		
>		ENDIF
>		
>	ENDIF
>
>	IF llOK = .T.
>
>		*-- If the user hasn't cancelled, continue with the report...
>		DODEFAULT(tlPreview)
>
>		IF .oReportEngine.cRepType <> 'Q'
>
>			*-- if not a quick report, we need to clear the values placed in the properties
>			*-- of the report object for the parameters.  This is done so the next run of
>			*-- the report won't unknowingly use paramters from a previously run report.
>			.oReportEngine.oReport.ClearParmProperties()
>
>		ENDIF
>
>	ENDIF
>
>ENDWITH
>
>
>
>* Program....: RPTGLMAREPORTENGINE.SELECTREPORT
>* Author.....: ** Delton Lee, III **
>* Date.......: June 22, 2001
>* Description: Runs once for each report in the reports table
>* ...........: at instantiantion of Report Wizard, then runs each
>*............: time a user selects a different report in the treeview.
>*............: Here, I'm copying contents of fields I added to the reports
>*............: table to properties of this (report engine) object.  This
>*............: makes them available during the Report Wizard's Finish method
>*............: without necessarily having to read from the reports table directly.
>*............: While we're at it, we'll copy the contents of these fields on out
>*............: to the report object as well.
>* Parameters.: tcReportName -
>* ...........: tlSetupReport -
>* Returns....: Value returned by superclass method.
>* Changes....:
>LPARAMETERS tcreportname,tlsetupreport
>
>LOCAL llRetVal, ;
>		loReport
>
>llRetVal = DODEFAULT(tcreportname,tlsetupreport)
>
>WITH THIS
>
>	.cDlgClass = ALLTRIM(SFREPORTS.cDLGCLASS)
>*	.cDlgLib =
>	.cDateType = ALLTRIM(SFREPORTS.cDATETYPE)
>*	.cTechNote
>	.cRepType = SFREPORTS.REP_TYPE
>	.cParmTypes = ALLTRIM(SFREPORTS.cPARMTYPES)
>	.cSecurity = ALLTRIM(SFREPORTS.cSECURITY)
>	.lConverted = SFREPORTS.lConverted
>
>	loReport = .oReportCollection.Item(tcReportName)
>
>	*-- Copy properties to report object only if it's a "standard" report
>	*-- because Quick reports are instantiated from a super class that
>	*-- does not have these properties defined.
>	IF .cRepType = 'S'
>
>		loReport.cRepType = .cRepType
>		loReport.cDlgClass = .cDlgClass
>		loReport.cDateType = .cDateType
>		loReport.cParmTypes = .cParmTypes
>		loReport.cSecurity = .cSecurity
>		loReport.lConverted = .lConverted
>
>	ENDIF
>
>ENDWITH
>
>RETURN llRetVal
>
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Previous
Reply
Map
View

Click here to load this message in the networking platform