Hi,
I have a Crystal Report in which I removed all references to a database. The report has formula fields now, instead of database fields. From VB, I create a recordset and set the report formulas (the formula fields) to match the fields of the recordset.
The problem is that I only get the first record onto the report. The formula fields are in the detail section of the report. I have tried looping the recordset around the formula fields, like this:
For z = 1 To 8
Me.rptTraveler.Formulas(0) = "SerialNum='" & rs.Fields("Ser_Num") & "'"
Me.rptTraveler.Formulas(1) = "JobNum_1='" & rs.Fields("Job_Num1") & "'"
Me.rptTraveler.Formulas(2) = "Size_In='" & rs.Fields("Size_In") & "'"
Me.rptTraveler.Formulas(3) = "Manufac='" & rs.Fields("Manufac") & "'"
Me.rptTraveler.Formulas(4) = "VType='" & rs.Fields("V_Type") & "'"
rs.MoveNext
Next z
...But looping makes now difference - I still only have the first record appearing.
Is there a way to get around this. Do I need a different approach? I have specific reasons for not setting the database in the Crystal report itself. It is an old dbf file that is creating other problems in this application. I know that this technique works on another report that prints just one record. In this case they I need to print all the records returned from the recordset.
Thanks!
KB
I have a Crystal Report in which I removed all references to a database. The report has formula fields now, instead of database fields. From VB, I create a recordset and set the report formulas (the formula fields) to match the fields of the recordset.
The problem is that I only get the first record onto the report. The formula fields are in the detail section of the report. I have tried looping the recordset around the formula fields, like this:
For z = 1 To 8
Me.rptTraveler.Formulas(0) = "SerialNum='" & rs.Fields("Ser_Num") & "'"
Me.rptTraveler.Formulas(1) = "JobNum_1='" & rs.Fields("Job_Num1") & "'"
Me.rptTraveler.Formulas(2) = "Size_In='" & rs.Fields("Size_In") & "'"
Me.rptTraveler.Formulas(3) = "Manufac='" & rs.Fields("Manufac") & "'"
Me.rptTraveler.Formulas(4) = "VType='" & rs.Fields("V_Type") & "'"
rs.MoveNext
Next z
...But looping makes now difference - I still only have the first record appearing.
Is there a way to get around this. Do I need a different approach? I have specific reasons for not setting the database in the Crystal report itself. It is an old dbf file that is creating other problems in this application. I know that this technique works on another report that prints just one record. In this case they I need to print all the records returned from the recordset.
Thanks!
KB