Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Floating report - table or matrix? 2

Status
Not open for further replies.

graabein

Programmer
Oct 9, 2002
186
NO
Hi, I want to make some sort of floating report where I query the database for a single column of values, and spread them out from left to right and top to bottom in a report.

For instance I get the strings a, b, c, d, e, f, g (one field with seven values/rows) from the query and I want them spread out like this:

Code:
a b c
d e f
g

How do I do it?

[elephant2]
graabein
 
Neither control really supports that data layout to be honest. If you have 1 field it will either spread across or down - not both. To be honest, I struggle to see the point of what you are attempting to do - maybe if you could explain a bit further, a solution may become apparent.

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
I need to remake the layout of an existing word document and the number of strings may vary. The report is first and foremost for printing so it has to be space efficient.

The values consist of <taskname>: <personlist> and it will be a subreport to show what persons do what kind of tasks for the given date.

Can I have a table with a fixed number of columns and have n, n+1, n+2, n+3 on each row, sort of?

[elephant2]
graabein
 
How are people related to tasks in your data? and how would you want it laid out ?

Either a table or a matrix could cope with something like

Person ---->
Task
| 0 1 0 0 1
| 1 0 0 1 0
|
|
V

I guess I was confused because in your 1st post you indicate that only 1 field is returned. If you have 2 fields, eitehr control can be used to split out which person is related to which task but it depends mainly on how the data is laid out in your query. Can you reproduce a small subset of the data returned from the query and how it is organised (as pure data)

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
I do have only one field. It's a string with "task: person(s)". The tasks differ from department to department (input parameter) and the persons differ from day to day (also input parameter).

I want it laid out in sections with different group of tasks. For the first section I want 4 columns. Then I'll make a second query that return some other task strings, these ones more specific. Sort of like this:

Code:
section 1 - dynamic tasklist
task1: steve, george  task2:         task3: nick    task4:
task5:                task6: gary    task7:
section 2 - spesific tasklist
meeting: steve, paul, alice          course: tessa, john

[elephant2]
graabein
 
AFAIK, you cannot do this the way you want in RS

The only way I could lay out your data for it to make sense would be in a 1 column table with the width wide enough to show all people associated with the tasks

To display the data as you want, I think you would have to change your query to have at least 2 fields

Task / Person

Alternatively, if there is a maximum for the nos. of people per task you could create a multi column data set with

Task / Person1 / Person2 / Person3 / Person4 etc etc

Some of the Person3 Person4 fields may be empty for certain tasks

Either of these kind of data layouts would serve you better for reporting than what you currently have which is basically a list



Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
OK thanks for your help. I'm afraid there's no maximum number of people per task. In any case I think I'll have to redesign the query like you suggest. I'll work on it.

[elephant2]
graabein
 
We had a similar problem that we could not solve in Crystal Reports.

We ended up using a sql stored procedure to regroup the data using a temp table.

In a sql temp table, you could put the tasks that will print on a line together into a row. Task1 would go in the first field, task2 into the second field, etc.

Then the report could print the rows the temp table, and
they would come out in the correct order.



 
That's brilliant MColeman! I'll get right to it thanks!



[elephant2]
graabein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top