Hi,
I am using VB to open crystal reports.
It working fine with 'simple' report.
I have now to open a report, containing a subreport.
The subreport is linked to the mainreport by a field.
ex :
client1
Product1
Product3
client2
Product2
Product5
Here is my code for a 'simple' report :
Set crystalApplication = New CRAXDRT.Application
'Main report
Set crystalreport = crystalApplication.OpenReport("c:\test.rpt"
Set crpDB = crystalreport.Database
Set crpDBTables = crpDB.Tables
Set crpDBTable = crpDBTables.Item(1)
crpDBTable.SetLogOnInfo OracleDatasource, ,strLogin, strPassword
crystalreport.SQLQueryString = "select * from client"
'subreport
Set crystalSubReport = crystalreport.OpenSubreport("Order"
Set crpDBTable = crystalSubReport.Database.Tables.Item(1)
crpDBTable.SetLogOnInfo OracleDatasource, ,strLogin, strPassword
crystalreport.SQLQueryString = ????????[/color red]
ex : "select * from order where clientNo=???"
Or maybe there is another way ??
Thanks !
I am using VB to open crystal reports.
It working fine with 'simple' report.
I have now to open a report, containing a subreport.
The subreport is linked to the mainreport by a field.
ex :
client1
Product1
Product3
client2
Product2
Product5
Here is my code for a 'simple' report :
Set crystalApplication = New CRAXDRT.Application
'Main report
Set crystalreport = crystalApplication.OpenReport("c:\test.rpt"
Set crpDB = crystalreport.Database
Set crpDBTables = crpDB.Tables
Set crpDBTable = crpDBTables.Item(1)
crpDBTable.SetLogOnInfo OracleDatasource, ,strLogin, strPassword
crystalreport.SQLQueryString = "select * from client"
'subreport
Set crystalSubReport = crystalreport.OpenSubreport("Order"
Set crpDBTable = crystalSubReport.Database.Tables.Item(1)
crpDBTable.SetLogOnInfo OracleDatasource, ,strLogin, strPassword
crystalreport.SQLQueryString = ????????[/color red]
ex : "select * from order where clientNo=???"
Or maybe there is another way ??
Thanks !