Results 1 to 2 of 2

Thread: Crystal Report problem in sum of data

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2012
    Location
    PH
    Posts
    11

    Unhappy Crystal Report problem in sum of data

    Hey guys
    Im having a problem in my crystal report where i want to see the sum of the quantity of items and their subtotal but my crystal report seems to sum the wrong data

    here is the data when i run my program and preview the crystal report:
    Name:  crystal.JPG
Views: 1029
Size:  50.3 KB

    what i want to see is the sum of the quantity and the subtotal not the number of items listed in the report

    but when i preview the crystal report using report preview the sum of data is working

    here is the crystal report when i don't run my program:
    Name:  reportview.JPG
Views: 956
Size:  50.5 KB



    here is my code when viewing crystal report in my program:

    Code:
    Public Sub ReportTotalSalesItems(ByVal LV As ListView)
            Dim rReport As New ReportTotalSales
            Dim row As DataRow = Nothing
            Dim ds As New DataSet
            ds.Tables.Add("SalesTransactionDetails")
            With ds.Tables(0).Columns
                .Add("InvoiceNo")
                .Add("ProductCode")
                .Add("ProductName")
                .Add("QuantitySold")
                .Add("SubTotal")
            End With
            For Each LVI As ListViewItem In LV.Items
                row = ds.Tables(0).NewRow
                row(0) = LVI.Text
                row(1) = LVI.SubItems(1).Text
                row(2) = LVI.SubItems(2).Text
                row(3) = LVI.SubItems(3).Text
                row(4) = LVI.SubItems(4).Text
                ds.Tables(0).Rows.Add(row)
            Next
            rReport.SetDataSource(ds.Tables(0))
            ReportViewer.CrystalReportViewer1.ReportSource = rReport
    please help me guys

  2. #2

    Thread Starter
    New Member
    Join Date
    Apr 2012
    Location
    PH
    Posts
    11

    Re: Crystal Report problem in sum of data

    I Solved it.. when i add the data in the crystal report it converts my data to string thats why the report uses COUNT instead of SUM. So I use the "ToNumber" formula in crystal report then inserted it as the substitute for quantity and subtotal.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width