Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP and Crystal and ODBC equals bad combination?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00619319
Message ID:
00620556
Vues:
23
Steve,

Here a single sample.
You create a view in your dbc.
You connect in CR your view by a connection ADO.
You can thus immediately test your report in Crystal report without having to make tables type fox 2.x
In the class "cCrystalReportDynamicViewCursor" you can place a filter which is faster than to put a formula of selection in crystal report.



*---------------------------------------------------------------
DEFINE CLASS cCrystalReportDynamicViewCursor AS ccontainer && cReportDynamicViewCursor
*------------------------------------------------------------
*-- 20/04/2001
cDir = "DBC"
ccursorsource = ''
*-- Connection modifiée 13/08/2001
l_cr_Put_In_Ado_cursor = .T.
cFiltre = ""
cCrystalSubReportName = ""
oRecordset = .NULL.
ENDDEFINE
*------------------------------------------------------------------------
*------------------------------------------------------------------------
*------------------------------------------------------------------------
*-- 6/10/2001 Evolution des prestations du personnel pour l'année..
*-- groupée par centralisation planpause.

DEFINE CLASS Prestation_Stat1Environment AS CrystalReportEnvironment
Ctitle = "Evolution des prestations du personnel pour l'année "
cReportName = CURDIR() + "ReportsCrystal\prestation_stat1.rpt"
DisplayGroupTree = .F.
EnableGroupTree = .F.
DIME aCursors[1]
aCursors[1] = "v_cr_stat_prest1"

FUNCTION BeforeRequery()
LOCAL crxformulafields,;
crxformulafield
*-------------------------------------------------------------------
*-- Si la valeur est <> de celle contenue ds le rapport (False)
IF goapp.oReportSelection.coptstatistique.VALUE = 2
crxformulafields = THIS.oRpt.formulafields

FOR EACH crxformulafield IN crxformulafields
IF crxformulafield.NAME = "{@lallowstatComplete}"
crxformulafield.TEXT = 'True'
ENDIF
NEXT
ENDIF

ENDFUNC
ENDDEFINE
*------------------------------------------------------------------------
DEFINE CLASS v_cr_stat_prest1 AS cCrystalReportDynamicViewCursor
ccursorsource = 'v_cr_stat_prest1'

FUNCTION INIT()
LOCAL cValue

WITH goapp.oReportSelection
cValue = ALLTR( STR( .spinnerAn.VALUE ) )
THIS.PARENT.Ctitle = THIS.PARENT.Ctitle + cValue

THIS.cFiltre ="nan ==" + cValue
THIS.cFiltre = THIS.cFiltre + " AND " +;
IIF( .coptionAssimil.VALUE = 3 , " lassimil = .T. " , ;
IIF( .coptionAssimil.VALUE = 2 , " lassimil = .F. " , ".T." ) )

ENDWITH

DODEFAULT()
ENDFUNC

ENDDEFINE
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform