Home  |  Index  |  Dotnet4all Snippets  |  Submit resources
About  |  Mail us  
Dotnet4all Logo
wildcard (Thursday, December 23, 2004)
 

Found the following interesting discussion in the Newsgroups:

wildcard
by:Anonymous

vb windows .net 2002
crystal reports 9

Record selection formula works fine for currency string result, good for operators =/>= and so on, as follows:
vb form

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim SelectFormula As String
Dim myCrystalReportViewer = CrystalReportViewer1
SelectFormula = "{CLIN_FUND.FUND_AMT} > " & TextBox1().Text
CrystalReportViewer1.SelectionFormula = SelectFormula
......etc

crystal select formula ...
{CLIN_FUND.FUND_AMT} > 500.00;
==========

Now, I'm using a string for a description, and as long as it equals what's in the textbox (= or LIKE), it's fine. But I need to use a wildcard to pull in all results that would contain what the user types in the textbox and it's not working.

vb form

SelectFormula = "{LINE_ITEM.CLIN_DESC} LIKE '" & TextBox1().Text & "'"
CrystalReportViewer1.SelectionFormula = SelectFormula

crystal formula
{LINE_ITEM.CLIN_DESC} LIKE "%%";

I tried inserting a wildcard % in the vb statement, but no luck.

How do I pull in all results that include the user's input in the textbox, please?

Many thanks.

-H



 Reply:
by:Bernie Yaeger

 Hi Helen,

Here's the syntax as it should appear inside crystal:

{prod.bipad} like "187". If the user enters 'an' against a list of names,
this will return nancy, danny, but not bernie and not helen.

HTH,

Bernie Yaeger


 Reply:
by:Anonymous

 Thank you, Bernie. I even got it to work with your scenario, but with a wildcard instead, such as {prod.bipad} like "%%", so it's up and running now and lookin' good. Working for text strings, and multiple fields from multiple tables, but not yet working for string containing numericals. I have a separate posting for this question. Hope to resolve v. soon.
-H



Posted by Xander Zelders



 
Previous Posts
    - More data woes....
    - Serial Communication
    - VB and 'graphical' languages
    - Custom Control Postback Problems
    - [Help] my form lost my Tab page1 & page 2.
    - [HELP] All textbox and button disappear in design ...
    - Problems with ListAvailableSQLServers (SQLDMO)
    - debuging web controls
    - Microsoft.Office.Interop.Excel
    - Double-click event in datagrid?

Archives
    - 10/03/2004 - 10/10/2004
    - 10/10/2004 - 10/17/2004
    - 10/17/2004 - 10/24/2004
    - 10/24/2004 - 10/31/2004
    - 10/31/2004 - 11/07/2004
    - 11/21/2004 - 11/28/2004
    - 11/28/2004 - 12/05/2004
    - 12/05/2004 - 12/12/2004
    - 12/12/2004 - 12/19/2004
    - 12/19/2004 - 12/26/2004
    - 12/26/2004 - 01/02/2005
    - 01/23/2005 - 01/30/2005
    - 01/01/2006 - 01/08/2006
    - 09/24/2006 - 10/01/2006


Disclaimer & Terms of Use  | DotNet4All.Com concept & © 2004 - 2007 by  Zelders²  - Holland