Calculation syntax errors

Stimulsoft Reports.NET discussion
Post Reply
aussiegirl
Posts: 15
Joined: Thu Apr 08, 2010 12:29 am

Calculation syntax errors

Post by aussiegirl »

Hello

I am trying to get some totals and calculations in the designer, but I am having few issues...
The scenario that I'm working on is:
Sum the values
calculate a percentage on the value

So I get the Total of the values which like this and it works
{Sum(DataJobs,JobsParts.TotalBuyExTax)}

Now I want to calculate a percentage of this using a field in the database

{Sum(DataJobs,JobsParts.TotalBuyExTax) * (DatabandName, Mydatasource.mypercentcolumn)}

But it ways gives me errors to say that using the * operand is not allowed for decimal and strings
If I use this syntax
{Sum(DataJobs,JobsParts.TotalBuyExTax) * 1}

It works but it's not the result I want..

If I use this syntax

{Sum(DataJobs,JobsParts.TotalBuyExTax) * 1.5}

I get the error about the operand * again.

Both these fields in the database are data type currency

Any help would be appreciated
aussiegirl
Posts: 15
Joined: Thu Apr 08, 2010 12:29 am

Calculation syntax errors

Post by aussiegirl »

Well it appears I have found the problem, when setting new ODBC connection and data source from the Designer ALL the fields data type comes through as STRING, regardless of what data types they are in the database.

Obviously I was trying to calculate strings which is why I was getting these errors. I didn't think to check the data types in the Dictionary properties, once I changed them to Int it all worked as suppose to.

Is this how it's suppose to be or have I done some thing wrong, when creating new connections and data source?
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Calculation syntax errors

Post by Andrew »

Hello,

We use ADO.NET for getting information from Database. ADO.NET uses ODBC driver. Maybe you need to try using another driver.

Thank you.
aussiegirl
Posts: 15
Joined: Thu Apr 08, 2010 12:29 am

Calculation syntax errors

Post by aussiegirl »

Hi Andrew

I have used the default microsft odbc drivers from my system, and I have used the Micrsoft Jet ole connection as well connecting to a .mdb file with the same results, all data types comes through as string..

I have also tested another report writing package similiar to Stimulsoft and that appears to bring in the data correctly.

This is only an issue if I create th data source / connection within the designer, if it create the data source from my VB.net application then it works fine
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Calculation syntax errors

Post by Andrew »

Hello,

Could you, please send the following information to support@stimulsoft.com :
1. the exact driver name,
2. code you use,
3. report,
4. database (if possible).

Thank you.
Post Reply