Using input Var from TfrxEditControl in Dialog Box

Hi,

I'm very new to FastReport 4.0 but I'll try to be clear as possible. Of course I already looked for hints or answers to my wonderings through the forum but I didn't find anything helpful or anything easily understandable. I also read the official documentation, both user & programmer but still couldn't find any answer to the question: how to get input value from TfrxEditControl in a Dialog Box to use it in a sql query?

I know how to use it in a report through the [ObjectName.Text] property but how do I use it in my sql query?
I managed to be able to use value returned from a dropdown list using a dataset by using related master-detail queries, but here I expect an input value, does anyone have any clue?

More details below
Right now I have a Dialog Box TfrXEditControl object named : InputZipCode
When I'm using the input value in the report I have no problem displaying it using [InputZipCode.Text].

I also have an IBX Component with the following simple SQL query: SELECT p.lastname, p.firstname FROM People p WHERE ZipCode like '38%'
The query works just fine and produces expected results: people living in places where the zip code starts with "38".

I want to replace "38" by the [InputZipCode.Text] value that should be transmitted through the Dialog Box but I simply can't do it. What do you think I'm doing wrong here? And I'm also unsure about the sql syntax to use with the var name. Shoud it be something like: SELECT p.lastname, p.firstname FROM People p WHERE ZipCode like ''' || TheCorrectVarName || '%' ?

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 5:55PM
    parameterize the query statement using for example =: p1
    in the param editor set the value and type for the parameter.
    see the main demo internal datasets internal query report.

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.