
Migration CR6 to CR7: Reports don′t work anymore
Im using the report engine through the automation object (crpeauto.dll).
While the reports worked fine with CR6, they dont with CR7, using the same
VB code (see below).
I always get the error "cannot access first record".
In the Seagate Knowledgebase I read about the recordset being out of scope
or getting destroyed. The tip trying it with .readrecords immediately after
.setprivatedata resumed in the same error.
I realized the report format has changed, so I saved the reports in the new
format and I also updated the database driver (pdsmon.dll) which had the
effect, that I can see the reports in the preview pane (of the Crystal
Report Designer), but it had no effect on my previous problem...
Anyone got any ideas???
Thanks for your help
Bernd
Well, there goes my code (RS is defined globally as DAO.Recordset and has
been set (forwardonly-type)):
Dim ReportDb As CRPEAuto.Database
Dim ReportTables As CRPEAuto.DatabaseTables
Dim ReportTable As CRPEAuto.DatabaseTable
Set Report = AppForm.App.OpenReport(ReportFileName)
Set ReportDb = Report.Database
Set ReportTables = ReportDb.Tables
Set ReportTable = ReportTables.Item(1)
ReportTable.SetPrivateData 3, RS
Report.DiscardSavedData
Set ReportView = Report.Preview(, , , , , WS_VISIBLE, Me.hwnd)