Access violation exception with Variables of fastreport 6 C++ RIO
Hi, with fastrepots 5 and Embarcadero C++ Seattle (10.1) the code below worked perfectly
FormFastReport5->frxReport1->LoadFromFile(DIR_REPORT "frxRepMenH2.fr3", true);
FormFastReport5->frxReport1->Variables->Clear();
FormFastReport5->frxReport1->Variables->Variables["fechaIni"] = fecha_inicial;
FormFastReport5->frxReport1->Variables->Variables["fechaFin"] = fecha_final;
FormFastReport5->frxReport1->ShowReport(true);
Now I have moved to the new Embarcadero C++ Rio (10.3.1) and fastreports vcl 6, and the same code does not work
it is not possible to give values to the variables used by the frxReport1 as before, it produces access violation exception.
I have to use the OnGetValue event to do it. See below
void __fastcall frxReport1GetValue(const UnicodeString VarName, Variant &Value);
void __fastcall TFormFastReport5::frxReport1GetValue(const UnicodeString VarName, Variant &Value) {
if (VarName == "fechaIni")
Value = fecha_inicial;
else if (VarName == "fechaFin")
Value = fecha_final;
}
Any use of FormFastReport5->frxReport1->Variables gives access violation exceptio in fastreports vcl 6 and Embarcadero C++ Rio,
even the simple FormFastReport5->frxReport1->Variables->Clear();
Please, some clue about [img]style_emoticons/<#EMO_DIR#>/blink.gif" style="vertical-align:middle" emoid=":blink:" border="0" alt="blink.gif" /> Santiago[/img]
FormFastReport5->frxReport1->LoadFromFile(DIR_REPORT "frxRepMenH2.fr3", true);
FormFastReport5->frxReport1->Variables->Clear();
FormFastReport5->frxReport1->Variables->Variables["fechaIni"] = fecha_inicial;
FormFastReport5->frxReport1->Variables->Variables["fechaFin"] = fecha_final;
FormFastReport5->frxReport1->ShowReport(true);
Now I have moved to the new Embarcadero C++ Rio (10.3.1) and fastreports vcl 6, and the same code does not work
it is not possible to give values to the variables used by the frxReport1 as before, it produces access violation exception.
I have to use the OnGetValue event to do it. See below
void __fastcall frxReport1GetValue(const UnicodeString VarName, Variant &Value);
void __fastcall TFormFastReport5::frxReport1GetValue(const UnicodeString VarName, Variant &Value) {
if (VarName == "fechaIni")
Value = fecha_inicial;
else if (VarName == "fechaFin")
Value = fecha_final;
}
Any use of FormFastReport5->frxReport1->Variables gives access violation exceptio in fastreports vcl 6 and Embarcadero C++ Rio,
even the simple FormFastReport5->frxReport1->Variables->Clear();
Please, some clue about [img]style_emoticons/<#EMO_DIR#>/blink.gif" style="vertical-align:middle" emoid=":blink:" border="0" alt="blink.gif" /> Santiago[/img]
Comments
In the imported project file remained references to previous fastreports 5 mixed with fastreports 6 (old project from EMBARCADERO 10.1 with fastreports 5 to new EMBARCADERO 10.3 with fastreports 6)
Santiago