This is a migrated thread and some comments may be shown as answers.

Multiple information from multiple table rows on one line

1 Answer 123 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
mSchmidt
Top achievements
Rank 1
mSchmidt asked on 12 Aug 2008, 06:04 AM
Hi

I have a database which holds information about employee shifts, i would like to make a report showing one week of shifts using Telerik reporting.

I have no problem making a report that shows data like this

Name    Shift
Morten   15-05-2008 15:00-18:00
Peter       18-05-2008 18:00-22:00

However i would like my result to be something like

Name   Mondag   Tuesdag Wednesdag Thursdag Friday Saturday Sonday
Morten  15:00-18:00                              19:00-22:00

As you may conclude from this my table structure looks something like this

[employee_db] { employee_id, employee_name}
[shifts] { employee_id, shift_start, shift_end }

A secondary issue is that a person may even have two shifts on a single day.

How should this be solved ?
Using subreports for each person for each day ? (seems very inefficient)

Currently using Linq as a datasource.

1 Answer, 1 is accepted

Sort by
0
Accepted
Rossen Hristov
Telerik team
answered on 12 Aug 2008, 09:26 AM
Hi mSchmidt,

Having a SubReport for each day of the week is the only way to do it if you want to show all the shifts for a person on a the same row. If you are fine with showing, let's say, the Monday and Thursday shifts on two consecutive rows instead of on one, then you can do it with only one SubReport item instead of 7.

Yet another option is to prepare the data in this layout while still in the database, i.e. a view or stored procedure to serve the data in this form.

By the way, your requirements are very close to a cross-tab report, which we lack at the moment, but are currently working on and we will have it in a future release.

All the best,
Ross
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
mSchmidt
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or