Report Design
 Crystal Reports Forum : Crystal Reports .NET 2003 : Report Design
Message Icon Topic: Crystal expression /Formulas help Post Reply Post New Topic
Author Message
Farberry
Newbie
Newbie
Avatar

Joined: 20 Apr 2011
Location: United States
Online Status: Offline
Posts: 1
Quote Farberry Replybullet Topic: Crystal expression /Formulas help
    Posted: 20 Apr 2011 at 11:45am
Can someone help me with this formula. I am very new to Crystal and im migrating crystal report s to MS SSRS. Can you explain me what this formula is going ? and any suggestions on how to use this in SSRS??
 
 
 

if ({?ShowDetails}=-1) then
{VW_RPT_VOLUME_SUMMARY.TOTALBASEPRICE}
else
if Left ({VW_RPT_VOLUME_SUMMARY.ACCOUNTCODE},1 )="5" then
0
else
{VW_RPT_VOLUME_SUMMARY.TOTALBASEPRICE}

!!! Farhan !!!
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 21 Apr 2011 at 7:10am
If the parameter called "ShowDetail" is 1 then display the total base price.  Otherwise, if the first character in the account code is "5" then display 0, else display the total base price.
 
-Dell
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 22 Apr 2011 at 10:43am

my ssrs is a bit rusty, it is just vb.net, but i don't remember the convention for a parameter

if @parameterShowDetails = -1 then
 table.TotalBasePrice
else
  if table.AccountCode.ToString.SubString(0,1) = "5" then
     0
  else
     table.TotalBasePrice
   end if
end if
 
would seem more economical to say
if @parameterShowDetails = -1 or table.AccountCode.ToString.SubString(0,1) <> "5"  then
 table.TotalBasePrice
else
     0
end if
 
HTH
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 25 Apr 2011 at 5:25am
You're correct - that would be a more efficient way of writing the formula.
 
-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.