Printing StringGrid in FastReport in C++ Builder
Hello there, I hope all of you are OK.
I need to know how to print an existing StringGrid from my Form into a new frxReport.
I am developing my project with C++ in C++ Builder XE7, I saw the Demo at Programmer Manual but it is by using Delphi and it's not the same thing. (I mean, I can not understand it jeje)
What I'm doing is to create my Report by using some data from a Query and I also want to add a StringGrid that I have in my Form, that's all.
I tried this (BUT DOESN'T WORK):
I need to know how to print an existing StringGrid from my Form into a new frxReport.
I am developing my project with C++ in C++ Builder XE7, I saw the Demo at Programmer Manual but it is by using Delphi and it's not the same thing. (I mean, I can not understand it jeje)
What I'm doing is to create my Report by using some data from a Query and I also want to add a StringGrid that I have in my Form, that's all.
I tried this (BUT DOESN'T WORK):
TfrxCrossObject * frxCrossObject;
frxCrossObject = new TfrxCrossObject(Page);
//TfrxCrossView * CrossView = (TfrxCrossView*)frxCrossObject;
Variant RowIdx, ColIdx, Text;
int filas = StringGridConsulta->RowCount;
int cols = StringGridConsulta->ColCount;
for(int i = 0; i<cols;i++ ){
for(int j = 0; j <filas;j++){
RowIdx = j;
ColIdx = i;
Text = StringGridConsulta->Cells[i][j];
CrossView->AddValue(&RowIdx, 1, &ColIdx,1,&Text,1);
}
}
I uploaded a file with the whole code that I'm using to create my report and trying to print my StringGrid