Link to home
Start Free TrialLog in
Avatar of tsmusser
tsmusser

asked on

Nested Datawindows

I have a report with a nested datawindow on it.  The main report can be printed using many different parameters, but certain parameters entered only apply to the nested datawindow.  How do I modify the SQL of the nested datawindow to retrieve using the specified parameters?  I am using PowerBuilder 7.0.3, Build 10108.  Thanks in advance.

Terry


Avatar of vikas1711
vikas1711

Ure question is a bit unclear.
Please provide more information on that.
Which DB r u trying to connect?

I am assuming that u are using Oracle as DB

Solution 1:
Declare all the parameters in Main Report DW(req by main DW or nested DW) as retrieval arguments.
Nested DW provides an option to link the retrieval arguments with their parameter in property tab.

Solution 2.
If there is a case in nested like for eg.
If the emp code is present retrieve the details for that employee and if emp code is not present retrieve all the emp details.
In such a case first approach will work but uhave to change the SQL of nested DW.
If the DB is Oracle try using NVL command.
Select * from table
where col1 = nvl(:arg1,col1)

So if the argment is null then itgets a condition like 1=1 and if argument is present then it is like" where col1 = :arg1)
APPLY THIS CONDITION FOR ALL THE JOINS

Regards
vikas
Avatar of tsmusser

ASKER

Thanks for your response.  I will explain a little more.  I am using SQL Server.  I understand solution 1, but the user may supply different combinations of the retrieval arguments.  I want to be able to parse the sql of the nested datawindow and put it back together with the retrieval criteria entered by the user.  Or even be able to filter the nested datawindow, if I have to.

Terry
ASKER CERTIFIED SOLUTION
Avatar of Bhatti
Bhatti

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Bhatti,

I will try this and let you know if it works.

Thanks,
Terry
Have you tried using a Modify() call?

Modify would allow you to change the WHERE clause of your retrieval statement.  And I'm not sure about adding columns, but Modify() should also allow you to remove columns.

Brian