This is a migrated thread and some comments may be shown as answers.

Expression from datasource in the report header

4 Answers 297 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Aya
Top achievements
Rank 1
Aya asked on 23 Aug 2016, 02:58 PM

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

4 Answers, 1 is accepted

Sort by
0
Pierre
Top achievements
Rank 1
answered on 24 Aug 2016, 09:39 AM
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";
}
0
Pierre
Top achievements
Rank 1
answered on 24 Aug 2016, 09:52 AM
Filter the Table on the active item of the detail section.
like this : in the Gui
=Fields.MyField_XYZ

=

=ReportItem.DataObject.MyField_XYZ

0
Pierre
Top achievements
Rank 1
answered on 24 Aug 2016, 03:03 PM
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.

           

0
Stef
Telerik team
answered on 26 Aug 2016, 08:23 AM
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
Tags
General Discussions
Asked by
Aya
Top achievements
Rank 1
Answers by
Pierre
Top achievements
Rank 1
Stef
Telerik team
Share this question
or