The report runs fine in the CR environment.
After changing the group to the way I need it and then changing it back it no longer works.
The original report works fine in VB.
I am unsure how within the code we specify groups within Crystal. We have overwritten the SQL query that CR originally produced, which is mirrored in the VB code, however, we did not include any group bys as I have never seen CR produce Group Bys in it's SQL queries.
Normally I would use the CR SQL Designer, but this means we would have to use the CR parameter's dialog box within the program which I do not want.
I am using a SQL Server DSN to connect to the database. We have terrible problems trying to get reports displayed in VB, with many attempts at exactly the same report before it will display properly.
Here is the code we are using within VB.
CrystalReport1.Connect = "mars"
stSQL = " select docstk.seq, doc.code as DocCode,docstk.qty, " & _
" docstk.aqty, docstk.linetype, serial.serno, " & _
" Stock.Code as StockCode, L1.Name as SourceName, " & _
" L2.Name as DestinationName " & _
" from docstk left join docser on (docstk.id = docser.docstkid) " & _
" join doc on (doc.id = docstk.docid) " & _
" left join serial on (docser.serid = serial.id) " & _
" left join stock on (docstk.stkid = stock.id) " & _
" join Location L1 on (doc.SourceId = L1.id) " & _
" join Location L2 on (doc.DestinationId = L2.id) " & _
" where Doc.id = 409 " & _
" order By DocStk.Seq" ', DocSer.DocStkId ASC, Stock.Id"
CrystalReport1.SQLQuery = stSQL
CrystalReport1.ReportFileName = App.Path & "\Reports\DespatchNoteInternal.rpt"
CrystalReport1.PrintReport
Hope this goes further to explaining the problem.