Display Sum Total Of Listview Items

Can anyone help me with displaying Sum Total of Listview Items in a label. I tried this:
Dim dblTotal as Double = 0
Dim dblTemp As Double
For Each lvItem As ListViewItem In lvwTemps.Items
If Double.TryParse(lvItem.SubItems(2).Text, dblTemp) Then
dblTotal += dblTemp
End If
Next
Label2.Text = dblTotal
but it's just giving me 0 in the label 

Hi
Seems like you might have a second VB Editor open? In any case, save the Project, close down VB and rerun will probably fix it.
Regards Les, Livingston, Scotland
Yes, that worked but it gives me an unreal number .. 
You'll need to take the unit into consideration and convert all values to the same unit, for example, MB:
Dim dblTotal As Double = 0
Dim dblTemp As Double
For Each lvItem As ListViewItem In lvwTemps.Items
Dim values() As String = lvItem.SubItems(2).Text.Split(" "c)
If Double.TryParse(values(0), dblTemp) Then
If values(1) = "MB" Then
dblTemp *= 1000000
ElseIf values(1) = "KB" Then
dblTemp *= 1000
End If
dblTotal += (dblTemp / 1000000)
End If
Next
Label2.Text = dblTotal
Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

Similar Messages

  • Sum of all line items and display at the bottom of the page

    Hi ABAPers,
    I am displaying line items in the main window based on PO number ....and I've a coloumn Total amount.
    My requirement is after the line items , the  grand total which is the sum of all line items has to be displayed.
    Is this possible. If so, can anybosy help me in that.
    thanks in advance

    Hi ,
    It is possible.
    For that u have to do  following
    take one variable of same type on which you want to calculate total  ... declare in global variable
    double click in the table  goto the calculation tab in that give the variable on which u want to calculate total
    print in the total in the  footer of the table ..
    Hope you resolve your problem
    Let me know any concerns......

  • There is an error in the sum total displayed in infoty type 8.

    Hi,
    In infotype 8 there is an error in the sum total . Recently few wage types were added in the system.
    Now the total amount of all the wagetypes is not displayed correct.
    please tell me is there any functional aspect through which it can be corrected.

    2BAS     Basic Salary          30.964,00      INR           
    2HRA     House Rent Allowance     15.482,00      INR           
    2SPL     Special Allowance          871,00      INR           
    1LTA     Leave Travel All. (CTC)     2.580,00      INR           
    1DRI     Driver's Pay Reimb. (CTC)     6.000,00      INR           
    1MED     Medical Reimb. (CTC)          1.250,00      INR           
    1PET     Petrol Reimb. (CTC)          4.000,00      INR           
    1GRA     Gratuity (CTC)          1.489,00      INR     
    1LEN     Leave Encashment (CTC)     300,00      INR     
    1BON     Bonus(CTC)          6.881,00      INR     
    1IMC     Medical Insurance (CTC)     179,00      INR     
    IV 24.10.2008 - 31.12.9999                 * 47.317,00  INR*
    Here the total amount for all the wage types is incorrect. This is my problem. How to correct the displayed total amount.

  • Printing only one line record with total of all items through alv

    hi experts,
    i am facing a problem while printing a list through alv.
    requirement is, suppose i have 3 line items under one document no.
    i have to print only one record with total amount of all items.more clearly...
    1001  10  1000/-
    1001  20    234/-
    1001  30   540/- these records in internal table then i am passing it to reuse_alv_grid_display.
    i need to display only 1001  1774/-(means sum of all the items)
    please tell me how to do this.
    thanks in advance,
    manasi

    hi ansari,
    contains in itab
         3000000004     02.11.2000     5550     27.95     27.95     0
         3000000004     02.11.2000     5550     10.95     10.95     0
         3000000005     02.11.2000     5550     27.95     27.95     0
         3000000005     02.11.2000     5550     10.95     10.95     0
         3000000006     02.11.2000     3020     52.99     52.99     0
         3000000006     02.11.2000     3020     64.99     64.99     0
         3000000006     02.11.2000     3020     49.5     49.5     0
         3000000007     02.11.2000     3730     2,228.00     2,228.00     0
         3000000007     02.11.2000     3730     1,698.00     1,698.00     0
         3000000007     02.11.2000     3730     532     532     0
    now please tell me how to print the data
    output will be
    3000000004     02.11.2000     5550     38.90     38.90       0
    3000000005     02.11.2000     5550     38.90     38.90       0
    3000000006     02.11.2000     3020     117.19     117.19     0
    like that
    please help me out
    manasi

  • How to display the number of line items in sap-script report?

    Hi friends,
    I need a help regarding the SAP Script. In my script (report) I create two pages and created three windows (MAIN, HEADER, FOOTER) for each pages. Now the problem is while displaying the fewer line item which can come under the main window of the 1st page these line items are comming perfectly but for the remaining line items that comes on the second page the table headings and the boexs are not comming.
    Also it is displaying the total and the amount in text in every pages that should be display in last page.
    Here if I eleminate or comments the total and the amount in text for the first page the same is reflected in second page. Also I need to display the page-nor for each pages to displayed.
    I am requesting all the people out there kindly help me to solve this issues.
    Thanks and Regards

    There is no pre built solution for this. But we can show total pages in the report body.
    one way is Create a other column in the report with code sum(count(1))/25. that gives you total number of pages. 25 here is no of rows in each page. The code you can write in narrative "Total pages in the report are @5" and out put may be "Total Pages in the report are 30".
    If you are using pivot tables, you can try this.
    http://oraclebizint.wordpress.com/2008/01/17/oracle-bi-101332-pagination-in-pivot-tables/
    - Madan

  • Use Windows PowerShell to count and list total number of items in Folders E-Mail in Office Outlook?

    I have the need to generate a list of all outlook folders and the total number of items listed beside each folder name. I thought I could simply modify the script from " http://blogs.technet.com/b/heyscriptingguy/archive/2009/01/26/how-do-i-use-windows-powershell-to-work-with-junk-e-mail-in-office-outlook.aspx
    " regarding the total number of items in the junk folder but no luck.
    I thought I could just simply duplicate line 6 of the aforementioned script
    "$folder = $namespace.getDefaultFolder($olFolders::olFolderJunk) " and change the folder name but getting the "Method invocation failed because [Microsoft.Office.Interop.Outlook.OlDefaultFolders] does not contain a method
    named 'olFolder'.
    At line:7 char:1
    + $folder = $namespace.getCurrentFolder($olFolders::olFolder("Design Engineering S ...
    I've found a way to export a list of all these folders using exportoutlookfolders.vbs to a txt file but doesn't include total number of items.
    Looking for any pointers on how to make this work. Don't expect anyone to write it for me but I am still learning PS. Would be great to find a way to import all of these folder and subfolder names into the script. Will be appreciative of any advice though.
    There's an enormous amount of Outlook folders.
    Outlook 2013
    Windows 8
    Thanks,
    Barry

    Since I am not and administrator, but an end user, I do not have access to the Get-Mailxxxx commandlets to make this really easy and had to do this long hand.
      The following will pull folder.name, folder.items.count, and sum the total size of each folder's items for all folders and their subs. 
    Just one warning, the summation can take some time with a large PST file since it needs to read every email in the PST. 
    There is also some minor formatting added to make the results a little more readable.
    $o
    = new-object
    -comobject outlook.application 
    $n
    = $o.GetNamespace("MAPI") 
    $f
    = $n.GetDefaultFolder(6).Parent 
    $i
    = 0
    $folder
    = $f
    # Create a function that can be used and then re used to find your folders
    Function
    Get-Folders()
    {Param($folder)
     foreach($folder
    in $folder.Folders)   
    {$Size =
    0
    $Itemcount
    = 0
    $foldername
    = $folder.name
    #Pull the number of items in the folder
    $folderItemCount
    = $folder.items.count
    #Sum the item (email) sizes up to give the total size of the folder
    foreach ($item
    in $folder.Items)
    {$Itemcount
    = $Itemcount
    + 1
    $Size =
    $Size +
    $item.size
    Write-Progress -Activity ("Toting size of "
    + $foldername
    + " folder.")
    -Status ("Totaling size of "
    + $Itemcount
    + " of "
    + $folderItemCount
    + " emails.")
    -PercentComplete ($itemcount/$folderItemCount*100)
    # just a little formating of the folder name for ease of display
    While($foldername.length
    -le 19){$foldername
    = $foldername
    + " "}
    #Write the results to the window
    Write-Host ("-folder "
    + $foldername
    + "  
    -itemcount " +
    "{0,7:N0}" -f
    $folderItemCount +
    "   -size " +
    "{0,8:N0}" -f ($size/1024)
    + " KB")
    #If the folder has a sub folder then loop threw the Get-Folders function.
    #This two lines of code is what allows you to find all sub folders, and
    #sub sub folders, and sub sub sub for as many times as is needed.
    If($folder.folders.count
    -gt 0)
    {Get-Folders($folder)}
    get-folders($folder)

  • Total of particular items of various open sales orders for particular cust

    HI.. following are my Items code  :
    2009,  8010, 8016, 9831, 27363, 27361, 27360, 27181, 16095.
    i want the report that consists of all items to be delivered to the customer. I  have created the following query :
    SELECT T0.CardName AS 'Dept_Name',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '2009') '2009',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '8010') '8010',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '8016') '8016',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '9831') '9831',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27363') '27363',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27361') '27361',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27360') '27360',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27181') '27181',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '16095') '16095'
    FROM ORDR T0
    but i want the total of particular items of various open sales orders for particular customer.
    pls improve the above query.
    thanks
    reema

    Hi,
    Try this
    SELECT T0.CardName AS 'Dept_Name',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '2009') '2009',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '2009') 'All 2009',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '8010') '8010',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '8010') 'All 8010',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '8016') '8016',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '8016') 'All 8016',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '9831') '9831',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '9831') 'All 9831',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27363') '27363',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27363') 'All 27363',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27361') '27361',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27361') 'All 27361',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27360') '27360',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27360') 'All 27360',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27181') '27181',
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '27181') 'All 27181',
    (Select SUM(isnull(T1.OpenQty,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '16095') '16095'
    (Select SUM(isnull(T1.Quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '16095') 'All 16095'
    FROM ORDR T0
    Regards,
    Bala

  • Displaying page total on a page with fixed number of lines

    Hi ,
    My requirement is to have a fixed number of rows per page (say 20) and to have a page total beneath the table containing the data.I am using a RTF template.The columns in the table are
    Order
    Amount
    Page Total : 3000
    For including a page-break after 20 lines, i have added the following code.
    For - each ______________
    <?if:position() mod 20 =0?> <xsl:attribute name="break-before">page</xsl:attribute> <?end if?>
    end - for_______________
    This limits the no of rows per page to 20.
    I have tried 2 ways to display the page total but both don't seem to work Can someone please point what i am missing here?
    1) Using add and show-page-total
    I added the code (<?add-page-total:at;'Amount'?> to the Amount data column in the template and then used the <?show-page-total:at?> in the page total data column to display the total. But this doesnt work.It doesnt display any value.
    2) Using Variables:
    I declared a variable (<?xdoxslt:set_variable($_XDOCTX, 'RTotalVar', 0)?>) before the table. Then, i used the (<?xdoxslt:set_variable($_XDOCTX, 'RTotalVar', xdoxslt:get_variable($_XDOCTX,'RTotalVar') +Amount)?>) in the Amount data column to calculate the sum. I then used <?if:position() mod 20 =0?> <?xdoxslt:get_variable($_XDOCTX, 'RTotalVar')?><?end if?> in the data column of the page total. But this doesnt work.  The variable loses its value when it is displayed outside the table. Why is it so? How can i declare a global variable? I am not sure why the variable loses it value when taken out of the table. I would want it hold the value through out the document. Is my understanding correct?
    Kindly help me with this issue.
    Thanks,
    Vidhya

    Hi
    I have the same issue. could anyone provide the link or template. I searched in the forums but couldnt find related to this post.
    please help
    Thanks

  • How to display pagewise total in Oracle reports?

    Hi,
    I want to display pagewise total in all pages as well as report total at the last page of the report.
    I have tried Reset at : Page, Print on : All pages
    But nothing is working.
    Please suggest what else I need to set to achieve the requirement
    Thanks in Advance
    Sudeep

    Create a user parameter for line count and another to hold the value of total at end of page,
    create formula column in your query group, where the column to be summarised exists,
    See how many lines of records/transaction can be printed on your page, count them in a formula column and when the printable record been retrived assign the total to
    the user parameter you have created.
    set the property 'PRINT OBJECT ON' to 'ALL BUT LAST PAGE'
    put you summary item just below this field and set the property 'PRINT OBJECT ON' to 'LAST PAGE', the final total will be displayed on last page.

  • I want to check/see the total quantity of items from fixed asset module

    Dear All,
    When I create purchase requisitions or purchase order, at the time of selection of items (Printer etc)…
    I want to check/see the total quantity of items from fixed asset module.
    Please guide, me how can I see the total items are available in fixed assets, on purchase order
    Product Detail
    Database Server
    RDBMS : 10.2.0.5.0
    Oracle Applications : 11.5.10.2
    Machine : ofadb.thecityschool.edu.pk
    User : APPS
    Oracle SID : PROD
    System Date : 16-APR-2012 13:27:37
    Database Server PID : 13485
    Session SID : 1437
    SERIAL# : 12175
    AUDSID : 32767692
    Database CPU Usage (in secs) : 0.69
    Regards

    Oracle does not offer this functionality.
    You will have to write a personalization that will query FA based on the item and display the message to the user.
    To invoke this personalization, the user may have to go to tools > show FA. This Show FA is a new option you create by personalization.
    Sandeep Gandhi

  • Display of total in Main window in Sapscript

    Hello guys,
    can you please help me with the following?
    Working with Standard transaction F.2c standard program RFDUZI00 whereby I have to make a copy of the standard Sapscript F_DUZI_01 for a specific company code and modify its layout. Requirement is that:
    On the 1st page, the table should contain a maximum of 12 lines.
    On the following page (if several pages are required), the subtotals and the sum total cannot be displayed alone on the last page. If so, the 2 last lines of the previous page should be reported on the last page (and, of course, deleted from the page before the last page)
    Can  please anyone who's done smething similar help me to implement the above?

    Hi
    U can create a secondary window tyoe VAR placed in the footer of the oages when u print the subtotal or the total
    Max

  • Copying sum total in sapscript

    Hi Experts,
    we have a customer invoice print in sapscript. In this we calculate the sum total in the end of the script .
    My question is how to copy the same sum total to be displayed in the first page of the script.
    Thanks in advance..

    Hii
    put the summation filed in the first page of script
    regards
    Jaipal

  • Display '0s' for null database items Please help!

    Hi all,
    I need your help on a possible minor problem I'm encountering. I have 5 fields (all numeric data types) on my form of which, the last field is a sum (formula non-database item) of the top four items. 2 out of the remaining 4 fields are database text items in which I'd like to update the database based on user input. The table that stores the 4 values does not require data and defaults to null if no data present.
    What I'd like to do is display a '0' on the form so that its visible and it could get added to the formula sum item but not update the database fields with a '0' (if any one of those top 4 fields returns null from the table ). I've tried creating a formula in the property palette on the fields with an nvl(field,0) function and got a chain reference error that I couldn't figure out based on the oracle error suggestions. Does anyone have any suggestions on how I could handle my request. Any help would be greatly appreciated.
    Thanks,
    Eric

    Zakiy,
    I don't know much about the POST-CHANGE trigger. Did a little research and posted some code in there retrieving the nvl(field) value. It compiled ok but didn't display the '0.' I'm not sure if I used the trigger the right way.
    Here's my code:
    DECLARE
    v_points NUMBER;
    CURSOR c_points IS
    (SELECT nvl(points,0)
    FROM student
    WHERE student_id = :id);
    BEGIN
    OPEN c_points;
    FETCH c_points INTO v_points;
    CLOSE c_points;
    END;
    If this is incorrect, do you have an example from what you were thinking? Also, just out of curiosity, why do you recommend this trigger over the formula?
    From what I was mentioning before, I don't know why the formula w/the nvl works in the sum field but doesn't in the other 4 fields. The sum field is a non-database item whereas 2 others are display items and the remaining 2 are text items. Seems simple enough to use the nvl in the formula section for all 4 fields I kept getting that error.
    Eric

  • Sum total bug

    I have a bug in 4.1.41 with Sum Total at the right...
    Each cell in my display is a simple calc like SUM(Hits). This is then Sum totaled as a Grand total at
    the right. Everything works fine in this case.
    Now if I replace my simple calc with a more complex calc into the same calculation: DECODE(SIGN(NVL(SUM(Hits),0)-NVL(SUM(DECODE(Category,'Audio',Hits,'TV and Music',Hits,0)),0)+NVL(SUM(DECODE(Page,'Digital Music',Hits,'Listen to Music',Hits,0)),0)),1,0,1)...the Grand total at the right works fine the first time...until I save the sheet and exit...and then get back into Discoverer.
    When I get back into Discoverer...my Grand total at the right displays as all blanks. It simply refuses to display like it did the first time when I defined it. In order to get around this bug, I have to makeup a new simple calc, and then redefine it by putting my more complex definition into it.
    This gets old and is tedious. Anybody know what is going on?

    I have a bug in 4.1.41 with Sum Total at the right...
    Each cell in my display is a simple calc like SUM(Hits). This is then Sum totaled as a Grand total at
    the right. Everything works fine in this case.
    Now if I replace my simple calc with a more complex calc into the same calculation: DECODE(SIGN(NVL(SUM(Hits),0)-NVL(SUM(DECODE(Category,'Audio',Hits,'TV and Music',Hits,0)),0)+NVL(SUM(DECODE(Page,'Digital Music',Hits,'Listen to Music',Hits,0)),0)),1,0,1)...the Grand total at the right works fine the first time...until I save the sheet and exit...and then get back into Discoverer.
    When I get back into Discoverer...my Grand total at the right displays as all blanks. It simply refuses to display like it did the first time when I defined it. In order to get around this bug, I have to makeup a new simple calc, and then redefine it by putting my more complex definition into it.
    This gets old and is tedious. Anybody know what is going on?

  • Data Display as Total

    Hi,
    I am facing one issue, we have created new accounts to display data in STAT currency. Data is loaded at cost center level.
    When we create report on those accounts, I am seeing data is displaying as total for all cost centers. I need data to be display by each company and cost center.
    There are other account which are displaying as detail.
    Please help me to find out why those accounts are displaying as TOTAL.
    Any help is greatly appreciated.
    Thanks,
    Poojak

    Thanks for quick reply.
    I have to change this in Answer.
    e.g. SUM(Transaction Amount by Company, Costcenter).
    For that column group the sum by company and cost center.
    Please let me know I new to OBIEE.Still learning to create reports.
    Thanks,
    Poojak

Maybe you are looking for

  • HT5622 Should my family share one apple id or each have their own?

    Should my family share one apple id or each have their own?  I want to be in control of the id and password since my kids are 10 and 12.

  • Error When inserting Content Query Web part onto the page

    i am using share point 2010 and when i am trying to insert content query web part onto the page i am getting the following error i checked the correlation id in the logs file but could not find anything useful in it. please suggest why this problem o

  • Mac OS Yosemite crashes while booting

    Recently I have upgraded my MPB to Yosemite. It does crash once in a while. I think mostly while using chrome browser. Today it crashed. So, I restarted it. But it started crashing while it was booting up. Tried several times but it kept crashing and

  • Best Final Cut Studio tutorial?

    Hi, I would like to know where to find the best tutorial for Final Cut Studio. I have found some free downloads on the internet, but I would like the best DVD on the market to learn about final cut pro, soundtrack and all the other programs in the Fi

  • Update forms 6i

    Hei, Can someone help me with this: I have two blocks where 3 primary keys are passed from the first block to the next. (there is NO master/deatil relation between them) and when I make a change in a field in the next block(not on the primary keys)an