cancel
Showing results for 
Search instead for 
Did you mean: 

"Database login" when changing dataset in subreport

Former Member
0 Kudos

Hi.

We've written a client/server solution, using Crystal Reports.

The server are running the code below, to populate the report, and save it with data.

After this function are executed, the file are sent to the client, and viewed en CrystalReportsViewer.

If there's no subreports in the report, everything words fine.

If there's one ore more subreports, the CrystalReportsViewer comes up with a "Database Login" dialog.

It seems that the SetDataSource doesnt have any effect on the subreports... :o(

Private Shared Function RunReport(ByVal Filename As String, ByVal Dset As DataSet)

Dim tmpfilename As String = My.Computer.FileSystem.GetTempFileName() & ".rpt"

Dim RPT As New ReportDocument

RPT.FileName = Filename

RPT.SetDataSource(Dset)

For Each subreport As ReportDocument In RPT.Subreports

subreport.SetDataSource(Dset)

Next

RPT.SaveAs(tmpfilename, True)

Dset.Dispose()

RPT.Dispose()

Return tmpfilename

End Function

Any suggestions?

Best regards

Karsten Balle

View Entire Topic
former_member183750
Active Contributor
0 Kudos

See [this|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13270] [original link is broken] [original link is broken] [original link is broken]; blog for troubleshooting tips re. .NET datasets and Crystal Reports.

Ludek