Solved

DataReport Grouping

Posted on 2001-06-12
11
580 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

726 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