Passing Values from Delphi to an internal dbxQuery
Hi All,
I try to pass parameter Values to an internal DBXQuery on my Report like this:
frxReport1.Variables := ''''+IntToStr(Kunde)+'''';
frxReport1.Variables := ''''+'KA'+'''';
The variables are defined in the Variables Section of the Report,
The Parameters are in the SQL of the Query (assigned to the Variables).
In the Delphi Debugger the Values appear with 3 quotes.
Showing the report crashes Delphi.
The Information in the programmers Manual is a minimum, I do not understand how to do it correctly.
Would someone please explain to me how to pass an integer / string parameter to an SQL Query inside a Report?
Thank you
Rolf
I try to pass parameter Values to an internal DBXQuery on my Report like this:
frxReport1.Variables := ''''+IntToStr(Kunde)+'''';
frxReport1.Variables := ''''+'KA'+'''';
The variables are defined in the Variables Section of the Report,
The Parameters are in the SQL of the Query (assigned to the Variables).
In the Delphi Debugger the Values appear with 3 quotes.
Showing the report crashes Delphi.
The Information in the programmers Manual is a minimum, I do not understand how to do it correctly.
Would someone please explain to me how to pass an integer / string parameter to an SQL Query inside a Report?
Thank you
Rolf
Comments
remember when you are trying to assign values to a categorized variable in the report you must run the
compiled exe created by the project
if you are already doing this , insteadof calling shown reportcall design report and see what value you have passed into the variable
the usual error when passing string values is not enough string delimiters
then I open the designer and preview the report.
After receiving your Answer I tried and started the .exe.
The report is not created.
No crash.
Rolf
I use integer values as well, do they have to be passed as strings as well?
passing values to categorized variables
frxReport3.Variables := 10;
frxReport3.Variables := ''''+'sometext'+''''; //string
frxreport3.Variables := ''''+sintkij+''''; // Delphi string variable
frxreport3.Variables := false; // boolean
I changed the Routines as you wrote.
The Report (1Page) shows nothing, takes a lot of Time (30 sec.) , as does the following Export.
No more Crashing.
In Debugger I get to a procedure "EngineRun" with no result / return to my Program
Rolf
purchased basic, pro, enterprise or embarcadero version or fmx
send me the code where you are setting up the report
gord@fast-report.com
Got a solution. The Parameter is passed by "frxReport1.Variables.Variables := SomeValue.
Another thing that might help: The unit "frxDBXComponents" is not added to the uses clause automatically, one has to do that by oneself. Might be the case for the other internal DB Components as well.
Thank you for your help.
Rolf