embedding a datawindow within a datawindow

Below is a sample of the format for a report I need to
create.  The report will display courses that may or may not
be part of group, because the people running the courses can
choose from all the courses available to create their own
"group" of courses.  Since a course may or may not be part
of a group would using an embedded datawindow for the group
info work?  How?  Can anyone point me in the right
direction?  The data is coming from two tables.

Thanks,
Kevin


CourseID  CourseTitle	CourseTopic	EnrollMax  EnrollCurrent
100145A   "Sample"	"Sample"	35	     27

		Group#		Instructor	
		CD2314		M. Pourse
		QA7214		E. Donelt
		CD2141		M. Harrison
		WW2314	        J. Dawinder

CourseID  CourseTitle	CourseTopic	EnrollMax  EnrollCurrent
107512B   "Sample"	"Sample"	35	     27
  (currently, this course has not been chosen for any
groups)

CourseID  CourseTitle	CourseTopic	EnrollMax  EnrollCurrent
101174A   "Sample"	"Sample"	35	     27

		Group#		Instructor	
		RE7415		P. Assafa
	

	
-2
Kevin
8/23/2006 3:37:29 PM
sybase.powerbuilder.datawindow 28057 articles. 5 followers. Follow

10 Replies
1037 Views

Similar Articles

[PageSpeed] 17
Get it on Google Play
Get it on Apple App Store

Hi Kevin,

As I see, what you need to do is just create a nested report inside your 
main dw. Create an extra dw with the group information, and call it from 
the main dw using parameters. When there are no groups associated, your 
parameters will retrieve 0 rows, and no group information will appear.

Gabriel

Kevin wrote:
> Below is a sample of the format for a report I need to
> create.  The report will display courses that may or may not
> be part of group, because the people running the courses can
> choose from all the courses available to create their own
> "group" of courses.  Since a course may or may not be part
> of a group would using an embedded datawindow for the group
> info work?  How?  Can anyone point me in the right
> direction?  The data is coming from two tables.
> 
> Thanks,
> Kevin
> 
> 
> CourseID  CourseTitle	CourseTopic	EnrollMax  EnrollCurrent
> 100145A   "Sample"	"Sample"	35	     27
> 
> 		Group#		Instructor	
> 		CD2314		M. Pourse
> 		QA7214		E. Donelt
> 		CD2141		M. Harrison
> 		WW2314	        J. Dawinder
> 
> CourseID  CourseTitle	CourseTopic	EnrollMax  EnrollCurrent
> 107512B   "Sample"	"Sample"	35	     27
>   (currently, this course has not been chosen for any
> groups)
> 
> CourseID  CourseTitle	CourseTopic	EnrollMax  EnrollCurrent
> 101174A   "Sample"	"Sample"	35	     27
> 
> 		Group#		Instructor	
> 		RE7415		P. Assafa
> 	
> 
> 	
-2
Gabriel
8/23/2006 3:53:01 PM
<Kevin> wrote in message news:44ec7639.69d1.1681692777@sybase.com...
> Below is a sample of the format for a report I need to
> create.  The report will display courses that may or may not
> be part of group, because the people running the courses can
> choose from all the courses available to create their own
> "group" of courses.  Since a course may or may not be part
> of a group would using an embedded datawindow for the group
> info work?  How?  Can anyone point me in the right
> direction?  The data is coming from two tables.

You could also use a outer join with the appropriate presentation style 
(tabular, grouped) to achieve this look.  This approach would avoid the 
automatic invocation of print-preview mode and would allow easier control 
over the presentation for courses that are not part of a group. It will also 
likely be much faster to retrieve. 


0
Scott
8/23/2006 4:01:03 PM
Nested reports are painfully slow and as a result are no use
in this case.  On top of that, the nested dw does not
retrieve anything even though I have assigned the value from
the main dw to be the retrieval argument.  Even testing this
extremely slow.    Maybe I am doing something wrong to cause
the speed issue?

Thanks,
Kevin

> Hi Kevin,
>
> As I see, what you need to do is just create a nested
> report inside your  main dw. Create an extra dw with the
> group information, and call it from  the main dw using
> parameters. When there are no groups associated, your
> parameters will retrieve 0 rows, and no group information
> will appear.
>
> Gabriel
>
> Kevin wrote:
> > Below is a sample of the format for a report I need to
> > create.  The report will display courses that may or may
> > not be part of group, because the people running the
> > courses can choose from all the courses available to
> > create their own "group" of courses.  Since a course may
> > or may not be part of a group would using an embedded
> > datawindow for the group info work?  How?  Can anyone
> > point me in the right direction?  The data is coming
> > from two tables.
> > Thanks,
> > Kevin
> >
> >
> > CourseID  CourseTitle    CourseTopic    EnrollMax
> > EnrollCurrent 100145A   "Sample"    "Sample"    35
> >   27
> >         Group#        Instructor
> >         CD2314        M. Pourse
> >         QA7214        E. Donelt
> >         CD2141        M. Harrison
> >         WW2314            J. Dawinder
> >
> > CourseID  CourseTitle    CourseTopic    EnrollMax
> > EnrollCurrent 107512B   "Sample"    "Sample"    35
> >     27 (currently, this course has not been chosen for
> > any groups)
> >
> > CourseID  CourseTitle    CourseTopic    EnrollMax
> > EnrollCurrent 101174A   "Sample"    "Sample"    35
> >   27
> >         Group#        Instructor
> >         RE7415        P. Assafa
> >
> >
> >
1
Kevin
8/23/2006 7:51:04 PM
When you execute only your SQL statement into the database, is it slow 
too? Also, when you pass the retrieval arguments manually in design 
time, can you see the data?

Kevin wrote:
> Nested reports are painfully slow and as a result are no use
> in this case.  On top of that, the nested dw does not
> retrieve anything even though I have assigned the value from
> the main dw to be the retrieval argument.  Even testing this
> extremely slow.    Maybe I am doing something wrong to cause
> the speed issue?
> 
> Thanks,
> Kevin
> 
>> Hi Kevin,
>>
>> As I see, what you need to do is just create a nested
>> report inside your  main dw. Create an extra dw with the
>> group information, and call it from  the main dw using
>> parameters. When there are no groups associated, your
>> parameters will retrieve 0 rows, and no group information
>> will appear.
>>
>> Gabriel
>>
>> Kevin wrote:
>>> Below is a sample of the format for a report I need to
>>> create.  The report will display courses that may or may
>>> not be part of group, because the people running the
>>> courses can choose from all the courses available to
>>> create their own "group" of courses.  Since a course may
>>> or may not be part of a group would using an embedded
>>> datawindow for the group info work?  How?  Can anyone
>>> point me in the right direction?  The data is coming
>>> from two tables.
>>> Thanks,
>>> Kevin
>>>
>>>
>>> CourseID  CourseTitle    CourseTopic    EnrollMax
>>> EnrollCurrent 100145A   "Sample"    "Sample"    35
>>>   27
>>>         Group#        Instructor
>>>         CD2314        M. Pourse
>>>         QA7214        E. Donelt
>>>         CD2141        M. Harrison
>>>         WW2314            J. Dawinder
>>>
>>> CourseID  CourseTitle    CourseTopic    EnrollMax
>>> EnrollCurrent 107512B   "Sample"    "Sample"    35
>>>     27 (currently, this course has not been chosen for
>>> any groups)
>>>
>>> CourseID  CourseTitle    CourseTopic    EnrollMax
>>> EnrollCurrent 101174A   "Sample"    "Sample"    35
>>>   27
>>>         Group#        Instructor
>>>         RE7415        P. Assafa
>>>
>>>
>>>
0
Gabriel
8/23/2006 9:17:08 PM
If the nested datawindow is not retrieving anything, then you have something set
up incorrectly. (Happens to me, too, since I use nested dw's so rarely.) Once
fixed, it may very possibly help your performance concerns. However, I doubt
that you'll be satisfied. Using a nested report is worse than putting code in
the RetrieveRow event. Not only does the datawindow now bring back rows one at a
time, but it also issues a new SELECT statement for each row to populate the
nested report.

If I were tasked with this, I would do a LEFT JOIN from the courses to the
groups. The columns that you were going to put in the nested report would go in
your detail band; you group by the other columns and put those other columns in
the group header band. Shrink the detail band and "autosize height" it. You
might even add a text object to the detail band that's only visible when the
group data is NULL to show the "not chosen for groups" message.


On 23 Aug 2006 12:51:04 -0700,
 in sybase.public.powerbuilder.datawindow
 <Kevin> wrote: 
>Nested reports are painfully slow and as a result are no use
>in this case.  On top of that, the nested dw does not
>retrieve anything even though I have assigned the value from
>the main dw to be the retrieval argument.  Even testing this
>extremely slow.    Maybe I am doing something wrong to cause
>the speed issue?
>
>Thanks,
>Kevin
>
>> Hi Kevin,
>>
>> As I see, what you need to do is just create a nested
>> report inside your  main dw. Create an extra dw with the
>> group information, and call it from  the main dw using
>> parameters. When there are no groups associated, your
>> parameters will retrieve 0 rows, and no group information
>> will appear.
>>
>> Gabriel
>>
>> Kevin wrote:
>> > Below is a sample of the format for a report I need to
>> > create.  The report will display courses that may or may
>> > not be part of group, because the people running the
>> > courses can choose from all the courses available to
>> > create their own "group" of courses.  Since a course may
>> > or may not be part of a group would using an embedded
>> > datawindow for the group info work?  How?  Can anyone
>> > point me in the right direction?  The data is coming
>> > from two tables.
>> > Thanks,
>> > Kevin
>> >
>> >
>> > CourseID  CourseTitle    CourseTopic    EnrollMax
>> > EnrollCurrent 100145A   "Sample"    "Sample"    35
>> >   27
>> >         Group#        Instructor
>> >         CD2314        M. Pourse
>> >         QA7214        E. Donelt
>> >         CD2141        M. Harrison
>> >         WW2314            J. Dawinder
>> >
>> > CourseID  CourseTitle    CourseTopic    EnrollMax
>> > EnrollCurrent 107512B   "Sample"    "Sample"    35
>> >     27 (currently, this course has not been chosen for
>> > any groups)
>> >
>> > CourseID  CourseTitle    CourseTopic    EnrollMax
>> > EnrollCurrent 101174A   "Sample"    "Sample"    35
>> >   27
>> >         Group#        Instructor
>> >         RE7415        P. Assafa
>> >
>> >
>> >
0
Jason
8/23/2006 9:39:36 PM
You can do this with a single query.  Do a LEFT OUTER JOIN from the Course 
to the Group table (hard to be exact without specific DDL to reference...). 
Create a group on the CourseID column, and drag the course-related columns 
up into the group header band.

Paul Horan[TeamSybase]

<Kevin> wrote in message news:44ec7639.69d1.1681692777@sybase.com...
> Below is a sample of the format for a report I need to
> create.  The report will display courses that may or may not
> be part of group, because the people running the courses can
> choose from all the courses available to create their own
> "group" of courses.  Since a course may or may not be part
> of a group would using an embedded datawindow for the group
> info work?  How?  Can anyone point me in the right
> direction?  The data is coming from two tables.
>
> Thanks,
> Kevin
>
>
> CourseID  CourseTitle CourseTopic EnrollMax  EnrollCurrent
> 100145A   "Sample" "Sample" 35      27
>
> Group# Instructor
> CD2314 M. Pourse
> QA7214 E. Donelt
> CD2141 M. Harrison
> WW2314         J. Dawinder
>
> CourseID  CourseTitle CourseTopic EnrollMax  EnrollCurrent
> 107512B   "Sample" "Sample" 35      27
>  (currently, this course has not been chosen for any
> groups)
>
> CourseID  CourseTitle CourseTopic EnrollMax  EnrollCurrent
> 101174A   "Sample" "Sample" 35      27
>
> Group# Instructor
> RE7415 P. Assafa
>
>
> 

0
Paul
8/24/2006 3:42:18 PM
Okay, I have it working, but now I would like to pass
arguments to the nested datawindow.  Specifically, the
teacher's name (name of the instructor who created the
group).  There does not seem to be a way to do this.  It
looks like I am only allowed to pass arguments that come
directly from the main dw data.

Thanks,
Kevin

> Nested reports are painfully slow and as a result are no
> use in this case.  On top of that, the nested dw does not
> retrieve anything even though I have assigned the value
> from the main dw to be the retrieval argument.  Even
> testing this extremely slow.    Maybe I am doing something
> wrong to cause the speed issue?
>
> Thanks,
> Kevin
>
> > Hi Kevin,
> >
> > As I see, what you need to do is just create a nested
> > report inside your  main dw. Create an extra dw with the
> > group information, and call it from  the main dw using
> > parameters. When there are no groups associated, your
> > parameters will retrieve 0 rows, and no group
> > information will appear.
> >
> > Gabriel
> >
> > Kevin wrote:
> > > Below is a sample of the format for a report I need to
> > > create.  The report will display courses that may or
> > > may not be part of group, because the people running
> > > the courses can choose from all the courses available
> > > to create their own "group" of courses.  Since a
> > > course may or may not be part of a group would using
> > > an embedded datawindow for the group info work?  How?
> > > Can anyone point me in the right direction?  The data
> > > is coming from two tables.
> > > Thanks,
> > > Kevin
> > >
> > >
> > > CourseID  CourseTitle    CourseTopic    EnrollMax
> > > EnrollCurrent 100145A   "Sample"    "Sample"    35
> > >   27
> > >         Group#        Instructor
> > >         CD2314        M. Pourse
> > >         QA7214        E. Donelt
> > >         CD2141        M. Harrison
> > >         WW2314            J. Dawinder
> > >
> > > CourseID  CourseTitle    CourseTopic    EnrollMax
> > > EnrollCurrent 107512B   "Sample"    "Sample"    35
> > >     27 (currently, this course has not been chosen for
> > > any groups)
> > >
> > > CourseID  CourseTitle    CourseTopic    EnrollMax
> > > EnrollCurrent 101174A   "Sample"    "Sample"    35
> > >   27
> > >         Group#        Instructor
> > >         RE7415        P. Assafa
> > >
> > >
> > >
0
Kevin
8/24/2006 5:04:56 PM
> It
> looks like I am only allowed to pass arguments that come
> directly from the main dw data.

Is there any way to get this value (the teacher's name) into the main 
datawindow's result set?  Can you modify the SQL statement for the main 
datawindow and add this column?

Paul Horan[TeamSybase] 


0
Paul
8/24/2006 5:18:40 PM
No, so I guess my problem is I need to send one argument to
the nested datawindow from the detail row itself and two
more arguments to the nested datawindow that were used to
retrieve the main datawindow.  Is this possible?

Thanks,
Kevin

> > It
> > looks like I am only allowed to pass arguments that come
> > directly from the main dw data.
>
> Is there any way to get this value (the teacher's name)
> into the main  datawindow's result set?  Can you modify
> the SQL statement for the main  datawindow and add this
> column?
>
> Paul Horan[TeamSybase]
>
>
0
Kevin
8/24/2006 6:21:39 PM
Absolutely.  The retrieval arguments in the main datawindow have always been 
available to be passed to any nest.

PH

<Kevin> wrote in message news:44edee33.7e37.1681692777@sybase.com...
> No, so I guess my problem is I need to send one argument to
> the nested datawindow from the detail row itself and two
> more arguments to the nested datawindow that were used to
> retrieve the main datawindow.  Is this possible?
>
> Thanks,
> Kevin
>
>> > It
>> > looks like I am only allowed to pass arguments that come
>> > directly from the main dw data.
>>
>> Is there any way to get this value (the teacher's name)
>> into the main  datawindow's result set?  Can you modify
>> the SQL statement for the main  datawindow and add this
>> column?
>>
>> Paul Horan[TeamSybase]
>>
>> 


0
Paul
8/25/2006 2:55:47 AM
Reply: