Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

getting values in cross tab cells

edited August 2003 in General
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

Comments

  • edited August 2003
    Hi John,

    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.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2003
    Dear Nico
    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


  • edited August 2003
    Hi 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.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.