DiscardSavedData method not working!
VB Code:
Dim cReport As CRAXDRT.report
Dim cApp As New CRAXDRT.Application
Dim rst As New ADODB.Recordset
Set cReport = cApp.OpenReport(App.path & "\rptInvoicingReport.rpt")
rst.Open "SELECT a.accountid, a.AccountName, pd.AmountDue, pd.InvoiceRequested, pd.GSTapplies FROM ( ( Package p INNER JOIN PackageType pt ON p.packagetypeid = pt.packagetypeid ) INNER JOIN PaymentDue pd ON pd.packageid = p.packageid ) INNER JOIN Account a ON a.accountid = pd.accountid", db.cnn: WaitForQuery rst
cReport.DiscardSavedData
cReport.Database.SetDataSource rst
CRV.ReportSource = cReport
CRV.ViewReport
I use field definition files (i designed it with real tables, grabbed the sql query, made the ttx file, then used the 'set datasource location' to replace the real tables with the ttx file)
some reports work fine, others dont. argh, the recordset is returning a good 256 records, if i put different fields into the recordset the report complains, so i know its geting the recordset its just not USING it!!
bring on the help!
Cheers