Showing posts with label expression. Show all posts
Showing posts with label expression. Show all posts

Monday, March 26, 2012

getting "this.cell.value" from an expression

What I'd like to do is apply an expression for a bunch of cells thats
not dependant on the underlying data...
for cell bgcolor I'd like it to basically say if value != 0, bgcolor is
gray or something
so for bgcolor I pick expression and would like to say IIF(this.Value = 0,"White","Gray")
My question is how can I get a reference to the current cell. I can
determine by the underlying data, eg mydata.Value.whatever, but I'd like
to be able to apply the same expression to about 20 diff columns.
Thanks in advance
Weston WeemsThe matrix cell content seems to be a textbox from your description. On the
textbox background property, use the following expression:
=iif(Me.Value = 0, "White", "Gray")
Note: Me.Value can only be used to access the value of the current textbox.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Weston Weems" <wweems@.nospam_itsucksGMAIL.COM> wrote in message
news:uZ$tTvExFHA.2936@.TK2MSFTNGP10.phx.gbl...
> What I'd like to do is apply an expression for a bunch of cells thats not
> dependant on the underlying data...
> for cell bgcolor I'd like it to basically say if value != 0, bgcolor is
> gray or something
> so for bgcolor I pick expression and would like to say IIF(this.Value => 0,"White","Gray")
>
> My question is how can I get a reference to the current cell. I can
> determine by the underlying data, eg mydata.Value.whatever, but I'd like
> to be able to apply the same expression to about 20 diff columns.
>
> Thanks in advance
> Weston Weemssql

Getting "infinity" when running this expression

When I run this expression, percentage, I'm still getting infinity as my
return when I have a zero in one of the columns
=IIF(SUM(IIF(DATEPART("yyyy",Fields!APR_DT.Value) = DATEPART("yyyy",NOW()),
Fields!APR_CNT.Value,0))-SUM(IIF(DATEPART("yyyy",Fields!APR_DT.Value) = DATEPART("yyyy",NOW())-1, Fields!APR_CNT.Value,0))=0, 0,
SUM(IIF(DATEPART("yyyy",Fields!APR_DT.Value) = DATEPART("yyyy",NOW()),
Fields!APR_CNT.Value,0))-SUM(IIF(DATEPART("yyyy",Fields!APR_DT.Value) = DATEPART("yyyy",NOW())-1, Fields!APR_CNT.Value,0))) /
IIF(SUM(IIF(DATEPART("yyyy",Fields!APR_DT.Value) = DATEPART("yyyy",NOW())-1,
Fields!APR_CNT.Value,0)) = 0, 1, SUM(IIF(DATEPART("yyyy",Fields!APR_DT.Value)
= DATEPART("yyyy",NOW())-1, Fields!APR_CNT.Value,0)))
Any ideas where I'm screwing up... Thanks in advanceThe IIF is a VB function. All function arguments are evaluated immediately
before the function is called. So this will fail: IIF(1 = 1, 1/1, 1/0) even
though it seems like 1/0 should not be evaluated because the condition (1=1)
is true.
This is what most likely happening in your expression.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"scuba79" <scuba79@.discussions.microsoft.com> wrote in message
news:C3944D44-31B9-449C-ABC3-DFF6036BC46D@.microsoft.com...
> When I run this expression, percentage, I'm still getting infinity as my
> return when I have a zero in one of the columns
> =IIF(SUM(IIF(DATEPART("yyyy",Fields!APR_DT.Value) =DATEPART("yyyy",NOW()),
> Fields!APR_CNT.Value,0))-SUM(IIF(DATEPART("yyyy",Fields!APR_DT.Value) => DATEPART("yyyy",NOW())-1, Fields!APR_CNT.Value,0))=0, 0,
> SUM(IIF(DATEPART("yyyy",Fields!APR_DT.Value) = DATEPART("yyyy",NOW()),
> Fields!APR_CNT.Value,0))-SUM(IIF(DATEPART("yyyy",Fields!APR_DT.Value) => DATEPART("yyyy",NOW())-1, Fields!APR_CNT.Value,0))) /
> IIF(SUM(IIF(DATEPART("yyyy",Fields!APR_DT.Value) =DATEPART("yyyy",NOW())-1,
> Fields!APR_CNT.Value,0)) = 0, 1,
SUM(IIF(DATEPART("yyyy",Fields!APR_DT.Value)
> = DATEPART("yyyy",NOW())-1, Fields!APR_CNT.Value,0)))
>
> Any ideas where I'm screwing up... Thanks in advance

Wednesday, March 21, 2012

GETDATE() and the local time zone

I have used the GETDATE() function within an expression to create a directory name based on the current date. I am in the Sydney time zone and the new day's folder name doesn't change until after 11 am - so GETDATE() is picking up the date and not adjusting for the time zone. How do I either set the time zone within the package or make the GETDATE() function look at time zone of the system on which it is run?You'll have to explain, because getdate() returns the system time where it is executed, time zone included. So.......|||Hmm.. that set me thinking about another date issue we have. We run in a citrix environment and I have noticed odd date displays before. This function behaves differently depending on whether I use RDP or ICA. I tested it by logging in under both types of session and creating an expression with GETDATE() in it and then evaluating it. The results were correct for RDP but not for ICA - so it looks like the problem is outside SSIS.

Monday, March 19, 2012

Get value of 10 textboxes to decide footer color

If I have the 10 textboxes in my footer with a value of "X" (from an IIF() expression), then I would like to alert the users and have the footer a different color.

I'm trying to get the value of the textbox, but keep getting an error of it being undeclared. I'm trying different syntax, but can't get it to work.

Here's the code:

=
IIF(
textbox11 ="X" or textbox15="X" or textbox19="X" or textbox27="X" or textbox23 = "X" or textbox31 = "X" or textbox35 = "X" or textbox39 = "X" or textbox43 = "X" or textbox47 = "X"
,"Gainsboro","Transparent")

I am also trying to reference a textbox.value in a different textbox with the same error.

How do you accomplish this in RS for SQL 2000?

Jason|||You need to use the ReportItems collection:

IIF(
ReportItems!textbox11.Value ="X" or ReportItems!textbox15.Value="X" or ReportItems!textbox19.Value="X" or ReportItems!textbox27.Value="X" or ReportItems!textbox23.Value = "X" or ReportItems!textbox31.Value = "X" or ReportItems!textbox35.Value = "X" or ReportItems!textbox39.Value = "X" or ReportItems!textbox43.Value = "X" or ReportItems!textbox47.Value = "X"
,"Gainsboro","Transparent")|||That seems to get me closer, but it still doesn't get me past the scope issue. I've moved my post to a seperate thread with a more detailed description of what I'm trying to do.

Jason

Monday, March 12, 2012

Get toggle state in an expression

Is it possible to get a toggle state in an expression?
I'm thinking something like:
=Switch( ReportItems!textbox8.ToggleState, true,
RunningValue(1, Count, "table1") > 3, true,
true, false)
Of course, "ToggleState is not a member of ReportItem". Is there a
member that will tell me if the toggle box is showing a + or -? Or
some other way of telling if the button has been toggled?
ThanksHi steve,
Even I am looking for same kind of solution.Did you come across anything for
this.
Do mind sharing it?
thanks
S
"Steven" wrote:
> Is it possible to get a toggle state in an expression?
> I'm thinking something like:
> =Switch( ReportItems!textbox8.ToggleState, true,
> RunningValue(1, Count, "table1") > 3, true,
> true, false)
> Of course, "ToggleState is not a member of ReportItem". Is there a
> member that will tell me if the toggle box is showing a + or -? Or
> some other way of telling if the button has been toggled?
> Thanks
>|||Me too! Did you find a solution?
"ERS Developer" wrote:
> Hi steve,
> Even I am looking for same kind of solution.Did you come across anything for
> this.
> Do mind sharing it?
>
> thanks
> S
> "Steven" wrote:
> > Is it possible to get a toggle state in an expression?
> > I'm thinking something like:
> > =Switch( ReportItems!textbox8.ToggleState, true,
> > RunningValue(1, Count, "table1") > 3, true,
> > true, false)
> >
> > Of course, "ToggleState is not a member of ReportItem". Is there a
> > member that will tell me if the toggle box is showing a + or -? Or
> > some other way of telling if the button has been toggled?
> >
> > Thanks
> >

Get Toggle state at report runtime

Hi,
I would like to find the toggle state of a textbox in the report to set an
expression according to that state. I need to navigate to a second report
with different parameters according to the toggle state of a particular row
in my report. How do I write the expression (something like iif(toggle state
= 'Collapsed', Parameter A, Parameter B))?
Thanks,
Ronen FidelHello Ronen,
Unfortunatly, you could not refer the visability state of an report item in
the expression.
I would like to know your business more detailed that I may provide a
solution instead of refer the visability.
Here is an example which have a conditional background color by the toggle
state.
Maybe this will be some help for you.
http://www.msbicentral.com/Downloads/tabid/96/Default.aspx
DrillDownSample.RDL
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Wei,
I'll add more details:
I created a matrix report. I created a group by on the row cell and added
navigation expression on the data cell. When the row cell is expanded the
drill through works fine since I send the row cell id as parameter to the
next report. When the row cell in collapsed, the data cell shows the sun of
all data correctly but the drill through is not working as it should since
the parameter value that it pass to the second report is the first value of
the grouped by data. I wanted to get the toggled state and then if it is
collapsed then send 'ALL' in the parameter and when it is expanded send the
row id.
Thanks,
Ronen Fidel
Unisfair
"Wei Lu [MSFT]" wrote:
> Hello Ronen,
> Unfortunatly, you could not refer the visability state of an report item in
> the expression.
> I would like to know your business more detailed that I may provide a
> solution instead of refer the visability.
> Here is an example which have a conditional background color by the toggle
> state.
> Maybe this will be some help for you.
> http://www.msbicentral.com/Downloads/tabid/96/Default.aspx
> DrillDownSample.RDL
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
> ==================================================> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>|||Hello Ronen,
To understand your issue better and try to reproduce this issue, I would
like to get some sample report from you.
You could send the report file to me. To get my email address, please
remove the ONLINE in my email.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Wei,
I sent you the reprt via email.
Thanks,
Ronen Fidel
Unisfair
"Wei Lu [MSFT]" wrote:
> Hello Ronen,
> To understand your issue better and try to reproduce this issue, I would
> like to get some sample report from you.
> You could send the report file to me. To get my email address, please
> remove the ONLINE in my email.
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
> ==================================================> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>