I'm using COM-objects for both Crystal Reports and ADO RecordSets. Here is the code the loads the ADO RecordSet into Crystal:
FUNCTION SetDataSource
LPARAMETERS lnPosition
LOCAL llRetValue, lnCount, i
lnCount = THIS.oReport.Database.Tables.Count
llRetValue = .F.
IF VARTYPE(lnPosition) = 'N' AND BETWEEN(lnPosition, 1, ALEN(THIS.aRecordSet, 1)) AND VARTYPE(THIS.aRecordSet[lnPosition]) = 'O'
llRetValue = .T.
FOR i = 1 TO lnCount
THIS.oReport.Database.Tables.Item(i).SetDataSource(THIS.aRecordSet[lnPosition])
ENDFOR
ENDIF
RETURN llRetValue
ENDFUNC
>What integration method are you using?
>
>>I have a problem with Crystal Reports and ADO RecordSets, the first recordset I submit to a report is correctly shown when printed or previewed. But if I do some changes and submits the new recordset, the report is not updated with the new data, instead it shows the old data.
>>
>>What I found out in the Preview control is a Refresh button, if I press this button I get the latest recordset. But how do I do a refresh in code?
>>
>>Thanks in advance!
---( Mårten Törnquist )---