Skip to Content
Dec 19, 2017 at 01:13 PM

Crystal Reports gridvalueat is out of range

336 Views Last edit Dec 19, 2017 at 01:14 PM 2 rev

I have a report that has two parameters (years) and if a user selects, for example, 2013 - 2015, then I have to make the report generate the yearly difference in each year. Since the only parameters are the begin year and end year, I have to do something for the middle year. The parameters are strings and when I try this to get the middle year, I get the "gridvalueat is out of range" error. The formula I'm using is:

GridValueAt(CurrentRowIndex, GetColumnPathIndexOf({?year2}), CurrentSummaryIndex) - GridValueAt(CurrentRowIndex, GetColumnPathIndexOf( Totext(tonumber({?year2}) - 1 ) ), CurrentSummaryIndex)

It's the GetColumnPathIndexOf( Totext(tonumber({?year2}) - 1 ) ) that's causing the error... Help, please?