cancel
Showing results for 
Search instead for 
Did you mean: 

Cross tab. Number of rows

Former Member
0 Kudos

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).

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

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

Answers (0)