none
Convert SSRS Expressions to Code?

    Question

  • Hi All,

    I have four basic expressions I use in 200+ spots on one report. I would really like to convert these to Code (so I can store them in one spot and reference them in the report). My current problem is I don't know how to write code, and this thing is due! I'm scheduled to start code training soon, but as I mentioned I really need this now. If anyone could help it is very appreciated!

    E1. Where the expression is stored: Stored in a normal column
    =Format(Fields!LCOM_PAR_Tdy.Value,"0") & " (" & IIF(Fields!LCOM_PAR_Tdy.value=0 Or Fields!LCOM_PAR_TdyLstYr.value=0, "N/A", Format((Fields!LCOM_PAR_Tdy.Value - Fields!LCOM_PAR_TdyLstYr.Value) /iif( Fields!LCOM_PAR_Tdy.Value=0,1, Fields!LCOM_PAR_Tdy.Value),"p2")) & ")"


    E1 creates this:

    

    E2. Where the expression is stored: Indicator Properties > Values and States > "Icon"
    =Switch(Sum(Fields!LCOM_PAR_Tdy.Value, "MTSU_AdmStats") > Sum(Fields!LCOM_PAR_TdyLstYr.Value, "MTSU_AdmStats"), "ArrowUp", Sum(Fields!LCOM_PAR_Tdy.Value, "MTSU_AdmStats") < Sum(Fields!LCOM_PAR_TdyLstYr.Value, "MTSU_AdmStats"), "ArrowDown", Sum(Fields!LCOM_PAR_Tdy.Value, "MTSU_AdmStats") = Sum(Fields!LCOM_PAR_TdyLstYr.Value, "MTSU_AdmStats"), "ArrowSide")

    E3. Where the expression is stored: Indicator Properties > Values and States > "Color"
    =Switch(Sum(Fields!LCOM_PAR_Tdy.Value, "MTSU_AdmStats") > Sum(Fields!LCOM_PAR_TdyLstYr.Value, "MTSU_AdmStats"), "Green", Sum(Fields!LCOM_PAR_Tdy.Value, "MTSU_AdmStats") < Sum(Fields!LCOM_PAR_TdyLstYr.Value, "MTSU_AdmStats"), "Red")

    E2 & E3 create this:


    I also open to any advice on how best to manage this. Like I said, I have these expressions in over 200 different places! (For example, I'm not sure if these can be copied to multiple places at once or anything like that.)
    Wednesday, August 28, 2013 5:10 PM

All replies