[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

DataReport Grouping

Posted on 2001-06-12
11
Medium Priority
?
584 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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 600 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

656 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