CrossTab, How to get text into TagStr of a cell's memo?
I have a cross tab that displays a StudentName in the first column, SubjectCode in the first row and the Grade for each student / subject in the cells.
The dataset also holds the StudentID (string) but this is not displayed.
I want to use the OnClickObject event of the report so that if a cell in the crosstab is clicked I can obtain The StudentID and SubjectCode. Then I intend to run some other sql and display some other data to do with that StudentID and SubjectCode.
Using VarToStr(ColumnValues[0]) in the OnPrintCell event I can get the subject code for the cell and put it into the TagStr of the cell's memo so that I can parse it out later but I can't see how to get the correct StudentID in there as well.
ie this does not work, I get the last StudentID not the current one.
I think it might be possible to do it by putting the StudentID into the tagstr of the relevant memo in Row0OnBeforePrint event and then copy it from there to the cell's TagStr in the OnPrintCell event but I have no idea of the syntax to do either of these.
Am I on the right track or is there an better way?
Can anyone help with the correct syntax to get the two bits of data that I require inside the cell's tagstr?
Howard
The dataset also holds the StudentID (string) but this is not displayed.
I want to use the OnClickObject event of the report so that if a cell in the crosstab is clicked I can obtain The StudentID and SubjectCode. Then I intend to run some other sql and display some other data to do with that StudentID and SubjectCode.
Using VarToStr(ColumnValues[0]) in the OnPrintCell event I can get the subject code for the cell and put it into the TagStr of the cell's memo so that I can parse it out later but I can't see how to get the correct StudentID in there as well.
ie this does not work, I get the last StudentID not the current one.
memo.tagstr :=memo.tagstr + ' ID:' + <frxDsGradeData."ID"> + ' SubjectCode:' + VarToStr(ColumnValues[0])
I think it might be possible to do it by putting the StudentID into the tagstr of the relevant memo in Row0OnBeforePrint event and then copy it from there to the cell's TagStr in the OnPrintCell event but I have no idea of the syntax to do either of these.
Am I on the right track or is there an better way?
Can anyone help with the correct syntax to get the two bits of data that I require inside the cell's tagstr?
Howard
Comments
Thanks gpi.
I went to bed last night thinking about this problem and woke up this morning with exactly the same idea!
Glad to have it confirmed by somebody whose opinions I respect.
Howard