getting values in cross tab cells
Dear all,
I have a cross tab grid, with qualifications along the top and
people down the side. If a person has a qualification then the count in the
field shows 1. The qualification has a status. I want to display the status
in the cell, not the count of records.
I have used the crosstabgetvaluetext procedure as below:
procedure TStaffSkillsForm.ppCrossTab1GetValueText(Sender: TObject;
aElement: TppElement; aColumn, aRow: Integer;
const aDisplayFormat: String; aValue: Variant; var aText: String);
begin
atext:=qskillsgridstatus.asstring;
end;
but is populates every cell with the same value (presumably the value of the
first or last record).
how do I get this value to be assigned as the cross tab is being created?
Incidentally, I have gridlines set to true for the cross tab, but they only
appear vertically, not horizontally, why is this?
regards
John Evans
--
John Evans
Managing Director
Clear Advantage Ltd
www.Clear-Advantage.co.uk
I have a cross tab grid, with qualifications along the top and
people down the side. If a person has a qualification then the count in the
field shows 1. The qualification has a status. I want to display the status
in the cell, not the count of records.
I have used the crosstabgetvaluetext procedure as below:
procedure TStaffSkillsForm.ppCrossTab1GetValueText(Sender: TObject;
aElement: TppElement; aColumn, aRow: Integer;
const aDisplayFormat: String; aValue: Variant; var aText: String);
begin
atext:=qskillsgridstatus.asstring;
end;
but is populates every cell with the same value (presumably the value of the
first or last record).
how do I get this value to be assigned as the cross tab is being created?
Incidentally, I have gridlines set to true for the cross tab, but they only
appear vertically, not horizontally, why is this?
regards
John Evans
--
John Evans
Managing Director
Clear Advantage Ltd
www.Clear-Advantage.co.uk
This discussion has been closed.
Comments
When you set the text value in the GetValueText event, the crosstab
component has already traversed the data in your dataset so you will only be
retreiving the last record. You will either need to re-order the dataset so
that it prints correctly after generation or perhaps use one of the other
CrossTab events to give you results similar to what you are after. Check
the on-line help for information on all the CrossTab events.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I checked the help files, and looked at 20 different demos without
finding the answer, that is why I am asking the newsgroup.
Do you know the answer?
regards
John
The crosstab contains its own traversal engine. You will not be able to
simply add values into individual cells during the regular report traversal.
Your best solution would be to create a new calculated field in your dataset
that will automatically print the value of the qskillsgridstatus value.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com