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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying grouped lists in specific page locations with CR9

Status
Not open for further replies.

NickStiven

Technical User
May 2, 2003
23
GB
I would like to publish a school class list (created in CR9) as a constantly updatable report, on our intranet via the Report Application Server. The report exists already and currently shows a list of pupils' names and ages, grouped by class name, with each group of names headed by the name of the class teacher, the total number of pupils in the class and the location of the classroom. Nothing exceptional about that.

The entire school class list could be presented as one long column, over several pages. This seems rather cumbersome and would represent a huge waste of paper if printed. It could be formatted in 2 columns, and use just half that number of pages. However, while I can prevent a group (i.e. class) from running over onto another page, the group sizes vary and I cannot reliably prevent a group which starts to be listed on, say, the first column, from snaking over and finishing on the other column on the same page.

This looks untidy and I wonder if there is a way in CR9 to force a group to stick to the column it started with?

We so happen to have 3 classes for each school year (grade) and it would be very useful to show the first two classes side by side on the page, with the third class listed directly under the left hand class of the side-by-side pair. This is the neat end product we currently end up with after a tedious session of word processing once we have exported the report to MS Word via the creation of a Text (Tab Delimited) file - hardly making the report "constantly updatable"!

Is there something clever which can be done with User Defined Labels, perhaps?

I would be most grateful for any clues.

Regards

Nick Stiven

 
I think I grasp the essence of the requirement, but everyone would be better served if you gave real examples of the data, and what you'd like to see output.

-k
 
Okay. I link 2 tables, {pupil} and {class}.

The detail of my report is:

{pupil.ageatdate}<space>(pupil.surname)(pupil.initials)

Group #1 is by {pupil.class} sorted in ascending order and the group header is:

Group #1 Name<space>{class.teacher}

e.g.

3JS Miss Jane Smith
7.03 Barnes J
7.01 Carter K
7.05 Champion D
7.02 Evans P
7.10 Gadfly T
7.03 Griffiths J
7.06 Henderson K
7.11 Jameson P
7.03 Murdoch R

Just to be difficult, a typical school class consists of 12 pupils, but some are only 8 strong, while some are 16 strong. To compound the problem, we have 8 yeargroups (US grades) and the lowest 3 yeargroups have only 2 classes each, while the rest have 3 classes each.

Below is a graphical illustration of the problem for one yeargroup:

A single column report would show a 3 class yeargroup like this:

nnn aaaaaaaaaaa
nnn aaaaaaaaaaa
nnn aaaaaaaaaaa
nnn aaaaaaaaaaa
nnn aaaaaaaaaaa
nnn aaaaaaaaaaa
nnn aaaaaaaaaaa
nnn aaaaaaaaaaa
nnn aaaaaaaaaaa
nnn aaaaaaaaaaa
nnn aaaaaaaaaaa
nnn aaaaaaaaaaa
nnn aaaaaaaaaaa

nnn bbbbbbbbbbb
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb

nnn ccccccccccc
nnn ccccccccccc
nnn ccccccccccc
nnn ccccccccccc
nnn ccccccccccc
nnn ccccccccccc
nnn ccccccccccc
nnn ccccccccccc

A 2 column report however would show something like this, where the second class is split over the two columns and the third class just follows on after the second class, in the second column, as space permits:

nnn aaaaaaaaaaa nnn bbbbbbbbbbbb
nnn aaaaaaaaaaa nnn bbbbbbbbbbbb
nnn aaaaaaaaaaa nnn bbbbbbbbbbbb
nnn aaaaaaaaaaa nnn bbbbbbbbbbbb
nnn aaaaaaaaaaa nnn bbbbbbbbbbbb
nnn aaaaaaaaaaa
nnn aaaaaaaaaaa nnn ccccccccccc
nnn aaaaaaaaaaa nnn ccccccccccc
nnn aaaaaaaaaaa nnn ccccccccccc
nnn aaaaaaaaaaa nnn ccccccccccc
nnn aaaaaaaaaaa nnn ccccccccccc
nnn aaaaaaaaaaa nnn ccccccccccc
nnn aaaaaaaaaaa nnn ccccccccccc
nnn ccccccccccc
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb
nnn bbbbbbbbbbb

However, what I would like (for each yeargroup, whether it had 2 or 3 classes) would be the first 2 classes within the yeargroup to sit neatly side by side, with their headings aligned, and any third class to sit neatly against the left margin and starting below the lowest entry of its two predecessors:

nnn aaaaaaaaaaa nnn bbbbbbbbbbbb
nnn aaaaaaaaaaa nnn bbbbbbbbbbbb
nnn aaaaaaaaaaa nnn bbbbbbbbbbbb
nnn aaaaaaaaaaa nnn bbbbbbbbbbbb
nnn aaaaaaaaaaa nnn bbbbbbbbbbbb
nnn aaaaaaaaaaa nnn bbbbbbbbbbbb
nnn aaaaaaaaaaa nnn bbbbbbbbbbbb
nnn aaaaaaaaaaa nnn bbbbbbbbbbbb
nnn aaaaaaaaaaa nnn bbbbbbbbbbbb
nnn aaaaaaaaaaa nnn bbbbbbbbbbbb
nnn aaaaaaaaaaa nnn bbbbbbbbbbbb
nnn aaaaaaaaaaa nnn bbbbbbbbbbbb
nnn aaaaaaaaaaa nnn bbbbbbbbbbbb
nnn bbbbbbbbbbb

nnn ccccccccccc
nnn ccccccccccc
nnn ccccccccccc
nnn ccccccccccc
nnn ccccccccccc
nnn ccccccccccc
nnn ccccccccccc
nnn ccccccccccc

Then, I would like the next yeargroup set of classes to be similarly set out below, whether it had 2 or 3 classes.

I hope this helps you visualise the problem. I accept that what I want may be outside the formatting capabilities of CR, but who knows?

Regards

Nick Stiven
 
Unfortunately, CR gives you several properties to control page breaks, but nothing to control column breaks within a page.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Thanks. I thought as much.

I have, however, found a reasonable solution to my formatting problem (even if it isn't perfect) by trying out a User Defined Label. I chose a Mailing Label format when I set up the report, then formatted the Details Layout through trial and error to end up with a Detail Size - Width of 8 cm and Height of 0.501 cm. I set the Horizontal Gap between Details as 1.00 cm and the Vertical Gap as zero.I then set the Printing Direction radio button to Across then Down. This gives me 2 columns of 47 one-line 'labels' in each column. I then un-suppressed the report's Report Header and Page Footer to insert a Report Title and page numbers.

By grouping my pupils by class and inserting a Group Header above the single Details section and giving myself an empty single line deep Group Footer, each class ends up with a nice, standalone heading on its own line, which shows the class ID and the teacher's name. Without the label-style formatting, the Group Header Title was treated as if it were just another pupil name by the Column Layout mechanism. Then the class itself is set out neatly below the Group Header in two columns, with a clear gap before the heading of the next class. I set the group properties to Keep Together to make sure no class list splits itself over two pages.

The only pity is that, to get the space-saving two column effect I want, the names have to go alphabetically left-to-right:

i.e.

aaaaaa bbbbbb
ccccccc dddddd
eeeeee ffffffffff

and not vertically as I would prefer:

i.e.

aaaaaa dddddd
bbbbbb eeeeee
ccccccc ffffffffff

Ah well, I suppose it's a small price to pay for a tidy, paper saving report.

Nick Stiven
 
I scritched me wee pointy noggin and decided that the solution probably isn't worth the effort required.

But you might use a subreport in the group headerof a new group (Yeargroup) to display the First 2 aaa and bbb, with the bottom margin in the subreport set to something like 4 inches, then have the third group ccc display in the main report in the details as usual.

This means adding a record selection formula to the subreport to filter only aaaa and bbbb, and to the main report to only retrieve the cccc

So it can probably be done, it just isn't elegant nor simple.

-k
 
Thanks for the suggestion. I'll try it out and see where I get.

Nick Stiven
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top