Jump to content

Parallel Groups?


jakubhertyk

Recommended Posts

Hello,

 

I searched high and low for an answer to this but I am not even sure what to call this situation. I am trying to create, for a lack of a better word, two Parallel groups. :P I am pretty sure that I can achieve this with one group plus a sub-report that does a retrieve for each "detail" row but I was hoping not to resort to that.

 

Lets say that each person in the DB has a House (first table) and a Car (second table). The report should look as follows:

 

Person 1

  • House 1[/ul]

  • Car 1
  • Car 2[/ul]

 

Person 2

  • House 1
  • House 2[/ul]

  • Car 1
  • Car 2
  • Car 3[/ul]

 

...etc

 

It will list first the Houses for the person then the Cars. Is this possible with one report and two groups?

 

Crossing fingers,

 

 

 

Jakub

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You could try doing a UNION in SQL to get data from both tables..

 

EG

 

(

SELECT person,house

FROM ...

)

UNION

(

SELECT person,cars

FROM ...

)

 

you have to look into your DB's implementation of UNION to get the specifics

 

(eg you must select the same number of columns from each table in the example above there are two and it's best if the data types are the same eg you don't mix strings and numbers)

 

Jamie

Link to comment
Share on other sites

That is a possibility. The only problem is that the House and Car have other attributes (of mixed types) that have to be displayed as well. They have different number of attributes as too, eg the House has a built date, and comments while the Car has a color, max speed and transmission type.

 

Jakub

Link to comment
Share on other sites

It would still be possible to use UNION in that case if you're just looking for a SQL solution..

 

Just add NULL values to columns that the other table doesn't have.. eg

 

(

SELECT id,name, ...(same attributes), NULL AS carColor

FROM house

)

UNION

(

SELECT id,name, ...(same attributes), color AS carColor

FROM car

)

 

Either that or you'll probably have to resort to a subreport pulling the extra details like you mentioned before..

 

Jamie

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...