I'm making an automatic invoice in reporting services for our company but I'm starting to run into some issues. The invoices are made monthly and most of them simply consist of 'Hour Rate x Worked Hours'. However we also have some contracts with partners who we charge a fixed amount each month, no matter the time we spent on working for them. This is the code that's written in the field where the amount payable shows up:
=SUM(Fields!DurationHours.Value * Fields!HourlyRate.Value)
Would it be possible to make the field with an Iif-expression (for example: =IIf(Fields!Customerid.Value = 30,"7000","0")
or is this not doable?
In this example customer 30 should pay 7000 fixed. But I don't know what to put instead of the zero cause it should show 'Hour Rate x Worked Hours' if the customerid is not 30. If this is possible, how should I enter more customerids cause we have around 10 partners that pay a fixed price.
Thanks in advance
The Switch function is useful when you have three or more conditions to test. The Switch function returns the value associated with the first expression in a series that evaluates to true :
=Switch( Fields!Customerid.value= 1,"1000", Fields!Customerid.value= 2,"2000", Fields!Customerid.value= 3,"3000", Fields!Customerid.value= 4,"4000", Fields!RCustomerid.value= 5,"5000", Fields!Customerid.value= 6,"6000", Fields!Customerid.value= 7,"7000", Fields!Customerid.value= 8,"8000", Fields!Customerid.value= 9,"9000", Fields!Customerid.value= 10,"10000",Fields!Customerid.value<>1 or Fields!Customerid.value<>2 or Fields!Customerid.value<>3 or Fields!Customerid.value<>4 or Fields!Customerid.value<>5 or Fields!Customerid.value<>6 or Fields!Customerid.value<>7 or Fields!Customerid.value<>8 or Fields!Customerid.value<>9 or Fields!Customerid.value<>10,SUM(Fields!DurationHours.Value * Fields!HourlyRate.Value))
Just replace with your Customerid.