Crystal report etat paramétré (etat et sous etat)

cs_amer_ezahir Messages postés 133 Date d'inscription mercredi 21 avril 2004 Statut Membre Dernière intervention 20 septembre 2010 - 7 août 2008 à 16:26
bonjourcheval Messages postés 228 Date d'inscription mercredi 13 décembre 2000 Statut Membre Dernière intervention 8 août 2011 - 7 août 2008 à 16:34
Bonjour;
je developpe une application avec VB6 et Crystal report 8.5 ;
j'ai essaye de faire un etat paramétré mais ça marche pas

Svp aidez moi avec un simple exemple (etat principale et sous etat)

Merci

Bonne journée

1 réponse

bonjourcheval Messages postés 228 Date d'inscription mercredi 13 décembre 2000 Statut Membre Dernière intervention 8 août 2011
7 août 2008 à 16:34
Je ne sais pas si ça va t'aider, mais moi j'utilise le programme de DataDynamic : ActiveReport 2.x.x.x

VOici comment je procède pour paramêtrer mes états.

Private Sub AfficherScenarios()
'Efface l'ancien rapport par un nouveau, mis à jour
Set rptMain = Nothing 'Mon rapport
Set ARScen.ReportSource = Nothing ' mon visualiseur de rapport

Set rptMain = New rptScenario
'Met le numéro de réseau en paramêtre de la requete
rptMain.ShowParameterUI = False

rptMain.Parameters("NoReseau").Value = mintNoReseau
   
   
Set ARScen.ReportSource = rptMain

'Applique le format standart à tous mes nombres
Dim unObj As Object
Dim uneSecTion As Section
        For Each uneSecTion In rptMain.Sections
            For Each unObj In uneSecTion.Controls
               If TypeOf unObj Is DDActiveReports2.Field Then
                   FormatStandart unObj
                End If
           Next
        Next
ARScen.Zoom = 95
End Sub

Ensuite, dans ma requete j'écris ceci :
SELECT tblScenarios.noScenario, tblScenarios.descScenario, tblProjets.nomProjet, tblProjetSols.debitEntrant, tblProjetSols.debitSortant, tblTypeUtilisationSol.descTypeSol, tblPeriode.descPeriode FROM tblPeriode INNER JOIN (tblTypeUtilisationSol INNER JOIN (tblScenarios INNER JOIN ((tblProjets INNER JOIN tblProjetSols ON tblProjets.noProjet tblProjetSols.noProjet) INNER JOIN tblScenariosProjets ON tblProjets.noProjet tblScenariosProjets.noProjet) ON tblScenarios.noScenario = tblScenariosProjets.noScenario) ON (tblTypeUtilisationSol.noTypeSol = tblScenariosProjets.noTypeSol) AND (tblTypeUtilisationSol.noTypeSol = tblProjetSols.noTypeSol)) ON tblPeriode.noPeriode = tblScenarios.noPeriode WHERE Utilise = -1
AND tblScenarios.noReseau =<%noReseau|No Reseau:%>
;

Et ça prend la valeure de ma variable et l'utilise dans ma requete.

Je sais, ma requete est monstrueuse...

Je sais que ce n'est pas pour CR, mais j'espere que ça peut t'aider à trouver des pistes.
0
Rejoignez-nous