# Crystal reports Datatype problems

Page 1 of 1

## 8 Replies - 3813 Views - Last Post: 14 February 2013 - 07:22 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=312075&amp;s=c0df1fad56c9baa05cd5b46cfb467f6f&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 malkythedude

Reputation: 0
• 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

For Each dr As DataGridViewRow In DGVNeed.Rows
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

Reputation: 4
• 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.

### #3 malkythedude

Reputation: 0
• 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]

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

```

I appreciate the help, and Happy Valentines day to you!

### #4 tycos

Reputation: 4
• 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?

### #5 malkythedude

Reputation: 0
• 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.

### #6 tycos

Reputation: 4
• 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/

### #7 malkythedude

Reputation: 0
• 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 :<

### #8 malkythedude

Reputation: 0
• 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

### #9 tycos

Reputation: 4
• 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