Friends,
SSRS is a very good reporting tool and the only problem with this is This is a LIMITED one I feel. Limited in the sense, that the functions you can use is limited and hence it may not help you to acheive all the requirements of the clients. When the customer’s requirement exceeds the capability of Built-in functions of SSRS then we will need to write own own Code to meet the requirements. Writing your own code(function) is called Custom Code and this is a very useful feature provided by Microsoft. In this article I will demonstrate how to add custom code to SSRS.
There are two ways in which you can write your custom functions and use it in your report.
- Writing Code inside the report
- Using Custom Assemblies
Let us discuss about the first option here:
Let’s say we have to design a function which returns the Status of the sales of each product. For that lets create a report first which displays Product and Sales Amount as shown in the below pic –
- Select “Report Properties” from Reports main menu or in design View Right Click the design surface outside the border of the report and select “Report Properties” as shown below.
- Select Code tab and paste the following code to create custom function
Public Function Test(ByVal Sales As Decimal) As String
Dim status As String
If Sales >= 2000 Then
status = “High Profit”
ElseIf Sales >= 500 Then
status = “Moderate Profit”
Else
status = “Low Profit”
End If
Return status
End Function
- Click OK and now add a column to the Table used in report and give header as “Status” and right click on the data sell and select Expression as shown below.
- Write the expression as shown below and select OK.
=Code.Test(Fields!SalesAmount.Value) — “Fields!SalesAmount.Value” field based on which you wish to calculate status.
- Your report with Custom Funcmtion to calculate the Status(in other words KPI) is ready and if you click on preview you can see the output of the function you created.
That’s it .. Let us discuss about the second option in next post. Hope you understood how to add your custom code and make use of it in your report. Happy Coding !!
Regards,
Roopesh Babu V
help on essay writing how to write my essay i need help writing my essay
buy essay papers cheap which is the best essay writing service professional essay writing services
customer service essay admission essay writing services customer service essay
how to identify a thesis thesis proposal writing cruel angel’s thesis
thesis tester what is the turner thesis thesis topics
which of the following best describes what a thesis for a historical essay should be? thesis writing help doctoral thesis help
Why couldn’t I have the same or similar opinions as you? T^T I hope you also visit my blog and give us a good opinion. casinocommunity
brimhall pharmacy university compounding pharmacy pharmacy tech
sildenafil dosages how quickly does sildenafil work sildenafil citrate used for
caffeine and tadalafil tadalafil 20mg reviews tadalafil under tongue
does tadalafil boost testosterone https://tadafilax.com/ how long does tadalafil
cialis overnight shipment https://hdcillis.com/ cialis daily side effects
generic sildenafil sale online https://ethvigrix.com/ sildenafil 25 mg online
viagra 800mg https://foxviagrixed.com/ sildenafil 25mg 50mg 100mg
cialis fastest shipping https://crocilismen.com/ cialis name
cialis canada free sample https://hippharmo.com/
tadalafil works by blocking pde5 nitric oxide https://hoscillia.com/ cialis 20mg review
viagra 2018 https://vivigrix.com/ how much is viagra over the counter
tadalafil 20 mg buy online https://wwcillisa.com/ cialis online europe
cialis experience reddit https://uhdcilise.com/ does cialis shrink the prostate
200 mg sertraline 50 mg zoloft pregnancy zoloft weight gain or loss
lexapro vs prozac for anxiety withdrawal symptoms of lexapro what happens if you take too much escitalopram
benadryl and seroquel seroquel 400 mg street value quetiapine seroquel xr
quetiapine medicine seroquel 100mg price seroquel quetiapine fumarate
lidocaine increases toxicity of tapentadol by pharmacodynamic synergism buy cialis online without a prescription
norvasc and diabetes https://norvascamlodipinetce.com/ what is the drug amlodipine besylate used for
duloxetine and liver damage https://cymbaltaduloxetineztn.com/ can you take duloxetine at night
difference between lexapro and effexor escitalopram for ocd sertraline versus escitalopram
cymbalta for osteoarthritis cymbalta patient reviews cymbalta side affects
can omeprazole https://prilosecomeprazoleuxe.com/ prilosec otc dosage
can you od on sertraline https://zoloftsertralineaco.com/ wean off of zoloft
lexapro serotonin syndrome https://lexaproescitalopramogv.com/ lexapro street value
norvasc blood pressure pills norvasc for anxiety does norvasc affect heart rate
lorazepam interaction with quetiapine seroquel quetiapine brand name for quetiapine fumarate
seroquel effect seroquel drug gabapentin and quetiapine
duloxetine vs fluoxetine https://cymbaltaduloxetinesec.com/ cymbalta lawsuit settlement
what works better lexapro or celexa https://lexaproescitalopramogv.com/ can escitalopram cause weight gain
alternative to omeprazole side effects of omeprazole long term zantac or omeprazole
can you take mylanta with prilosec https://prilosecomeprazolezrv.com/ how much does prilosec cost
sertraline missed dose side effects https://zoloftsertralinedik.com/ can you take ibuprofen with sertraline
can i cut norvasc in half https://norvascamlodipinemry.com/ generic name for amlodipine
quetiapine tardive dyskinesia seroquel side effects weight gain seroquel pill
norvasc viagra compatibility https://norvascamlodipinemry.com/ effects of amlodipine
prilosec causing diarrhea https://prilosecomeprazolerls.com/ omeprazole long term
how to stop taking fluoxetine https://prozacfluoxetinerfk.com/ prozac 10mg side effects
cymbalta lyrica duloxetine cause weight gain switching from amitriptyline to duloxetine
increasing lexapro dosage from 10mg to 20mg https://lexaproescitalopramikd.com/ cost of escitalopram oxalate
how does omeprazole work https://prilosecomeprazolerls.com/ omeprazole dizziness
duloxetine price cvs https://cymbaltaduloxetinestb.com/ what is cymbalta used for
what are the effects of prozac fluoxetine 10 mg efectos secundarios fluoxetine 20 mg price walmart
seroquel xr prices lethal dose seroquel coming off seroquel
what is seroquel 100mg used for seroquel onset seroquel dose for bipolar
prilosec high https://prilosecomeprazolerls.com/ prilosec prescription dose
lexapro 10 mg for anxiety https://lexaproescitalopramikd.com/ lexapro vs effexor
wal mart prilosec https://prilosecomeprazolerls.com/ prilosec drug classification
duloxetine brand names https://cymbaltaduloxetinestb.com/ can you take duloxetine and clonazepam together
fluoxetine in dogs https://prozacfluoxetineatb.com/ prozac and libido