• Login

DataSoft Corporation

Change Subreport Data Connection

To have the subreport data source connection the same as the Master Report use this function inside the subreport.

Inside the Subreport DataSourceDemanded Event use the following code:

Private Sub DSReport_DataSourceDemanded(ByVal sender As Object, ByVal e As System.EventArgs)
Dim SConnect as DataConnectionParametersBase
SConnect = GetSQLDataSourceConnection(dsreport,"sqldatasource1")
SetSQLDataSourceConnection(Ctype(subreport1.ReportSource,DSStudioSupport.DSStudioReportV1),"sqldatasource1",sConnect)
End Sub

 What this code is doing:

The GetSQLDataSourceConnection obtains the Master Report connection for the Master Report sqldatasource1.

The SetSQLDataSourceConnection sets the Sub Reports sqldatasource1 connection to the the Master Report sqldatasource1 connection.

 

 

 

 

 

 

Sunday, 30 December 2018 Posted in Subreports
 DataSoft Store  Knowledgebase  Contact Us
 Sitemap  Privacy Policy
    Customer Service


Copyright © 2019 DataSoft Corporation All rights reserved.