on 09-20-2012 4:26 PM
Hi
I have a cross tab.
Columns are months
Rows are years
Summarized field is quantity.
I want to perform a task depending on the number of rows my cross tab may hold.
I need to know this row count before my cross tab is displayed.
Any ideas how to get the cross tab row count within the Crystal Report?
Currently I am getting this by querying the data (getting the number of years) and passing it through to the report as a parameter (the report is called from VB).
Hi,
Well, there is no way you can know the number of rows the cross-tab may have 'before it is executed'.
I can think of doing this in three ways:
1)Your method - which is apparently the best of them all
2) Create a Subreport and insert the same crosstab in that subreport. Then using the currentrowindex formula assign the value to a shared variable and pass it back to the Main Report.
This would mean, querying the database twice only to get the row count. And this function in only available in CR 2008 or higher, so I'm assuming you're already on a higher version
3) Create a group on the year field. Then use the GroupNumber special field or a Running total to find the number of years. This requires that the crosstab be placed in a section after the Group. Maybe the Report Footer
Hope this helps!
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.