Filter Not working when applying LIKE '%STR%'

filter is not working properly showing error when applying filter :
[Table.Item_Name] Like '%gfg%'


its giving 2 errors

1) BC30201 Expression Expected
2) function 'TOString" shadows an override method in base class


where as if i am applying this filter in binding source its working fine


with regards
kutub

Comments

  • edited 3:57AM
    The filter can be any VALID expression (either in C# or VB.Net - depending on language you have selected in the report options).
    Please read about expressions here:
    http://fast-report.com/documentation/UserM...expressions.htm
  • edited 3:57AM
    AlexTZ wrote: »
    The filter can be any VALID expression (either in C# or VB.Net - depending on language you have selected in the report options).
    Please read about expressions here:
    http://fast-report.com/documentation/UserM...expressions.htm


    i checked and it is working everywhere else except fast reports!!

    ok gimme a example how can i apply filter for searching all item names which contains the word "PSP" if the field of item is [TABLE.ITEMNAME]

    gimme both example in vb and c#


    with regards
    kutbi nahar
  • edited 3:57AM
    Once again. The filter is an expression written in c# or vb.net (you choose the language in the Report|Options... menu). The filter IS NOT a SQL expression or something like that.

    There is no "Like" operator in C# or VB.Net. You cannot use it in an expression. Use string class methods such as StartsWith, EndsWith, Contains. Here is the correct filter expression:

    [Table.Item_Name].Contains("gfg")
  • edited 3:57AM
    upd: sorry, my VB is not good - there is Like operator in it.
    This should work:

    [Table.Item_Name] Like "%gfg%"
  • edited 3:57AM
    AlexTZ wrote: »
    upd: sorry, my VB is not good - there is Like operator in it.
    This should work:

    [Table.Item_Name] Like "%gfg%"


    thanks alex for ur quick reply but this is also not working [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> please provide any working sample where i can apply this type of filter with regards Kutbi Nahar[/img]
  • edited 3:57AM
    Do you need to filter strings that contain "gfg" inside?
    According to MSDN, you have to use the following pattern:

    [Table.Item_Name] Like "*gfg*"
  • edited November 2009
    AlexTZ wrote: »
    Do you need to filter strings that contain "gfg" inside?
    According to MSDN, you have to use the following pattern:

    [Table.Item_Name] Like "*gfg*"


    see at the bottom it is giving error like this i tried all valid method did you tried at your side for filtering with LIKE expression m shock that NONE of USER OF FAST REPORT IS USING LIKE Expression for filtering !!!!


    this is the error image
  • edited 3:57AM
    Here is the working report, you can run it in the demo.exe program.
    1.frx 4.7K
  • edited 3:57AM
    ps: did you noticed I'm using DOUBLE QUOTES?

    [Table.Item_Name] Like "*gfg*" --> correct
    [Table.Item_Name] Like '*gfg*' --> error
  • edited 3:57AM
    AlexTZ wrote: »
    Here is the working report, you can run it in the demo.exe program.


    thanks alex

    but i am lil shocked i created a new report from scratch and it worked but why it not worked in previous i think may be i have changed the script language again and again anyways it solved my probs

    thanks

    with regards
  • edited 3:57AM
    Many thanks for it..It really helps a lot..

    Regards

    Landene
    Surendettement

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.