Printing TEdit, TStringGrid
Hello!
I have several TEdit and TStringGrid to print. The frxDBDataSet component requires the use of a table BDD thing I want to avoid (I let the choice to the user to print the data entered directly without saving and I also put calculations in TEdit) . I thought about using the frxUserDataSet component. I added some lines corresponding to TEdit.Text through frxUserDataSet.Fields.
Now I want to change the values of the added fields but I dry (I look for code similar to one of the following instructions):
frxUserDataSet->FieldByName["champ1"]->AsString = Edit1->Text;
frxUserDataSet->Fields->Strings[0] = Edit1->Text;
I get also an error when I write TfrxCrossView *c (unknown type)!
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);
}
}
}
}
I have several TEdit and TStringGrid to print. The frxDBDataSet component requires the use of a table BDD thing I want to avoid (I let the choice to the user to print the data entered directly without saving and I also put calculations in TEdit) . I thought about using the frxUserDataSet component. I added some lines corresponding to TEdit.Text through frxUserDataSet.Fields.
Now I want to change the values of the added fields but I dry (I look for code similar to one of the following instructions):
frxUserDataSet->FieldByName["champ1"]->AsString = Edit1->Text;
frxUserDataSet->Fields->Strings[0] = Edit1->Text;
I get also an error when I write TfrxCrossView *c (unknown type)!
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);
}
}
}
}
Comments
I read in the documentation : How can I add this object to my project ?