Showing posts with label comparison. Show all posts
Showing posts with label comparison. Show all posts

Monday, March 12, 2012

Expressions in For Loop Container

Hi,
I am having problem when setting for-each container's EvalExpression as a variable comparison.

I have set this in expression editor
@.[User::Syn] == 1

Editor says that it couldnt convert from System.Bool to System.String.

If I put it in quote, then for-each container says that it needs Bool, not String.

Please help me with this,
Thanks
@.[User::Syn] == "1"|||Syn is of Int32 datatype.
And now it says

Expression cannot be evaluated.

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%u00ae+Visual+Studio%u00ae+2005&ProdVer=8.0.50727.42&EvtSrc=Microsoft.DataTransformationServices.Controls.TaskUIFramework.TaskUIFrameworkSR&EvtID=FailToEvaluateExpression&LinkId=20476

The data types "DT_I4" and "DT_WSTR" are incompatible for binary operator "==". The operand types could not be implicitly cast into compatible types for the operation. To perform this operation, one or both operands need to be explicitly cast with a cast operator.

Attempt to set the result type of binary operation "@.[User::SyncStatus] == "0"" failed with error code 0xC0047080.

(Microsoft.DataTransformationServices.Controls)|||actually, EvalExpression property is string and expression editor must end up with some string value and something == something is basically a boolean.|||So is it User::Syn or User::SyncStatus? If SyncStatus is a DT_I4, then this should work:

@.[User::SyncStatus] == 0

It works for me.|||

Fahad349 wrote:

actually, EvalExpression property is string and expression editor must end up with some string value andsomething == something is basically a boolean.

EvalExpression "must evaluate to a Boolean"|||

Fahad349 wrote:

actually, EvalExpression property is string and expression editor must end up with some string value andsomething == something is basically a boolean.

Why aren't you using the EvalExpression in the editor, not the expression property?

If you are editing the property expressions, then this is what you'd want:

"@.[User::SyncStatus] == 0"

Friday, March 9, 2012

Expressions

Is there a good guide out there that I can reference for expressions?
Crystal's formula editor seems very strong in comparison, and frankly
if we can't find any decent documentation with good examples, we may
just ditch reporting services for Crystal.
We have several legacy reports in Crystal that have some lengthy
formulas. As we are a medical technology firm, we have many laws we
must follow, and our formulas have to take tons of things into
account.
Can anyone point me towards some decent resources?Hi Rick:
If the formulas and expressions are long and involved, you might want
to consider writing a custom assembly ( a dll written in a .NET
language, like VB.NET or C#).
You can reuse the logic in the assembly in other reports and even
other applications. The methods in the assembly can call each other.
It can open up the entire .NET framework for you, including all the
Math functions, the data structures like lists and hashtables, the
File IO operations, and so on. In Crystal you can't even get close to
this level of abstraction and functionality.
This might be a steeper learning curve compared to the function editor
in Crystal, but it is much more powerful.
If you google for [reporting services custom assembly] you'll see a
number of resources on the internet to help out.
--
Scott
http://www.OdeToCode.com/blogs/scott/
On 15 Oct 2004 05:21:23 -0700, rickb@.wynpartners.com (RickB) wrote:
>Is there a good guide out there that I can reference for expressions?
>Crystal's formula editor seems very strong in comparison, and frankly
>if we can't find any decent documentation with good examples, we may
>just ditch reporting services for Crystal.
>We have several legacy reports in Crystal that have some lengthy
>formulas. As we are a medical technology firm, we have many laws we
>must follow, and our formulas have to take tons of things into
>account.
>Can anyone point me towards some decent resources?