8 Replies - 1964 Views - Last Post: 14 February 2013 - 07:22 AM Rate Topic: -----

#1 malkythedude  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 02-August 11

Crystal reports Datatype problems

Posted 12 February 2013 - 06:28 PM

Hello!

I have this formula in crystal reports (basic syntax) which gets the sum of the GROUPED QTY in my report
Formula = sum({Report_on_Totals.QTY})

When I save the formula, Crystal outputs that 'No Errors were found'.
QTY is grouped by BIDITEMCATEGORY and BIDITEMDESCRIPTION.

The Dataset gets data from my datagridview control via this syntax, which in turn I
set as my datatype onto my CrystalReports form:
 Dim dt As New DataTable
           
            dt.Columns.Add("UID") 
            dt.Columns.Add("BIDNAME") 
            dt.Columns.Add("Iteration") 
            dt.Columns.Add("BIDDERCODE") 
            dt.Columns.Add("BIDDERNAME") 
            dt.Columns.Add("BIDITEMCATEGORY") 
            dt.Columns.Add("BIDITEMDESC")
            dt.Columns.Add("BIDITEMNAME") 
            dt.Columns.Add("QTY") 
            dt.Columns.Add("UOM") 
            dt.Columns.Add("Materials")
            dt.Columns.Add("Others")
            dt.Columns.Add("Extension") 
            dt.Columns.Add("Total")
            dt.Columns.Add("Remarks") 
          
            For Each dr As DataGridViewRow In DGVNeed.Rows
                dt.Rows.Add(dr.Cells(7).Value, dr.Cells(8).Value, dr.Cells(9).Value, dr.Cells(10).Value, _
                dr.Cells(11).Value, dr.Cells(0).Value, dr.Cells(1).Value, dr.Cells(3).Value, Int(dr.Cells(4).Value) _
                , dr.Cells(5).Value, Decimal.Parse(dr.Cells(12).Value), Decimal.Parse(dr.Cells(13).Value), Decimal.Parse(dr.Cells(14).Value), Decimal.Parse(dr.Cells(15).Value), _
                dr.Cells(6).Value)
            Next
            
            Dim rptdoc As CrystalDecisions.CrystalReports.Engine.ReportDocument
          
            rptdoc = New OutputGenerator
            rptdoc.SetDataSource(dt)
            Dim x As New ReportGenerator

            x.CrystalReportViewer1.ReportSource = rptdoc

            x.Show()



I made sure the Dataset's datatype is corresponding to the proper datatype (Int64 since QTY is a whole number (Is this the right Datatype though?))

The problem is, when I compile, VB outputs an error that says 'A Number Field or Currency Amount Field is Required Here'. Any help would be greatly appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: Crystal reports Datatype problems

#2 tycos  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 53
  • Joined: 12-February 13

Re: Crystal reports Datatype problems

Posted 13 February 2013 - 05:07 PM

Been a while since I used Crystal Reports but there is a menu for creating a summary on a column?

Insert Summary, Insert Subtotal or Insert Grand Total

I think I would need more details to check this.
Was This Post Helpful? 0
  • +
  • -

#3 malkythedude  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 02-August 11

Re: Crystal reports Datatype problems

Posted 13 February 2013 - 05:44 PM

Hello and thank you for taking notice Tycos!

I've tried that (inserting summary) but the problem is, it just gives the total items the gorup has, and not really the total amount of each quantity present in the group

ex.
copper tubing 88
metal tubing  10
________________
Total quanitites needed = [b]2[/b]

instead of

copper tubing 88
metal tubing  10
________________
Total quanitites needed = [b]98[/b]




I appreciate the help, and Happy Valentines day to you!
Was This Post Helpful? 0
  • +
  • -

#4 tycos  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 53
  • Joined: 12-February 13

Re: Crystal reports Datatype problems

Posted 13 February 2013 - 07:58 PM

And running Totals are the same outcome?
Was This Post Helpful? 0
  • +
  • -

#5 malkythedude  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 02-August 11

Re: Crystal reports Datatype problems

Posted 13 February 2013 - 08:09 PM

I've tried looking at all options available from the summary field
(right click, insert, Summary, Calculate this summary:),
but I'm afraid there's no running totals :<

I did make sure that the fields in my datatable in my dataset are int 64.
Was This Post Helpful? 0
  • +
  • -

#6 tycos  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 53
  • Joined: 12-February 13

Re: Crystal reports Datatype problems

Posted 13 February 2013 - 08:13 PM

I don't have CR installed at the moment have not used it for some time:

http://victoriayudin...rystal-reports/

Is this link still relevant?
Was This Post Helpful? 0
  • +
  • -

#7 malkythedude  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 02-August 11

Re: Crystal reports Datatype problems

Posted 13 February 2013 - 08:28 PM

Argh, I guess I'm using an old version of crystal reports then (one that comes with .net2005)
I tried right clicking, but alas there was no running total option :<
Was This Post Helpful? 0
  • +
  • -

#8 malkythedude  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 02-August 11

Re: Crystal reports Datatype problems

Posted 13 February 2013 - 09:20 PM

perhaps there is a syntax workaround to get the results needed? I tried this
sum(CBool({Report_on_Totals.QTY}))

but it outputs an error syaing 'A number or currency field is required here'. Last I checked the field I'm trying to pass is already an integer
Was This Post Helpful? 0
  • +
  • -

#9 tycos  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 53
  • Joined: 12-February 13

Re: Crystal reports Datatype problems

Posted 14 February 2013 - 07:22 AM

Why are you using CBool?

CBool Function is used to convert an integer value to Boolean datatype.

This post has been edited by tycos: 14 February 2013 - 07:25 AM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1