Link to home
Start Free TrialLog in
Avatar of fulgeru99
fulgeru99

asked on

change SELECT formula with LIKE clause at runtime in VB.NET

Hello,

I would like to create a report with a SELECT formula that looks like this:
SELECT * FROM RCTBTRACC WHERE Descrizione LIKE '%test%'

I try likethis:
reportGestione.RecordSelectionFormula = "{RCTBTRACC.Descrizione} LIKE '%test%'"

But Crystal doesn't like the LIKE clause

Please Help, it is urgent

Avatar of fulgeru99
fulgeru99

ASKER

I am thinking of another option.

Can  I pass a custom table to the report. I save a query result in a DataSet, and pass it to the report. Is it possible?
Yes, reporting off a dataset will give you the best results in this case.  Otherwise you'll have to read in all of the data and use Crystal to filter what you don't want.  It's possible, but not very efficient.

Here's a complete sample application for reporting off a .net dataset: http://support.businessobjects.com/communityCS/TechnicalPapers/rtm_reportingoffadonetdatasets.pdf.asp

HTH

frodoman
you can also create a stored prcedure and use it as your datasource as your recordset, If you use dataset, you will be using push method. If you use stored procedure you will be using pull method. I have to remind you that datasets are bad for performance and should not be used if possible,

Regards
Emre
Avatar of Mike McCracken
Nothing wrong with the above suggestions, but what is the problem with the LIKE clause?

I use them all the time with no problems.

mlmcc
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Good catch, mlmcc!

I didn't see it at first but then remembered how I had to change similar clauses depending on whether my users wanted to display the records in VB forms (used the $) or display a report based on the filter.

mlmcc
Glad I could help

mlmcc