Using Databases in Interpreter
Hi,
my question:
can I do in the OnBeforePrint the following things?
Query.close
Query.Params[0] = NewValue
Query.Open
myNewValue = [Query."fieldname"]
I couldn't find a documentation about this
Thanks
Willi
my question:
can I do in the OnBeforePrint the following things?
Query.close
Query.Params[0] = NewValue
Query.Open
myNewValue = [Query."fieldname"]
I couldn't find a documentation about this
Thanks
Willi
Comments
which obp band or report component?
where is query fr dialog or delphi form/dm ?
I now found the following: In the OnBeforePrint of a MasterData band I entered this code: (the qry's SQLtext works with a Variable "aktLayout" as Parameter)
begin
DialogForm.qry.Close;
aktLayout := 1706;
DialogForm.qry.Open;
showband(child1);
DialogForm.qry.Close;
aktLayout := 1707;
DialogForm.qry.Open;
showband(child1);
end
On a childband I print a DB-Field of qry. This works, but I get only 2 times the value with aktLayout=1707.
How can I do this correctly ?
Thanks
if you are trying to change the layout if a particular value is encountered in the md band and the Child belongs to mdBand or a band after
then in obp of mdband
if expression := true then
change the connection of the mdband to which child you want and set the childbands' visible propertys accordingly.
but of course it's OK, when it shows the child band only 2 times.
But the first time it should show in the child the DB-Values with the parameter 1706, and the second time it should show the DB-Values of the parameter 1707. Both times it shows onyl the Values of parameter 1707
That's my problem.
Willi
aktLayout := 1707;
DialogForm.qry.Open;
showband(child1);
end
it seems like the query is not being reset.
this may be a problem when using the same query as the mdband is using.
But try this
give your query a name like query1 if you have more than 1 query on your dialog form.
and try this
query1.Close;
aktLayout := 1707;
query1.Open;
showband(child1);
end
but, I have only one query and this query has it's name.
You can close a query, then set a parameter, then open the query, then it should show the new dataset, which I select with this "Where"-parameter
... and it has nothing to do with a "Reset", because it shows the values of the last parameter in all bands.
Willi