Help - Search - Members - Calendar
Full Version: Passing parms from Delphi to frxIbQuery
Fast Reports forum > Fast Reports Products > FastReport 4.0
Ivan Vereš
Hello to all!

I am new in FR4.

In my Delphi app I call report that have own datasets (frIbxQuery-es) with params in sql.
Params are SmallInt type. Before opening report I want to tell frIbxQuery these params from delphi code.

Param is declared in frIbxQuery params, and not at any other place.

I tried to use code from Delphi (after loading from file, previous preparing and showing):

CODE
Variables['myparam'] := 5;
(5 is some smallint value) but FR doesn't set param at this way.

Then I used this approach (my own Idea from delphi programming experience)

CODE
(FindComponent('frqPOD') as TfrxIBXQuery).ParamByName('myparam').Expression := IntToStr(5);


and it's worked!

While I must use params sent as string (and expression than value) ?
While using "variables" doesn't work?

And finally, what is correct, fastest and most used way to passing params from delphy to frxIBquery params ?

Thanks to suggestions.
OlegK
QUOTE
While using "variables" doesn't work?
Because, Params is a field of TfrxIBXQuery.
QUOTE
While I must use params sent as string (and expression than value) ?
You can use following code to set params as Variant:
QUOTE
(FindComponent('frqPOD') as TfrxIBXQuery).ParamByName('myparam').Value := 5;
Ivan Vereš
Now, after five days of using and programming all is clear, and I use all variations of params and variables inside, and outside report without any problems.

Thanks!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.