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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports XI recordset report group error 1

Status
Not open for further replies.

Codepoet42

Programmer
Oct 21, 2005
12
US
I just upgraded from Crystal 8.5 to 11 and now the two reports that print from recordsets (instead of the DB) won't print. I keep getting an error from CRViewer that says, "This group section cannot be printed because its condition field is nonexistent or invalid. Format the section to choose another condition field."

I created a new report in 11 and used the same .ttx file as my data source. I added just one field from the .ttx to the report header, and the report will preview but the field does not display. As soon as I add any group to the new report, I get the error.

Can anyone suggest what I might be doing wrong or what setting I need to change in CR to resolve this? I'm about at my wit's end on this one.

Thanks in advance...
 
I've not encountered anything like this, but since no one else has answered, I'll have a go.

First, do the reports use a formula field for grouping? If so, please post it. Most likely it did something a bit irregular, that Crystal 8.5 allowed.

Also post your SQL (Database > Show SQL)

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Hey Madawc, thanks for the reply. No, there are no formulas used in either group of the two recordset-based reports. The first report (Quote.rpt) uses the JobID (Long) field from the Quote.ttx file for grouping, and the second report (BalanceConflict.rpt) uses the CustomerID (Long) field from its .ttx file as the group by field. No formulas involved - just a simple grouping by ID.

Also, there are no stored procedures or SQL statements involved. I just populate an ADODB.Recordset in VB 6 code from a couple of business objects, and then pass that recordset to the .SetDataSource method of a CRAXDRT.Report object. Here's the VB subprocedure that accepts the recordset and passes it to the report object:

*************************************************
Public Sub CreateRecordsetReport(QBRecords As ADODB.Recordset, ReportName As String)

Dim tapp As New CRAXDRT.Application 'LOADS REPORT FROM FILE

On Error GoTo ErrorHandler

'Set Report Object to QB Report Requested
Set mobjReport = tapp.OpenReport(App.Path & "\Reports\" & ReportName)

'Set DataSource for the Report
mobjReport.Database.SetDataSource QBRecords, 3, 1

'Display the Report
DisplayReport

'Clean objects
Set tapp = Nothing
Set QBRecords = Nothing
Set mobjReport = Nothing

Exit Sub

ErrorHandler:
Set tapp = Nothing
Set QBRecords = Nothing
Set mobjReport = Nothing
Err.Raise Err.Number, Err.SOURCE & "/clsReport.CreateRecordsetReport", Err.Description
End Sub
*************************************************

I think this is all OK - it's something on the Crystal side that no longer likes the groups in the .rpt files, or has some trouble reading the data from the recordset/.ttx file combination. That's just my theory, though, and it hasn't helped me solve this conundrum so far. I'm still open to suggestions. Thanks.
 
Sorry, I don't know Visual Basic. Maybe someone else can help.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Hey, thanks, Madawc - you actually helped me figure out a workaround. You mentioned using a formula field for grouping, which I wasn't doing. I was just using the Quote_ttx.JobID field straight from the .ttx file, as I explained.

So I tried changing the group to use a @JobID formula field "formula = {Quote_ttx.JobID}" and I no longer get the "group section..." error. The only other strange thing is that even though the report now opens I can't see any of the string fields on the report. To make any of these fields appear, I also had to replace them with formula values, or change their data type from "String" to "Memo" in the .ttx file. But at least I'm over the hump and able to update the reports so they will both display and print.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top