Passing Record Selection VB6 to Crystal 2008

peters4286 used Ask the Experts™
Im working with an app developed in VB6 that produces over 160 different crystal reports.

The app is coded to create a recordset in the app first, pass the results to a holding database, then the crystal report is run from that database.

This seems a very slow an sluggish way to produce reports.

The data is quite extensive, with users able to select from a list of 100's of different codes, and many options they want to report on.

I'm leaning towards passing the record selection formula to the report, however this string would be massive for some reports where a user has selected for example 100 odd codes, along with 250 other codes and 15 different options.

So given all this, Im wondering what others may suggest ?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

I'm not sure if VB6 can do it- but in .NET you can actually pass that recordset to the crystal report instead of needing the "holding database" stage. That might be an option to conxsider.

Dim crxReport As CRAXDRT.Report

crxReport.RecordSelectionFormula = "Your formula"

Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
CR2008 doesn't support .com so using VB6 is out at least with the CR2008 dlls.



So if I was to go with the record selection formula, is there any issues or perfomance problems with such a huge selection string ?

ie: we have jobno's that are alphanumeric up to 8 characters which the user can specify as anything they want to be.  A typical user may have between 50 & 1000 different job numbers.  Say they were to select 500 random job no's they wish to report on, I would have to pass something lke:

crxReport.RecordSelectionFormula = "{Jobs.Job_No} = """"123"""" or {Jobs.Job_No} = """"GNE45"""" "

and so on 500 times.

There has to be a better way ??
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

You could try

"{Jobs.Job_No} IN ['123, 'GNE45']"

How are they selecting the job numbers?


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial