Grouping by TppVarable variable...
Hi,
How can I group by TppVariable variable?
I tried to indicate my variable (say MyVariable1) as the custom group field
in the group settings but to no avail. Then I tried the following code in
the Group1OnGetBreakValue event:
"BreakValue:=MyVariable1.Value;"
but still no grouping happens.
I checked the MyVariable1.Value and yes, it fills correctly.
MyVariable1OnCalc event has the following code:
"Value := Copy(body['NAME'],1,1);"
My aim is to group fields by the first letter in the "Name" field.
I tried to do it through TppLabel variable and everything worked perfectly.
But the question is how to group by TppVariable variable?
Thank you,
MB
How can I group by TppVariable variable?
I tried to indicate my variable (say MyVariable1) as the custom group field
in the group settings but to no avail. Then I tried the following code in
the Group1OnGetBreakValue event:
"BreakValue:=MyVariable1.Value;"
but still no grouping happens.
I checked the MyVariable1.Value and yes, it fills correctly.
MyVariable1OnCalc event has the following code:
"Value := Copy(body['NAME'],1,1);"
My aim is to group fields by the first letter in the "Name" field.
I tried to do it through TppLabel variable and everything worked perfectly.
But the question is how to group by TppVariable variable?
Thank you,
MB
This discussion has been closed.
Comments
A TppVariable's OnCalc event does not use the same timing structure as the
rest of the report. The reason a TppLable was working is probably due to
the fact that you were using the TppLabel.OnGetText event. You could
possibly use the TppVariable's OnGetText event to get the results, but I
would recommend first creating another column in your dataset using SQL to
get the first letter of the "Name" field, then grouping on that field.
Below is an example I created using the DBDEMOS database that does exactly
that.
http://www.digital-metaphors.com/tips/GroupByFirstLetter.zip
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
seems to work alright.