473,574 Members | 2,595 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please, Please help with Grand Totals

Hi All :-)

Thanks for all of your help Cor :-)

I can not get the code you sent me to work in my application. I'm using an aspx datagrid in a web form. I'm getting the following error message when I try this code:

"Syntax error in aggregate argument: Expecting a single column argument with possible 'Child' qualifier."

Dim dr2 As DataRow = dt_stat_report_ 3b.NewRow
Dim sum As Double = CDbl(dt_stat_re port_3b.Compute ("Sum(10-ld_act_125_gtr_ fy_hh_avg)", ""))
dr2(10) = sum
dt_stat_report_ 3b.Rows.Add(dr2 )
dt_stat_report_ 3b.Columns(11). Expression = "10-ld_act_125_gtr_ fy_hh_avg" & sum.ToString
uwg_stat_rpt_3b .DataSource = dt_stat_report_ 3b

By way of explanation, I already have a For loop defined, and the columns created to hold both the values I'm trying to get the grand total for and the "Sum" column so I'm not showing that code. The column name is "10-ld_act_125_gtr_ fy_hh_avg" and is the (10) column in the datagrid. The grand total column is the (11) column in the datagrid. I'm not multiplying by 100, because I don't want the actual percentage here, I want the calculation of the value from the row of column(10) divided by the grand total of column(10), so I don't need to multiply by 100.

Do you have any suggestions? I am at a loss, and at this point I'm going to have to duplicate all of my calculations from this datagrid and do them over again in a second datagrid, because the value in column 10 is calculated from column 3 and 4 in the current datagrid. This is basically a replication of an Excel Spreadsheet that our users have and they want an automated report. In order to get that report, I have to do calculations in almost EVERY column of this datagrid, and the datagrid consists of 14 columns! If you can provide any suggestions as to why I'm getting this error, I would greatly appreciate your help.

Thanks,

Coleen
Nov 21 '05 #1
6 4678
Coleen,

Why do you not try that sample, everything is in it what you ask.
And again I added in the original thread that one sentence you need what is needed more for a webform than for a winform in this case.

Cor

Nov 21 '05 #2
Coleen,

Again,

Why are you sending everytime the same message while you are not looking to
the answers or trying the advises you get.

Cor
Nov 21 '05 #3
I am having trouble with my newsgroup viewer...it is not showing me all threads! I did get the project to work, but when I applied the code you sent to my application I got the error I sent in this thread. I have a databind for this data grid after all of the compute code, I just did not show it. I don't understand why I am getting the error "Syntax error in aggregate argument: Expecting a single column argument with possible 'Child' qualifier. "

The line of code is:

Dim sum As Double = CDbl(dt_stat_re port_3b.Compute ("Sum(10-ld_act_125_gtr_ fy_hh_avg)", ""))

Where I have described the column "Perc" as a double instead of an integer because I need to return decimal values, so I declared the variable sum as a double instead of an integer as well. dt_stat_reprt_3 b is the name of the datatable that I am using in my page for the datagrid. "10-ld_act_125_gtr_ fy-hh_avg" is the name of the column that I need the grand total for. So I have implemented the code you sent me, and I DO appreciate it VERY much. I'm just puzzled as to why I get this error when running the page. I don't get it in the test project using the code you sent, even after I changed the Integers to doubles, and took out the * 100 in the sample, it still works. I'm not quite sure why it is expecting a "Child qualifier?"
Thanks,

Coleen
"Cor Ligthert" <no**********@p lanet.nl> wrote in message news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Coleen,

Why do you not try that sample, everything is in it what you ask.
And again I added in the original thread that one sentence you need what is needed more for a webform than for a winform in this case.

Cor

Nov 21 '05 #4
I am having trouble with my newsgroup viewer, so I can't tell when someone
replies to my original post! I'm sorry to send double-posts, but I can't
read more than 5 threads. I apologize, If there are more than 5 threads in
my post, my viewer won't show me the thread. I've tried viewing in the
Microsoft Web forum, but our Network prevents me from signing in and
replying to posts that are shown there. I am looking at everything that I
can VIEW in my Outlook viewer, and trying it, but if I can't view it, I
can't try it :-(

Sorry.

Coleen

"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:OU******** *****@TK2MSFTNG P10.phx.gbl...
Coleen,

Again,

Why are you sending everytime the same message while you are not looking to the answers or trying the advises you get.

Cor

Nov 21 '05 #5
Coleen

This is yours
Dim sum As Double =
CDbl(dt_stat_re port_3b.Compute ("Sum(10-ld_act_125_gtr_ fy_hh_avg)", ""))

This is in my sample
CInt(dt.Compute ("Sum(Fig)", ""))

It are not only the doubles you changed I cannot immagen that
(10-ld_act_125_gtr_ fy_hh_avg) is a column name

Cor
Nov 21 '05 #6
Actually, that IS the column name, but you are right, the 10- in it is the
reason I was having so much trouble. It was trying to do a subtraction
before it did the division because of the dash! Thanks so much for your
help and code. After going over the code step by step and looking at the
column name, I first took out the 10- and it all fell into place! Cor, you
are a genius, and my hero :-)

THANKS SO VERY MUCH!

Coleen

BTW, I use such weird column names to describe the variable that is the
result of the calculation. In this case it stands for local double
(ld)_actual (act)_125(a tax rate)_greater than(gtr)_fisca l year(fy)_hold
harmless(hh)_av erage(avg) - it makes sense, but it IS cumbersome.

"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Coleen

This is yours
Dim sum As Double =
CDbl(dt_stat_re port_3b.Compute ("Sum(10-ld_act_125_gtr_ fy_hh_avg)", ""))

This is in my sample
CInt(dt.Compute ("Sum(Fig)", ""))

It are not only the doubles you changed I cannot immagen that
(10-ld_act_125_gtr_ fy_hh_avg) is a column name

Cor

Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
11565
by: Dalan | last post by:
I seemed to be having problems with structuring the use of NZ with a DSum expression. Having tried numerous variations of the expression without success, I'm asking for assistance. First some background (Access 97) - the DSum expressions are being used in grand total text boxes on the footer of a subform. And when viewing the subform in the...
1
2962
by: tconway | last post by:
I have an Access program that displays Customer data into a form and OrderID data into a subform. The totals in the Subform are based on calculated fields, i.e. the Total Amount field Calculates the following: =* The Subform Order fields are pulled from a Query along with each calculated Total. They are displyed in a DataSheet View. This...
3
1718
by: dd_bdlm | last post by:
Please help this one is driving me mad! I have searched and read all the topics on the error message I am receiving but none seem to apply to me! I have quite a complex query linking all parts of my database together doing final calculations etc. This query when run (through the form) comes up with 'this recordset is not updateable' error....
2
4847
by: Darren | last post by:
Hi, I am trying to write an Aged Debtors report in MSquery, I have created all of the columns sucessfully, I just need to have totals of each column at the bottom of the report - how can this be done? this id the code that I have so far: - select cucode,
1
6385
by: CaptainDahlin | last post by:
I know the basics about access reports and putting page totals in the page footers. What I can't figure out is along with the current page total to display the previous page total: At the bottom of every page: Page 1 page footer: Total brought forward= $0.00 Current Page total = $100.00 Grand Total= $100.00
4
1705
by: Seyi1 | last post by:
I am attempting to create a report with sub-totals in the body of the report and a total at the bottom. how do I go about doing this thanks: here is an example of the result I need to achive Style: Majest 1002 Brown, Ed 0 10 13 14 1005 Judy, Larry 10 17 7 10 1007 King, James 28 0 5 5
0
1495
by: jessicaeatworld | last post by:
Hi, I'm using Access 2003 on Windows XP. I have created a PivotTable View Form and at the bottom is an automatically inserted Grand Total row. I added sum and avg fields and then hid the details so the Grand Total row actually shows totals for each column. It displays perfectly in Access but when I export it, the entire Grand Total row is gone. ...
1
1559
by: smacky61 | last post by:
How do I summarize a report by finding the totals fees collected for each event and the grand total of all fees. The name of the report is Registered Attendees Report.
7
1750
by: Bobh | last post by:
I am trying to figure out some code for a report issue; I have an employee who has a incentive scheme. I have a report showing various income amounts and in the report footer I vae totals for these feilds =sum() these work fine. I also have in the detail feild Overall text boxes for the three feilds concerned I then have in the report...
0
7807
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8058
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8241
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7820
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8100
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5301
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3742
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1344
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.