Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open subreport with VB

Status
Not open for further replies.

cbsm

Programmer
Oct 3, 2002
229
FR
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 !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top