Solved

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

Posted on 2004-09-08
8
1,156 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

739 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