PC Review


Reply
Thread Tools Rate Thread

ARGH! Still working on Grand Totals...

 
 
Coleen
Guest
Posts: n/a
 
      16th Aug 2004
Hi All :-)

Cor & David, Thank you for your help, sorry I did not reply before now, but
for some reason my Newsgroup Reader (Outlook) does not show your last posts.
The last one I got from Cor was asking me to clarify what I needed. I
checked in the Web Newsgroup, and found your posts. I don't know why they
don't show up in my Outlook reader, but they don't. I got your solution
Cor, and it does look amazingly simple! I am in the process of trying it
now, and I will let you know of the results. I just wanted to say thank
you, and Since I couldn't get my reader to come up with the most current
posts, I started a new thread.

I will let you know how it works, and again THANKS!

Coleen


 
Reply With Quote
 
 
 
 
Coleen
Guest
Posts: n/a
 
      17th Aug 2004
Hi Cor, I'm still testing this but I do have a question. The 2nd to last
line of code you have "Fig * 100/" & sum.tostring. Won't this give me the
same error that I have been getting all along, because the grand total has
not been calculated at the time that I need to use it to do the division?
I've been getting an "Infinity" error....


\\\
Private Sub Form1_Load(ByVal sender As _
Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
Dim dt As New DataTable("Coleen")
dt.Columns.Add("Fig", GetType(System.Int32))
dt.Columns.Add("Perc", GetType(System.Int32))
For i As Integer = 0 To 5
Dim dr As DataRow = dt.NewRow
dr(0) = i + 1
dt.Rows.Add(dr)
Next
Dim dr2 As DataRow = dt.NewRow
Dim sum As Integer = _
CInt(dt.Compute("Sum(Fig)", ""))
dr2(0) = sum
dt.Rows.Add(dr2)
dt.Columns(1).Expression = _
"Fig * 100/ " & sum.ToString
DataGrid1.DataSource = dt
End Sub
///


"Coleen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi All :-)
>
> Cor & David, Thank you for your help, sorry I did not reply before now,

but
> for some reason my Newsgroup Reader (Outlook) does not show your last

posts.
> The last one I got from Cor was asking me to clarify what I needed. I
> checked in the Web Newsgroup, and found your posts. I don't know why they
> don't show up in my Outlook reader, but they don't. I got your solution
> Cor, and it does look amazingly simple! I am in the process of trying it
> now, and I will let you know of the results. I just wanted to say thank
> you, and Since I couldn't get my reader to come up with the most current
> posts, I started a new thread.
>
> I will let you know how it works, and again THANKS!
>
> Coleen
>
>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      17th Aug 2004
Coleen,

When I open a new form,
drag a datagrid on it.
paste in the code I get

1|5
2|10
3|14
4|19
5|24
6|19
21|100

So I am curious how it can be with you in another way?

Cor



 
Reply With Quote
 
Coleen
Guest
Posts: n/a
 
      17th Aug 2004
When I open a form, drag a grid onto it, I get nothing...no datagrid
populates, and the datagrid does not render. I've done a complete copy/paste
of your code, with one exception. I had to change the line of:
For i as Integer = 0 to 5 to:
dim i as integer
for i = 0 to 5

What version of VB .Net are you using? I know that should not make a
difference, but we use Microsoft Development 2002 Version 7.0.9466, .Net
Framework v. 1.0.3705. I don't think it should make a difference that I had
to dim the i as an integer in a separate line. But when I run the project,
nothing renders. Do I need to call the Form1_Load sub in the page load?
BTW, I'm using an Web form, not a Windows form...as a matter of fact, I'm
using web forms for all of my projects. Maybe that is why the code works
for you and not me?

Thanks for you help :-)

Please let me know if there is something different I need to do in the Web
form vs. the Windows form...

Coleen

"Cor Ligthert" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Coleen,
>
> When I open a new form,
> drag a datagrid on it.
> paste in the code I get
>
> 1|5
> 2|10
> 3|14
> 4|19
> 5|24
> 6|19
> 21|100
>
> So I am curious how it can be with you in another way?
>
> Cor
>
>
>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      17th Aug 2004
Coleen,

I was expecting you where using a windowforms

However do what you did and add this as last sentence then the result is the
same as with a webform
DataGrid1.DataBind()

Cor

> When I open a form, drag a grid onto it, I get nothing...no datagrid
> populates, and the datagrid does not render. I've done a complete

copy/paste
> of your code, with one exception. I had to change the line of:
> For i as Integer = 0 to 5 to:
> dim i as integer
> for i = 0 to 5
>
> What version of VB .Net are you using? I know that should not make a
> difference, but we use Microsoft Development 2002 Version 7.0.9466, .Net
> Framework v. 1.0.3705. I don't think it should make a difference that I

had
> to dim the i as an integer in a separate line. But when I run the

project,
> nothing renders. Do I need to call the Form1_Load sub in the page load?
> BTW, I'm using an Web form, not a Windows form...as a matter of fact, I'm
> using web forms for all of my projects. Maybe that is why the code works
> for you and not me?
>
> Thanks for you help :-)
>
> Please let me know if there is something different I need to do in the Web
> form vs. the Windows form...
>
> Coleen
>
> "Cor Ligthert" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > Coleen,
> >
> > When I open a new form,
> > drag a datagrid on it.
> > paste in the code I get
> >
> > 1|5
> > 2|10
> > 3|14
> > 4|19
> > 5|24
> > 6|19
> > 21|100
> >
> > So I am curious how it can be with you in another way?
> >
> > Cor
> >
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot Totals: Group totals different from Grand totals PsyberFox Microsoft Excel Misc 1 13th Feb 2008 06:16 PM
Grand Totals with Nested Sub Totals Brenda from Michigan Microsoft Excel Misc 7 18th Jan 2008 01:26 PM
Sub totals and grand totals on a form =?Utf-8?B?R2FyeURlbm5pcw==?= Microsoft Access Form Coding 0 27th Apr 2005 04:20 PM
Grand Totals for Columns not working in some Pivot Tables Sandra Microsoft Excel Crashes 0 9th Oct 2003 05:50 PM
Re: grand totals Allen Browne Microsoft Access Reports 0 6th Sep 2003 02:57 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:22 PM.