473,387 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Data: Report? Two SUM() Column

Hello,

I need advise on how to solve this scenario. I am not sure whether I should use any Report Application such as Crystal Report or I can just simply use datagridview.

My scenario:
In a new form, a table will show a least 3 columns.
First, ItemID
2nd, Total Quantity Sold for the Current Month
3rd, Total Quantity Sold: Last month
Expand|Select|Wrap|Line Numbers
  1. ItemID     Current (Nov)     October
  2. ABA1          100              85
  3. ABB1          80               90
Hence, I can compare the figure of the current month with the past few month.

Right now, I do not have any problems building SQL_String for calculating the Total Qty Sold for the Current month and display it via DataGridView. But I am not sure how to additional column that calculate the Total for the past few month.

Please advise. And thanks in advance.
Dec 1 '09 #1
3 3005
MrMancunian
569 Expert 512MB
You could use both. If you decide to use Crystal Reports, you can use a formula field to calculate the numbers and put in in a table. If you use a datagridview, you can use DataGridView.Columns.Add() and add the calculated numbers to that column. It's a matter of preference and design.

Steven
Dec 3 '09 #2
Thanks for your reply, Steven.

Do you have any examples to explain further on the two solution?

I had tried the Crystal Reports via Cross-Tab Report Wizard. It works fine.

Right now, i would like to know how to use DataGridView like you mention.
Should I use a Loop to calculate every ItemID?
Dec 3 '09 #3
MrMancunian
569 Expert 512MB
You could use a for...next loop, but I think it's easier to change the query you use, put the data in a DataTable and bind the DataTable to the gridview.

In case of the loop, bind the data to your datagridview first, then create a column, add it and the use the for...next to loop through your datagridview and fill the sumcolumn.

Steven
Dec 4 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Justin Lebar | last post by:
Sorry about the huge post, but I think this is the amount of information necessary for someone to help me with a good answer. I'm writing a statistical analysis program in ASP.net and MSSQL7 that...
4
by: Bill Dika | last post by:
Hi I am trying to calculate a running total of a calculated textbox (tbAtStandard) in GroupFooter1 for placement in a textbox (tbTotalAtStandard) on my report in Groupfooter0. The problem...
1
by: christian | last post by:
HI all, I've several fields in a report which datatype is Date/Time. Day WorkedHours Monday 8:00 Tuesday 8:00 Wednesday 8:00 Thursday 7:00...
6
by: Mike Conklin | last post by:
This one really has me going. Probably something silly. I'm using dcount for a report to determine the number of different types of tests proctored in a semester. My report is based on a...
1
by: hylander | last post by:
My apologies for what to many of you will probably seem a simple problem. I have a number of queries which result in numerical answers. Is it possible to have access total these for a report. The...
4
by: MLH | last post by:
I have a report and on it, a subreport control Main Report Name: rptInvoiceMain Sub Report Name: rptInvoiceSubReport SubReport Control Name: rptInvoiceSubReportCtl The...
3
by: keri | last post by:
Hi, I have recently being doing a lot of work in Excel so apologies if I refer to things in Excel terms. I need to create a report and cannot seem to get the data from my tables / queries in the...
22
kcdoell
by: kcdoell | last post by:
I have been trying for the last several days to create a query that will give me all of the values I need to create a report. Background: The report is different than anything I have done but...
2
by: J360 | last post by:
I have a dynamic report that shows income statement items trended out for the last 12 months. If, for example, the user selects to see Gross Revenue and Cost Of Materials, these measures will be...
14
ollyb303
by: ollyb303 | last post by:
Hi, I am trying to create a dynamic crosstab report which will display number of calls handled (I work for a call centre) per day grouped by supervisor. I have one crosstab query (Query1) which...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.