Bonjour,
je développe un datareport sous vb. Mon problème est que,pour je
ne sais quelle raison, lorsque le rapport est créé, 25 page sont créé (ce qui
coincide avec mon nombre de row dans ma requête SQL.
À noter que je rempli mon rapport sans dataenvironment, j'utilise une form.
Quand tu parles de report ? tu parle d'un état dans crystal report vb.net ? ou tu fais tes reports autrement ?
Ben
Voici un exemple de mon code:
conn= "serverªa;Trusted_Connection=yes;database»b;provider=sqloledb" sqlstring = "Select * From RPT_Reception_Corps" Rs.Open sqlstring, conn Do Until A = 32 If IsNull(Rs.Fields(A)) Then Var(Y) = "" Else Var(Y) = Rs.Fields(A).Value End If A = A + 1 Y = Y + 1 Loop With DataReport1 .DataMember = vbNullString Set .DataSource = Rs
With .Sections("Titles_Detail").Controls Do Until A = 32 If IsNull(Rs.Fields(A)) Then Var(Y) = "" Else Var(Y) = Rs.Fields(A).Value End If A = A + 1 Y = Y + 1 Loop DataReport1.Sections("Titles_Detail").Controls.Item("lbl" & B + 1 & "").Caption = Var(13) DataReport1.Sections("Titles_Detail").Controls.Item("lbl" & B + 2 & "").Caption = Var(15) 'DataReport1.Sections("Titles_Detail").Controls.Item("lbl" & B + 3 & "").Caption = var(3) DataReport1.Sections("Titles_Detail").Controls.Item("lbl" & B + 4 & "").Caption = Var(24) & " " & Var(25) DataReport1.Sections("Titles_Detail").Controls.Item("lbl" & B + 5 & "").Caption = Var(27) DataReport1.Sections("Titles_Detail").Controls.Item("lbl" & B + 6 & "").Caption = Var(16) DataReport1.Sections("Titles_Detail").Controls.Item("lbl" & B + 7 & "").Caption = Var(7) DataReport1.Sections("Titles_Detail").Controls.Item("lbl" & B + 8 & "").Caption = Var(21) & " " & Var(22) Y = 0 A = 0 B = B + 8 Rs.MoveNext Loop End With
Voici un exemple de mon code:
conn= "serverªa;Trusted_Connection=yes;database»b;provider=sqloledb"
sqlstring = "Select * From RPT_Reception_Corps"
Rs.Open sqlstring, conn
Do Until A = 32
If IsNull(Rs.Fields(A)) Then
Var(Y) = ""
Else
Var(Y) = Rs.Fields(A).Value
End If
A = A + 1
Y = Y + 1
Loop
With DataReport1
.DataMember = vbNullString
Set .DataSource = Rs
With .Sections("Titles_Detail").Controls
Do Until A = 32
If IsNull(Rs.Fields(A)) Then
Var(Y) = ""
Else
Var(Y) = Rs.Fields(A).Value
End If
A = A + 1
Y = Y + 1
Loop
DataReport1.Sections("Titles_Detail").Controls.Item("lbl" &
B + 1 & "").Caption = Var(13)
DataReport1.Sections("Titles_Detail").Controls.Item("lbl" &
B + 2 & "").Caption = Var(15)
'DataReport1.Sections("Titles_Detail").Controls.Item("lbl" &
B + 3 & "").Caption = var(3)
DataReport1.Sections("Titles_Detail").Controls.Item("lbl" &
B + 4 & "").Caption = Var(24) & " " & Var(25)
DataReport1.Sections("Titles_Detail").Controls.Item("lbl" &
B + 5 & "").Caption = Var(27)
DataReport1.Sections("Titles_Detail").Controls.Item("lbl" &
B + 6 & "").Caption = Var(16)
DataReport1.Sections("Titles_Detail").Controls.Item("lbl" &
B + 7 & "").Caption = Var(7)
DataReport1.Sections("Titles_Detail").Controls.Item("lbl" &
B + 8 & "").Caption = Var(21) & " " & Var(22)
Y = 0
A = 0
B = B + 8
Rs.MoveNext
Loop
End With
conn= "serverªa;Trusted_Connection=yes;database»b;provider=sqloledb" sqlstring = "Select * From RPT_Reception_Corps" Rs.Open sqlstring, conn Do Until A = 32 If IsNull(Rs.Fields(A)) Then Var(Y) = "" Else Var(Y) = Rs.Fields(A).Value End If A = A + 1 Y = Y + 1 Loop With DataReport1 .DataMember = vbNullString Set .DataSource = Rs
With .Sections("Titles_Detail").Controls Do Until A = 32 If IsNull(Rs.Fields(A)) Then Var(Y) = "" Else Var(Y) = Rs.Fields(A).Value End If A = A + 1 Y = Y + 1 Loop DataReport1.Sections("Titles_Detail").Controls.Item("lbl" & B + 1 & "").Caption = Var(13) DataReport1.Sections("Titles_Detail").Controls.Item("lbl" & B + 2 & "").Caption = Var(15) 'DataReport1.Sections("Titles_Detail").Controls.Item("lbl" & B + 3 & "").Caption = var(3) DataReport1.Sections("Titles_Detail").Controls.Item("lbl" & B + 4 & "").Caption = Var(24) & " " & Var(25) DataReport1.Sections("Titles_Detail").Controls.Item("lbl" & B + 5 & "").Caption = Var(27) DataReport1.Sections("Titles_Detail").Controls.Item("lbl" & B + 6 & "").Caption = Var(16) DataReport1.Sections("Titles_Detail").Controls.Item("lbl" & B + 7 & "").Caption = Var(7) DataReport1.Sections("Titles_Detail").Controls.Item("lbl" & B + 8 & "").Caption = Var(21) & " " & Var(22) Y = 0 A = 0 B = B + 8 Rs.MoveNext Loop End With
aitoz
Désolé, je ne peux pas t'aider. Moi je fais mes reports avec les outils Visual studio.
La dessus je n'y suis jamais rentré ! Bonne chance.
Désolé, je ne peux pas t'aider.
Moi je fais mes reports avec les outils Visual studio.
La dessus je n'y suis jamais rentré !
Bonne chance.
Désolé, je ne peux pas t'aider. Moi je fais mes reports avec les outils Visual studio.
La dessus je n'y suis jamais rentré ! Bonne chance.
Ben
En fait, voici la situation: lors de rapport fait dans visual studio, en utilisant form load( ) pour populer la feuille, j'ai exécuté une autre requête sql contenant qu'une row. Ceci corrige le problème.
En fait, voici la situation: lors de rapport fait dans visual studio, en
utilisant form load( ) pour populer la feuille, j'ai exécuté une autre
requête sql contenant qu'une row. Ceci corrige le problème.
En fait, voici la situation: lors de rapport fait dans visual studio, en utilisant form load( ) pour populer la feuille, j'ai exécuté une autre requête sql contenant qu'une row. Ceci corrige le problème.