Solved

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

Posted on 2004-09-08
8
1,140 Views
Last Modified: 2008-01-09
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

0
Comment
Question by:fulgeru99
8 Comments
 

Author Comment

by:fulgeru99
ID: 12004868
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?
0
 
LVL 42

Expert Comment

by:frodoman
ID: 12005181
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
0
 
LVL 10

Expert Comment

by:ebolek
ID: 12005535
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
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 12006427
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
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 100

Accepted Solution

by:
mlmcc earned 400 total points
ID: 12006440
I see the problem.  Change the clasue to use * for the wildcard.  Crystal will change it to what the database wants.

reportGestione.RecordSelectionFormula = "{RCTBTRACC.Descrizione} LIKE '*test*'"

mlmcc
0
 
LVL 42

Expert Comment

by:frodoman
ID: 12006882
Good catch, mlmcc!

0
 
LVL 100

Expert Comment

by:mlmcc
ID: 12009202
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
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 12011869
Glad I could help

mlmcc
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now