?
Solved

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

Posted on 2004-09-08
8
Medium Priority
?
1,162 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
Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

 
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 1600 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

770 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