C++ Builder examples

edited November 2004 in FastReport 3.0
Hi,

I'm using the demo versio of FS 3 in C++ Builder 6 but because the examples are in Delphi I'm struggling to get some things to work. Basically, I need to convert thr following to C++,

procedure TForm1.frxReport1BeforePrint(c: TfrxReportComponent);
var
Cross: TfrxCrossView;
i, j: Integer;
begin
if c is TfrxCrossView then
begin
Cross := TfrxCrossView?©;
for i := 1 to 16 do
for j := 1 to 16 do
Cross.AddValue(, [j], [StringGrid1.Cells[i - 1, j - 1]]);
end;
end;

Most of it is straight forward but i'm struggling with,

Cross.AddValue(, [j], [StringGrid1.Cells[i - 1, j - 1]]);

Can anybody help please?

Some C++ examples would be very beneficial and might tip the scales to make me buy what looks to be a great tool!

Best wishes,

Andy Walker
iola Limited

Comments

  • edited 6:18AM
    Something like this:

    void __fastcall Tshet_faktura::frxReport1BeforePrint(
    TfrxReportComponent *c)
    {
    TfrxCrossView* Cross;

    AnsiString s=c->ClassName();

    if(s == "TfrxCrossView")
    {
    Cross = (TfrxCrossView*)c;
    for (int i = 1 ;i<=16;i++)
    {
    for (int j = 1;j<=16;j++)
    {

    Variant pRows[] = {i};
    Variant pCols[] = {j};
    Variant pStrs[] = {"12345"};
    int nSize = ARRAYSIZE(pStrs);
    Cross->AddValue((const Variant*)pRows,ARRAYSIZE(pRows)-1,
    (const Variant*)pCols,ARRAYSIZE(pCols)-1,
    (const Variant*)pStrs,ARRAYSIZE(pStrs)-1);
    }
    }
    }
    }
  • edited November 2004
    AAh! Thank you.

    Fron that I assume that I would also be able to populate the entire table with one ->AddValue call?

    I'll give that a try!

    Andy

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.