Solved

DataReport Grouping

Posted on 2001-06-12
11
578 Views
Last Modified: 2012-06-27
I'm using the datareport by assigning a recordset progamatically. If I have a recordset that has 7 (daily)revenue amounts for each store location, can I group these with a subtotal using the group header/footer? This is what I have:

City1   Monday    $200
City1   Tuesday   $100
City1   Wednsday  $300
City1   Thursday  $200
City1   Friday    $100
City1   Saturday  $400
City1   Sunday    $200
City2   Monday    $300
City2   Tuesday   $100
etc...

What I want:

        City1
City1   Monday    $200
City1   Tuesday   $100
City1   Wednsday  $300
City1   Thursday  $200
City1   Friday    $100
City1   Saturday  $400
City1   Sunday    $200
     City1 Total $1500

        City2
City2   Monday    $200
City2   Tuesday   $100
City2   Wednsday  $300
City2   Thursday  $200
City2   Friday    $100
City2   Saturday  $400
City2   Sunday    $200
     City2 Total $1500
etc...


Can I Assign a recordset and do this or do I have to use the DataEnvironmet?

0
Comment
Question by:wd3
11 Comments
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6182257
Use the group footer and insert the formula =sum(fieldname) to total your dollar values.  Group on your city name field.
0
 

Author Comment

by:wd3
ID: 6182520
I keep getting Datareport does not match sections.
0
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6182568
Are you trying to build the datareport in code or are you using the designer?
0
 

Author Comment

by:wd3
ID: 6182575
In code
0
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6182591
Why?  You have a fixed report here.  Use the designer.  
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:wd3
ID: 6186674
Sorry, our T-1 went down I couldn't get back, ameritech's fault.
I think what I need out of the database is too complicated to get it directly with the designer.  What I have above is the result of other computations. I do think I can dump my results into a table and then use the designer. But...I've never used all the features of the command object in th designer. Can you show me how to create the grouping totals I need?
0
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6186820
Are you using Access, SQL Server or some other database?

What is the source of the recordset you described?  Is it a table or an SQL select?




0
 

Author Comment

by:wd3
ID: 6186881
SQL. As I said I can put the results in a table, and make a command object to set the report to. The table would have the above info. I need to group and total it.
0
 
LVL 12

Accepted Solution

by:
DRRYAN3 earned 150 total points
ID: 6187163
Maybe the easiest way to do this is to define a view or a table temporarily that is identical to the structure of your recordset.  Use the RDC Designer to setup your report based on this new view and get the layout and format of the report the way you want it.

At runtime, use report.database.setdatasource(rs) to set the datasource of the report to your recordset.

This way you can let crystal manage the grouping and subtotaling.  All you have to do is get the recordset defined in your app and pass that recordset to crystal.

After you have designed the report you can dump the view or table you used to make the report.  I keep them around for a while in case I need to tweak the report layout.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7135971
Hi wd3,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept DRRYAN3@avtech's comment(s) as an answer.

wd3, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7169196
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
vba find the last empty column 10 88
VBA color chart bars 12 76
Macro which automatically send Excel spreadsheet to Outlook problem 2 60
Sending a email via excel using vba 6 71
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now