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

Dynamic fields in CrossTabs

edited January 2002 in General
Hello,

Well... does anybody knows how to create fields dynamicaly in CrossTabs?
I found a function that "seems" to have something about it - SelectValueDef.
But, I don't know how to you it. Does anybody knows?
Thank you very much...

Bruno Nepomuceno

Comments

  • edited January 2002
    Check out the RBuilder.hlp help file for more information on crosstabs.

    procedure TForm1.ppReport1BeforePrint(Sender: TObject);
    var
    lColumnDef: TppColumnDef;
    begin

    ppCrosstab1.InitAvailableDimensions;

    lColumnDef := ppCrosstab1.SelectColumnDef(0);

    lColumnDef.FieldName := 'CustNo';

    end;


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2002
    Thank you very much Cheers, but I'm still having some little problems. It
    worked out, but only when there was any column or row was manually
    configured, I mean, not by code. When I have a empty crossbar, nothing
    happens. What must I do?

  • edited January 2002
    You'll want to create a value defintion first, so that the column will have
    some values.

    procedure CreateCrossTabStuff;
    var
    lColumnDef: TppColumnDef;
    lValueDef: TppValueDef;
    begin

    ppCrosstab1.InitAvailableDimensions;

    lValueDef := ppCrosstab1.SelectValueDef(0);
    lValueDef.FieldName := 'AmountPaid';

    lColumnDef := ppCrosstab1.SelectColumnDef(0);
    lColumnDef.FieldName := 'CustNo';
    end;


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.