Grouping and totals

Egghead

Registered User.
Local time
Today, 13:20
Joined
Jul 12, 2012
Messages
12
I'm attempting to create a railroad report using the format of the attached sample, and I've run into a few questions:

1. Without getting into VB code, is there a way to generate the dashed lines whenever the Station ID (e.g. "STU", "NEW", "IOW") changes, while maintaining the overall sort order by Seq (far left)? I tried the Sort/grouping feature, but as long as Seq is the primary sort key, it seems to want to make each record its own "group", since Seq changes with each one. If I remove Seq from and sort/group only based on Station ID, then the grouping works, but it sorts the cars alphabetically by station instead of leaving them in Seq order. Any ideas what I'm doing wrong?

2. How can I generate the "*** HAZARDOUS ***" line immediately following any record where "HZ" is set to "Y", such as record #10?

3. The "LE" column has values of "L" (Load), "E" (Empty), and "O" (Operating, i.e. locomotives). How can I keep a count of each, as well as a total of all cars, to report in the footer? Also, each database record will indicate the tonnage of each car, but it won't be printed in detail on this particular report. How can I print a total tonnage of all cars included in the report?

Thanks very much for your help.
 

Attachments

Egghead, when you post on a forum it's best you ask questions one at a time. Although your questions may relate to the form, the questions are not related in terms of context. So with that in mind, let's start with your first question. What do you mean by generate dashed lines? Can you elaborate on the problem?
 
Thanks for the correction vbaInet. Different convention than what I'm used to on my hobby-related forums, so I appreciate you setting me straight.

The dashed lines I'm referring to are those between each group of records in the attached document above, e.g. between "NEWTON" and "IOWACIT". However, a friend of mine came to the rescue and resolved the issues, so I'm fine now. Thanks very much for your willingness to help.
 
Okay, apparently my friend's solution didn't resolve the problem after all. After further testing, I realized that his solution printed the records out of Seq order.

To recap, I'm trying to create a report based on the format in the attached .zip file. Without getting into VB code, is there a way to generate the dashed lines whenever the Station ID (e.g. "STU", "NEW", "IOW") changes, while still keeping the records in order by the Seq value? I've tried to do so via grouping, but if Seq is first in the sort/group hierarchy, the dashed lines appear between every record, and if Seq is second or non-existent, the report correctly prints the dashed line between each group of Station IDs, but it incorrectly rearranges everything into Station ID order rather than Seq order.

Any guidance would be appreciated.
 

Attachments

You can sort on items that aren't visible on the report so keep your sort field and add another field with he dashes.
 
You can sort on items that aren't visible on the report so keep your sort field and add another field with he dashes.

Thanks for your reply. Unfortunately, I don't think I understand what you mean. I'd like to sort strictly on the Seq field, which is visible. Entries for each Station ID will then be together in the report, such as the two Newton entries, or the three "IOWACIT" entires. So, I don't want to change the order of entries at all, but just want to print a line of dashes between each group of entries for a particular station. For example, after the two Newton lines, print a line of dashes, then print the three Iowa City entries, another line of dashes, etc. Is that possible?
 
Yes. Add a footer to the grouping. And then add a dashed line.
 
Thanks. I tried that earlier, but because Seq has to be the first field in the sort hierarchy in order to keep the entries in Seq order, it treats each line as a new Group, printing a dashed line after each one (since Seq is different with each record). I'd like it to sort based on Seq alone, but ignore Seq when doing the grouping, and look at Station ID alone for the grouping. Possible?
 
In the group/ sort. Is seq just a sort, then group by station? Or is it group on seq and group on station?
 
I have Seq set to No for both Group Header and Group Footer, with Station set to No for Group Header and Yes for Group Footer. I then have the footer defined as a line of dashes. However, in the output, I get a line of dashes after EVERY entry, even when the Station value hasn't changed. That makes me think that it's including the Seq value (which DOES change on every record) in its grouping determination, even though I think I have it configured correctly. Not so?
 
Can you upload a sample table and I'll knock it put for you quickly.
 

Users who are viewing this thread

Back
Top Bottom