"In" Operator

6 posts, 0 answers
  1. Dhyan
    Dhyan avatar
    3 posts
    Member since:
    Mar 2011

    Posted 23 Oct 2013 Link to this post

    Hi 

    i'm using the "In" operator for Telerik Reporting v.7.1.13.612. And i came up with the issue that it fails to verify any array value greater than 9. I'm using this filter in the conditional Formatting  (=Parameters.TemplateId.Value in split("|","1|2|3|4|5|6|8|11|9"))

    I tried to split the string using the split function so that it gives output as an array ( see above) then also when the parameter value becomes 11 it fails and when i use different parameter values like 3,2 it works. is there is a bug or i'm not doing something right. I don't want any code behind function for this. 
  2. Nasko
    Admin
    Nasko avatar
    933 posts

    Posted 28 Oct 2013 Link to this post

    Hi Dhyan,

    You are missing the equal "=" sign before the value in your filter, which prevents the Split function from evaluating because the whole value is interpreted as a string. Your filter should look like:

    Expression= Parameters.TemplateId.Value
    Operator: In
    Value= Split("|", "1|2|3|4|5|6|7|8|11|9")

    I have also attached a sample report with the correct filter in the conditional formatting.

    Let me know if you need additional assistance.

    Regards,
    Nasko
    Telerik

    Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

  3. Cynthia
    Cynthia avatar
    3 posts
    Member since:
    Apr 2017

    Posted 10 Apr Link to this post

    Please help me, I need to sent to my telerik report, a list of invoices numbers, to generate de report for these, so I created a report parameter @pFacturas, and a Report Filter as you can see on the attached files, when I run the preview from the report, works fine, but when I call my report from my WPF app, it send me an error "Cannot perform '=' operation on System.Int32 and System.String" how must I sent the parameter?
  4. Cynthia
    Cynthia avatar
    3 posts
    Member since:
    Apr 2017

    Posted 10 Apr in reply to Cynthia Link to this post

    I found the solution!

    TRS.Parameters.Add(new Telerik.Reporting.Parameter("pFacturas", Facturas));

    when I send the report parameter, I need put it on Facturas like "= Split('|', '195261|195262|195263|195264')" (with the list of invoices selected by the user) and I was putting it like "Split('|', '195261|195262|195263|195264')"  without "="

    in my report Filters in Expression: = Fields.NoFolioFactura Operator: In Value: Parameters.pFacturas.Value

    and thats it!
  5. Stef
    Admin
    Stef avatar
    3611 posts

    Posted 13 Apr Link to this post

    Hello,

    The approach is correct as you will produce a string array with the values that can be used with the IN operator.

    Other approach will be to use a multivalue report parameter - How to use MultiValue Report Parameter in a SQL query.


    I hope this helps.

    Regards,
    Stef
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Cynthia
    Cynthia avatar
    3 posts
    Member since:
    Apr 2017

    Posted 17 Apr in reply to Stef Link to this post

    Thank you so much Stef, I goes to prove your suggestion
Back to Top