Solved

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

Posted on 2004-09-08
8
1,160 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

 
LVL 101

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
 
LVL 101

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 101

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 101

Expert Comment

by:mlmcc
ID: 12011869
Glad I could help

mlmcc
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

705 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