locked
Aggregate calculated TextBox values RRS feed

  • Question

  • User449807387 posted

    When making a Table Report, I can add a Sum to to each Columns.

    After this I manually add a new Column. In this column I make some Calculations based on values found in some of the other columns in my Table report. Thease calculations are performed correct. I am using code like =ReportItems!TextBox_xxx.Value to get the code from the other text boxes.

    But now I will add a sum also to the Column I have manually added, but I get the error message:


    Error 3 [rsAggregateReportItemInBody] The Value expression for the textrun 'Textbox_ONorm_Total_SubID.Paragraphs[0].TextRuns[0]' uses an aggregate function on a report item.  Aggregate functions can be used only on report items contained in page headers and footers. D:\Jensen\SQL Reporting Services\Jensen TIP\Jensen TIP\Prod_MCAS.rdl 0 0
    [rsAggregateReportItemInBody] The Value expression for the textrun 'Textbox_ONorm_Total_SubID.Paragraphs[0].TextRuns[0]' uses an aggregate function on a report item.  Aggregate functions can be used only on report items contained in page headers and footers.

    I have named the Colum Cell TextBox with my calculation "Textbox_ONormWeight" but in the Total row where I want to add my Sum the expression =sum(ReportItems!Textbox_ONormWeight.Value) does not work.

    Any help?


    Wednesday, May 26, 2010 7:19 AM

Answers

  • User1471008070 posted

    Hi,

    In the Column3 you created, please type in the expression =Fields!datafield1.value/ Fields!datafield2.value rather than =ReportItems!TextBox_1.Value/ReportItems!TextBox_2.Value Here datafield1 and datafield2 is just the datafields in TextBox_1 and TextBox_2 separately.  Then design the report as your previous steps.

     

    Regards

    Challen Fu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 1, 2010 11:01 PM

All replies

  • User-624088818 posted

    try

    =sum(Cint(ReportItems!Textbox_ONormWeight.Value))


    Wednesday, May 26, 2010 8:40 AM
  • User449807387 posted

    Hi and Thanks for the answer. But I still get an error.


    [rsAggregateReportItemInBody] The Value expression for the textrun 'Textbox_ONormWeight_Total_SubID.Paragraphs[0].TextRuns[0]' uses an aggregate function on a report item.  Aggregate functions can be used only on report items contained in page headers and footers.


    [rsAggregateReportItemInBody] The Value expression for the textrun 'Textbox_ONormWeight_Total_SubID.Paragraphs[0].TextRuns[0]' uses an aggregate function on a report item.  Aggregate functions can be used only on report items contained in page headers and footers.

    What I am dooing is! I have 2 text Boxes: TextBox_1 and TextBox_2, fore each of the 2 textboxes I have added a Total Sum Row.
    Then in a new column I am making the Calculation: =ReportItems!TextBox_1.Value/ReportItems!TextBox_2.Value to a TextBox I am calling TextBox_3.
    Now I wish to sum all the values in TextBox_3 and have it to be next to the Sumed values for the TextBos_1 and TextBos_2
    something like:

    Name: Column3: Column2: Column1
    1         0.5           2              4
    1         0.5           4              8
    1         0.5           8             16
    Sum:   1.5           14           28

    My problem is at the calculation of Sum at column3

    Wednesday, May 26, 2010 9:09 AM
  • User-624088818 posted

    Instead of that try =sum(Fields!Column3.Value) in sum textbox

    Thursday, May 27, 2010 1:19 AM
  • User449807387 posted

    Hi and thanks for the answer, but unfortunaltely this is also not working.

    The TextBox does not contain any Fields information that I can access. But it contains an expression.

    The build in Aggregate funtions seems to work only on the Fields directly found in my dataset.

    What I have in my text box named TextBox_3 is an expression based on some of the Fields and sum information.

    I want to be able to sum these values in the same way as the aggreage funtions are summing the Fields information.

    But the 2 sugestions you have menioned return only errors telling me that:

    [rsAggregateReportItemInBody] The Value expression for the textrun 'Textbox_ONormWeight_Total_SubID.Paragraphs[0].TextRuns[0]' uses an aggregate function on a report item.  Aggregate functions can be used only on report items contained in page headers and footers.

    [rsAggregateReportItemInBody] The Value expression for the textrun 'Textbox_ONormWeight_Total_SubID.Paragraphs[0].TextRuns[0]' uses an aggregate function on a report item.  Aggregate functions can be used only on report items contained in page headers and footers.

    How can I overcom this problem?

    Thursday, May 27, 2010 5:47 AM
  • User1471008070 posted

    Hi,

    In the Column3 you created, please type in the expression =Fields!datafield1.value/ Fields!datafield2.value rather than =ReportItems!TextBox_1.Value/ReportItems!TextBox_2.Value Here datafield1 and datafield2 is just the datafields in TextBox_1 and TextBox_2 separately.  Then design the report as your previous steps.

     

    Regards

    Challen Fu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 1, 2010 11:01 PM
  • User449807387 posted

    Hi All

    Thanks for the try to help me but I do still not have any luck making what I want. I have made a small example.

    Mode                   Rate

    [Mode]                 <<Expr>>

    [Sum(Mode)]       xxx


    I have filled a Table as shown. The [Mode] is from a DataSet. 

    the <<Expr>> is =Fields!Mode.Value/Sum(Fields!Mode.Value, "DataSetTest")

    This results in:

    Mode    Rate

    2          0.25

    6          0.75

    8          x.xx

    I now want to sum all the rates and end up with x.xx = 1.00

    but suggestions already received does not work. I have named the Text box "Rate"

    Peter

    Saturday, June 19, 2010 8:57 AM
  • User1543175328 posted

    This particular fix worked for me. But it was dropping the decimal places.

    Any reason why?

    Tuesday, July 16, 2013 1:56 PM