Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Nested Datawindows

Posted on 2002-06-05
7
Medium Priority
?
867 Views
Last Modified: 2013-12-26
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


0
Comment
Question by:tsmusser
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 

Expert Comment

by:vikas1711
ID: 7058570
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
0
 

Author Comment

by:tsmusser
ID: 7059032
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
0
 
LVL 4

Accepted Solution

by:
Bhatti earned 300 total points
ID: 7066585
Say your nested report dw_nested is build from dw_1 and dw_2.

These dw_1. and dw_2 are the child datawindow of the dw_nested.

With the help of the function GetChild() (See in Help GetChil()) you can declare your child datawindows.
Set transaction for these datawindows.

Please for the Childdatawindows no retrieve.

Filter the data for the childdatawindows.

I don't know exactly what you want to do the nested report, how many datawindows includein this report and whyt type of data you want to retrieve or Filter and etc.

explain more, If this solution is not acceptable.

Best regards

Bhatti
0
 

Author Comment

by:tsmusser
ID: 7066793
Bhatti,

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

Thanks,
Terry
0
 

Expert Comment

by:bpringle
ID: 7191283
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
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question