Topic: subreport error Posted: 02 Oct 2020 at 3:53pm
Hello
Ihave created a report that contains 4 subreports in the page header.
when I try to run the report i received the error table could not be found. I have tried to use one of the subreports as the main report with the same data it works.
This is how i'm populating the subreport.
Private Sub LoadReport()
Dim ds As New DS_report
Dim dt As DataTable = dt_Mach_parts.Copy
dt.TableName = "Mac_break"
ds.Tables.Add(dt)
Dim reprtdoc As New ProductionRprt
reprtdoc.Subreports("CabParts.rpt").SetDataSource(dt)
With CR_Viewr
.ReportSource = reprtdoc
.Refresh()
End With
End Sub
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Posted: 05 Oct 2020 at 11:44am
I am not sure. Could it be that the main report has no datasource? Only the subreport is being set.
I am guessing/assuming that the schema for dt matches what the subreport is expecting. Crystal is sensitive about that.
Is the page header the same for all pages? Otherwise, I would expect some linking between the main report and the subreport, and that could be part of the issue.
Thanks for your reply.
No the main report has no datasource.
I didn't assign any datasourse because it has no fields that required data.
I will try and add a datasourse to the main report and see if it works,.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum