TfrxCrossView problem
I'm using FastReport VCL with C++ Builder 6.
I'm trying the fill a TfrxCrossView with the values from a StringGrid but I'm getting an error: EVariantTypeCastError with message 'Could not convert variant of type (String) into type (Double)'
I've been searching the net and the provided FastReport C++ Examples are VERY skimpy.
I a;so had a look at the relevant posts in this forum but that also did not solve my problem.
It seems like the problem arises when I'm trying to add a value to the CrossView that is represented as a string in the StringGrid. The values in the StringGrid reprsented as numericals do not create this problem.
Attached is an example of the stringgrid that I would like to print using the CrossView. If I print only the values from the first two columns it works fine, but when I include the contents of the 3rd column I get this error.
I'm out of ideas and really don't know what to do anymore.
Any help will be appreciated
Thank you
I'm trying the fill a TfrxCrossView with the values from a StringGrid but I'm getting an error: EVariantTypeCastError with message 'Could not convert variant of type (String) into type (Double)'
I've been searching the net and the provided FastReport C++ Examples are VERY skimpy.
I a;so had a look at the relevant posts in this forum but that also did not solve my problem.
It seems like the problem arises when I'm trying to add a value to the CrossView that is represented as a string in the StringGrid. The values in the StringGrid reprsented as numericals do not create this problem.
Attached is an example of the stringgrid that I would like to print using the CrossView. If I print only the values from the first two columns it works fine, but when I include the contents of the 3rd column I get this error.
void __fastcall TfrmReportSettings::CreateImageReport(TfrxReportComponent *Sender)
{
TfrxCrossView *CrossView = (TfrxCrossView*)frxCrossObject;
Variant RowIdx, ColIdx, Text;
CrossView = dynamic_cast <TfrxCrossView *> (Sender);
if(CrossView == NULL) {return;}
try
{
if (chkIncludeAnnotationsInfo->Checked)
{
for (int ColNo = 0; ColNo < ImageForm->AnnotationsInfoGrid->ColCount; ColNo ++)
{
for (int RowNo = 1; RowNo < ImageForm->AnnotationsInfoGrid->RowCount - 1; RowNo ++)
{
RowIdx = RowNo;
ColIdx = ColNo;
Text = ImageForm->AnnotationsInfoGrid->Cells[ColNo][RowNo];
CrossView->AddValue(&RowIdx, 1, &ColIdx, 1, &Text, 1);
}
}
}
}
catch (...)
{
}
}
I'm out of ideas and really don't know what to do anymore.
Any help will be appreciated
Thank you
Comments
Funny, I was considering doing that , don't know why I didn't try it.
Hello, could you explain me that? Please.
Peace