List childs vertically

Stimulsoft Reports.NET discussion
Post Reply
Neo77
Posts: 16
Joined: Thu Apr 10, 2008 4:13 am
Location: Switzerland

List childs vertically

Post by Neo77 »

Hi

We try to create a report (and finally export to excel) but can't figure out how to do this...

For example, we have the following hierachical data (name with contacts):

firstname: john
name: doe
contact1: type: email: value: john.doe@something.com
contact2: type: email, value: john@doe.com
contact3: type: phone, value: 555 11 22 33
contact4: type: instant, value: 12345676

Now we want to create a report in the followin format (one row for each name):

firsname | name | contact1 | value1 | contact2 | value2 | contact3 | value3
john | doe | email | john.doe@something.com | email | john@doe.com | phone | 555 11 2 33

Note that we should be able to limit the contacts to three items and that not every name has three contacts...

Ist there a way to do this?

Thanks for help!

Regards,
Chris




Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

List childs vertically

Post by Edward »

Hi Chris,

Please create 'Data From Other DataSource' datasource which will be based on your datasource and "firstname" and "name" columns as group columns. Then create a master - detail connection via relation between these two datasources based these two Columns.

Data from the detail datasource can be shown via CrossBand databands.

You can be sure that last record of the CrossDataBand's is being printed again when DataSource.IsEof property is true. So you can disable printing of all CrossDataband's items when there are 1 or 2 details instead of 3. You can check this in 'Conditions' property of appropriate StiTexts or in the BeforePrintEvent of the CrossBand and set Enable property of its StiTexts in true or false according with condition.

CrossDataBand.CountData must be set in 3.

Thank you.
Neo77
Posts: 16
Joined: Thu Apr 10, 2008 4:13 am
Location: Switzerland

List childs vertically

Post by Neo77 »

Hi

Thanks for the quick response! Your solution seems to work with one record (name) but is there a way to display several records (forgot this in my first post)?

firsname | name | contact1 | value1 | contact2 | value2 | contact3 | value3
john | doe | email | john.doe@something.com | email | john@doe.com | phone | 555 11 2 33
mary| clark| email | mary.clarc@something.com | email | mary@clarc.com | phone | 555 44 55 66
....| ...| ...| ...| ...| ...| ...| ...

With your solution the second record is placed behind the first instead of beneath. Or am I doing something wrong?

Regards,
Chris
Post Reply