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:
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

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.