frxCrossView

BJLBJL Brussels, Belgium
edited 7:07PM in FastReport 3.0
FR304 and BCB6

Could you please indicate how to use AddValue from frxCrossView in BCB6?
In Delphi the function requests 3 parameters. In C++, it seems different. I have tried usinf the OPENARRAY macro without success.

Thanks.

BJL

Comments

  • BJLBJL Brussels, Belgium
    edited 7:07PM
    I am trying to fill a DBCrossView using the following code. But I get an error at the AddValue line saying "Bad Variant type". I admit I have a pour experience on working with Variant. Can someone helps?

    void __fastcall TForm1::frxReport2BeforePrint(TfrxReportComponent *Sender)
    {
    TfrxDBCrossView* Cross;
    if (dynamic_cast<TfrxDBCrossView*>(Sender))
    {
    Cross = dynamic_cast<TfrxDBCrossView*>(Sender);
    dsStat->First();
    while (!dsStat->Eof)
    {
    for (int i = 4; i < dsStat->Fields->Count; i++)
    {
    Variant RH[2] = {dsStat->Fields->Fields[1]->AsString, dsStat->Fields->Fields[3]->AsString};
    Variant CH[1] = {dsStat->Fields->Fields->DisplayLabel};
    Variant C[1] = {dsStat->Fields->Fields->AsFloat};
    Cross->AddValue(RH, 2, CH, 1, C, 1); }
    dsStat->Next();
    }
    }
    }

    Thanks

    BJL

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.