Put a value from form in a report
Hi!
First, I inserted a frxUserDataSet on the form and edited its property ???Fields???.
I wrote one string in it: ???field_1???:
frxUserDataSet
After that I have defined a button on the form and defined an event OnClick for it:
After start the program and push the button, the StatusBar1 looks like this:
Statusbar
1. Why does the couter of fields count "2" (I have defined only 1)?
2. Is it correct, that the function ???frxUserDataSet1->Fields->Values["field_1"]??? can both: put data into and get data from a field?
I would like to show the value of the field in a report. In the report I have defined a field as follows:
FastReport
After I start the report, I did not get a value ???FIELD_1??? but ???0??? instead.
What have I done wrong?
Thank you
First, I inserted a frxUserDataSet on the form and edited its property ???Fields???.
I wrote one string in it: ???field_1???:
frxUserDataSet
After that I have defined a button on the form and defined an event OnClick for it:
void __fastcall TForm1::Button3Click(TObject *Sender)
{
frxUserDataSet1->Fields->Values["field_1"] = "FIELD_1";
StatusBar1->SimpleText = IntToStr(frxUserDataSet1->FieldsCount()) +
"@" +
frxUserDataSet1->Fields->Values["field_1"] +
"@";
}
After start the program and push the button, the StatusBar1 looks like this:
Statusbar
1. Why does the couter of fields count "2" (I have defined only 1)?
2. Is it correct, that the function ???frxUserDataSet1->Fields->Values["field_1"]??? can both: put data into and get data from a field?
I would like to show the value of the field in a report. In the report I have defined a field as follows:
FastReport
After I start the report, I did not get a value ???FIELD_1??? but ???0??? instead.
What have I done wrong?
Thank you