Expression from datasource in the report header

5 posts, 0 answers
  1. Aya
    Aya avatar
    4 posts
    Member since:
    Aug 2016

    Posted 23 Aug Link to this post

    Hi All,
    I am trying to make this expression in textbox1 in the report header "= IsNull(Sum(IsNull(Fields.part1,0) - IsNull(Fields.part1,0) + IsNull(Fields.part3,0)),0)" where part1 ,part2 and part3 come from datasource1 

    And I have in  a table the detailed section, its datasource is datasource1 
    this make result in table duplicated more times 

    any suggestion for setting textbox1 with different way  ??

  2. Pierre
    Pierre avatar
    56 posts
    Member since:
    Jun 2016

    Posted 24 Aug in reply to Aya Link to this post

    So we meet again Aya,


    You can Use custom function for this.
    http://docs.telerik.com/reporting/expressions-user-functions


    setting the field to :
      "= myFunction(field_1, field_2 , field_n) "

    And declare your function in codebehind:
    public static string myFunction(  string f0
                          , string a1
                          , string a2 = ""
                          , string a3 = ""
                          , string a4 = ""
                          , string a5 = ""
                          , string a6 = ""  )
    {
        return " here is the text";
    }
  3. DevCraft banner
  4. Pierre
    Pierre avatar
    56 posts
    Member since:
    Jun 2016

    Posted 24 Aug Link to this post

    Filter the Table on the active item of the detail section.
    like this : in the Gui
    =Fields.MyField_XYZ

    =

    =ReportItem.DataObject.MyField_XYZ

  5. Pierre
    Pierre avatar
    56 posts
    Member since:
    Jun 2016

    Posted 24 Aug Link to this post

    Well only the 1rst part of my post was submited. and its not that part that i give you a good answer.
    So lets be quick. 2 solutions , choose one!
    1/. Use the gui to apply filter on the table. Filter on a unique data. like this :
    =Fields.myField_ID_XYZ                        =                        =ReportItem.DataObject.myField_ID_XYZ      
    2/.  In code behind :
    this.table2.Filters.Add(
                  new Telerik.Reporting.Filter(
                          "= Fields.myField_ID_XYZ"
                           , Telerik.Reporting.FilterOperator.Equal
                           , "=ReportItem.DataObject.myField_ID_XYZ"    
                           ));

    This will prevent the duplication of the table.

    Filtering it on the "ReportItem.DataObject.myField_ID_XYZ", the current row of the DetailSection.

    My 1rst post is just the answer to your question :
         "any suggestion for setting textbox1 with different way  ??"
    thats was not your real issue.

               

  6. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 26 Aug Link to this post

    Hello,

    And another approach is to add grouping in the Table item's detail row group. This can be done through the Group Explorer. By grouping data, you can eliminate repeating data records.

    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
Back to Top
DevCraft banner