none
Count Rows Of a filtered Tablix and show in a different Textbox (Outside Tablix)

Answers

  • Hi Priya,

    You can use a custom code to achieve this.

    1. First past the custom code below to your report.
      dim Counter as Integer=0
      Public function Row(r as string) as string
      Counter=Counter+1
      return r
      end function
      public function getCounter( ) as Integer
      return Counter
      end function
    2. Then use the expression below in one of the column:
      =Code.Row(Fields!Name.Value)
    3. At last you can use a text-box outside the tablix to get the row counts using the expression:
      ="Counter:" & Code.getCounter()

    The screenshots below are for your reference.

    If you have any questions, please feel free to ask.

    Regards,
    Charlie Liao


    Charlie Liao
    TechNet Community Support

    • Marked as answer by Priya D Thursday, January 24, 2013 11:43 AM
    Thursday, January 24, 2013 6:50 AM
    Moderator

All replies

  • Hi Priya

    Take another tablix with dataset same as previous one and apply textbox property COUNTROWS() it will return the number of rows filtered from parameters.

    Thanks

    Hope this may solve your problem.

    Please don't forget to Marked as Answer if my post solved your problem.It will helpful to other users.

    • Proposed as answer by Anjum Aara Wednesday, January 23, 2013 1:34 PM
    • Unproposed as answer by Priya D Wednesday, January 23, 2013 2:19 PM
    Wednesday, January 23, 2013 12:19 PM
  • Hi Anjum,

    I want to access Countrows() of a table from a textbox outside that tablix.

    Thanks

    Priya

    Wednesday, January 23, 2013 2:13 PM
  • Hi Priya,

    CountRows outside the tablix is not possible. But create tablix, delete headers and all columns except 1 (which means it is just 1 cell). Which now looks like a text box. Don't know whether this solves your problem or not.

    -Srini

    Wednesday, January 23, 2013 2:29 PM
  • Hi Srini,

    Thanks for reply .

    I am doing countrows in my table itself. just wanted to access that cell outside.

    Your post make sense but performance will be the issue as I have 5 tablix and 2 textbox per tablix. any other solution?

    Thanks

    Priya


    • Edited by Priya D Wednesday, January 23, 2013 2:59 PM
    Wednesday, January 23, 2013 2:58 PM
  • Hello,

    Just Place a text box and write your expression like this

    =CountRows(

    "DataSet1")Where DataSet1 is your DataSet Name


    blog:My Blog/

    Hope this will help you !!!
    Sanjeewan

    Wednesday, January 23, 2013 3:40 PM
  • Hi Sanjeewan,

    It wont work either as tablix is filtered..

    Thanks Priya

    Wednesday, January 23, 2013 6:03 PM
  • hi,

    create another dataset using the same sql criteria as the 1st one but only SELECT COUNT(*) as theCount -- this dataset should also take in the same filters as the 1st one.

    Then use this dataset to populate the textbox outside of your tablix.


    Please mark as answered or vote helpful if this post help resolved your issue. Thanks!

    k r o o t z

    Wednesday, January 23, 2013 6:18 PM
  • Hi Priya,

    I don't know what is the issue you are facing. I could able to create a sample. Generated 1 to 50 numbers in a dataset, same dataset linked to four tablix each having different filters.

    I could able get the count in a text box at the bottom. What is the SSRS version you are trying this? I did in 2008 R2. Even it exported to PDF and Excel without any issues.

    -Srini

    Wednesday, January 23, 2013 9:20 PM
  • Hi Priya,

    You can use a custom code to achieve this.

    1. First past the custom code below to your report.
      dim Counter as Integer=0
      Public function Row(r as string) as string
      Counter=Counter+1
      return r
      end function
      public function getCounter( ) as Integer
      return Counter
      end function
    2. Then use the expression below in one of the column:
      =Code.Row(Fields!Name.Value)
    3. At last you can use a text-box outside the tablix to get the row counts using the expression:
      ="Counter:" & Code.getCounter()

    The screenshots below are for your reference.

    If you have any questions, please feel free to ask.

    Regards,
    Charlie Liao


    Charlie Liao
    TechNet Community Support

    • Marked as answer by Priya D Thursday, January 24, 2013 11:43 AM
    Thursday, January 24, 2013 6:50 AM
    Moderator
  • Thanks Charlie .

    It worked for me !! Could you also explain why it works like that?

    Thanks Priya

    Thursday, January 24, 2013 12:34 PM
  • Hi Charlie,

    Its not working for me. It always returns 0 in the text box, not sure why.

    thanks,

    -ram


    Ram Girotra


    • Edited by Ram Girotra Tuesday, January 29, 2013 2:14 PM
    Tuesday, January 29, 2013 2:09 PM
  • This does not work for me. The values are getting set, but my count is 0. I am trying to get a total count of visible rows for the whole report. I can get it per page by using the page footer, but I want it for the whole report. Could someone help me please?
    Saturday, April 26, 2014 1:23 AM