Passing parms from Delphi to frxIbQuery

Ivan Vere??Ivan Vere?? Croatia
edited March 2010 in FastReport 4.0
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):
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)
(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.

Comments

  • edited 10:58PM
    wrote:
    While using "variables" doesn't work?
    Because, Params is a field of TfrxIBXQuery.
    wrote:
    While I must use params sent as string (and expression than value) ?
    You can use following code to set params as Variant:
    wrote:
    (FindComponent('frqPOD') as TfrxIBXQuery).ParamByName('myparam').Value := 5;
  • Ivan Vere??Ivan Vere?? Croatia
    edited 10:58PM
    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!

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.