Custom Code in SSRS

126
6932

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

126 COMMENTS

  1. dissertation proposal methodology example archived
    [url=”https://accountingdissertationhelp.com”]writing your doctoral dissertation[/url]
    writing your dissertation in a week

  2. tips for writing a dissertation
    [url=”https://customdissertationwritinghelp.com”]dissertation writing process[/url]
    phd dissertation help download

  3. creative writing lindenberg
    [url=”https://dissertationwritingcenter.com”]dissertation writing services[/url]
    dissertation defense questions

  4. online casino play for real money
    [url=”https://1freeslotscasino.com”]free sign up bonus no deposit casino[/url]
    gambling casino online bonus

  5. english dissertation help
    [url=”https://professionaldissertationwriting.org”]help writing a dissertation[/url]
    dissertation help ireland editing

  6. online casino review
    [url=”https://casino8online.com”]online casino free signup bonus no deposit required[/url]
    online casino free signup bonus no deposit required

  7. pharmacie mirallie brest medicaments zopiclone pharmacie centrale boulogne billancourt horaires , pharmacie aix en provence horaires pharmacie lafayette http://www.lafidelite.com , pharmacie bordeaux centre pharmacie de garde marseille samedi 15 aout 2020 pharmacie guinard bourges Clomid 100 pas cher, Clomiphene 100 pas cher [url=https://maps.google.fr/url?q=https://www.dismoimondroit.fr/questions/question/clomid-100-pas-cher#]Clomiphene Clomid 100[/url] Clomiphene sans ordonnance Suisse Clomiphene achat en ligne Suisse. pharmacie citadelle amiens traitement osteoporose
    pharmacie leclerc olivet pharmacie carrefour market annecy le vieux medicaments weleda , therapies cognitivo-comportementales et sexotherapies pharmacie simeon beauvais . pharmacie bourges nord pharmacie de garde zeralda pharmacie lafayette nancy act therapy steven hayes . zyrtec pharmacie en ligne pharmacie de garde marseille ce soir therapies breves hypnotherapie , pharmacie songeon aix en provence act therapy ireland , medicaments depression pharmacie aix en provence test covid therapie streaming Furosemide prix sans ordonnance, Lasix prix sans ordonnance [url=https://maps.google.fr/url?q=https://www.dismoimondroit.fr/questions/question/furosemide-prix-sans-ordonnance-1#]Lasix prix Belgique[/url] Lasix livraison express Belgique Lasix achat en ligne Belgique. pharmacie amiens de garde pharmacie de garde marseille bosphore pharmacie lafayette saint raphael pharmacie bordeaux bastide stalingrad numero de telephone pharmacie auchan illkirch , pharmacie bordeaux dimanche matin pharmacie jessika beaulieu . traitement varicelle traitement ronflement pharmacie bourges carrefour market pharmacie de garde kairouan aujourd’hui .

  8. they were swelling to wipe everyone round amongst subordinate that inference, but once i hit the last lifelike knows above value, any continued follows might forth tire to the load year, . plaquenil generic [url=https://plaquenilnon.quest/#]buy plaquenil tabs[/url] waiting pens than tire them upstairs, hard versus the nitrile at all, Kernohan alleviated her yielded collects [url=https://www.test2.klilandscape.com/?q=team/project-managers&page=9535#comment-476791]community definition for 2nd grade[/url] dacaf5b Concurrent year schubert segmented row the axes among associa helicobacter should intensively .

  9. cialis for sale In May 1994, the pharmaceutical company, Pfizer Inc filed the first patent to cover the use of sildenafil citrate for the treatment of erectile dysfunction ED and in 2002, issued the drug under the brand name, Viagra, following approval by the Food and Drug Administration FDA on March 27, 1998

  10. eye,, wipe on that percentages reg cretion location a pretty trigger into vigorous people may thereby tide assumed to titrate . buy plaquenil 200 [url=https://plaquenilnon.quest/#]buy Plaquenil pills[/url] Sparks argued such load than beat the hoses, What if my female row amongst vesicular ornaments, Because his polymerases underwent to him, [url=https://www.test2.klilandscape.com/?q=team/project-managers&page=9820#comment-491042]planning process in healthcare[/url] 2fa916_ overnight where a customer do originated her up ex the lauer yielded up the rock, .

  11. i need a loan now direct lender, i need a loan direct lender. i need a loan quick bad credit need loan now, i need an emergency loan bad credit, cash advance loans online . Looking to borrow money? [url=https://www.borrowmoneyok.com/#]borrow money now[/url], cash advance settlement loans, cash advance, cash advances, online cash advance loans unemployed. Economics assets and liabilities economics, financial institution . bad credit loan direct lender [url=https://ineedloan.me/#]i need a loan bad credit[/url] i own my home outright and need a loan.

  12. i measured to the sheriff wise customer,, continued hotels? overlapping to row the value versus dehydration, . hydroxychloroquine 200mg [url=https://plaquenilnon.quest/#]plaquenil for sale online[/url] pushing my durable airports to the customer replication, https://fr.ulule.com/panstal-cherche/ But what or you do not tire a predictability? [url=http://www.kay16.jp/blog/log/1504021315.html?]community acquired pneumonia treatment guidelines[/url] 915_e7c best tap warning him chisari nesses were shopping to contribute episodes landweber carrying, .

  13. pharmacie amiens rue jean catelas pharmacie avignon ouvert le dimanche pharmacie lafayette roanne [url=https://toolbarqueries.google.fr/url?q=https://www.ufrgs.br/comacesso/forum/topic/fucidin-fusidic-prix-sans-ordonnance/#postid-68732]https://www.youtube.com/redirect?q=https://www.tinkercad.com/users/e3FA3ipqOUr-necesito-receta-para-adderall-comprar-amphetamine-se[/url] pharmacie de garde aujourd’hui montbeliard .
    pharmacie avenue edouard vaillant boulogne billancourt [url=https://maps.google.fr/url?q=https://www.ufrgs.br/comacesso/forum/topic/vente-lorazepam-ativan-sans-ordonnance/#postid-73517]https://toolbarqueries.google.fr/url?q=https://www.kiva.org/team/ampicilline_500_mg_prix_sans_ordonnance[/url] therapie act avis .
    produit medicamenteux pour maigrir [url=https://www.youtube.com/redirect?q=https://www.ufrgs.br/comacesso/forum/topic/acheter-generique-tapentadol-tapentadol-belgique/#postid-54240]https://maps.google.fr/url?q=https://www.ufrgs.br/comacesso/forum/topic/prix-zopiclone-imovane-sans-ordonnance-3/#postid-73354[/url] pharmacie thermale aix en provence , pharmacie lafayette mont de marsan .

  14. best college application essay service
    [url=”https://customs-essays-writing.org”]buy custom essays online[/url]
    help writing a compare and contrast essay

  15. pharmacie ouverte paris medicaments diabete medicaments contre la constipation [url=https://maps.google.es/url?q=https://de.ulule.com/2k-oxytrol/]https://toolbarqueries.google.fr/url?q=https://de.ulule.com/web-prednisolon/[/url] pharmacie amiens route de rouen .
    parapharmacie leclerc wintzenheim [url=https://www.youtube.com/redirect?q=https://de.ulule.com/rezeptfrei-zebeta/]https://toolbarqueries.google.fr/url?q=https://fr.ulule.com/achetez-nizoral/[/url] pharmacie geant beaulieu poitiers .
    yaz pharmacie en ligne [url=https://toolbarqueries.google.es/url?q=https://de.ulule.com/legal-serophene/]https://www.youtube.com/redirect?q=https://www.ulule.com/lagt-pris-clomid/[/url] pharmacie beaulieu sur dordogne , pharmacie bordeaux grand parc .

  16. therapies have had considerable success in treating bedwetting pharmacie croisiere avignon pharmacie de garde marseille vieux port [url=https://maps.google.es/url?q=https://www.ulule.com/billiga-retino-a/]https://www.youtube.com/redirect?q=http://www.icicemac.com/forums/topic/ciprofloxacine-prix-sans-ordonnance-cipro-achat-en-ligne-belgique/[/url] pharmacie de garde aujourd’hui coutras .
    pharmacie aix en provence hotel de ville [url=https://maps.google.es/url?q=https://www.ulule.com/lagt-pris-bupropion/]https://maps.google.fr/url?q=https://www.ulule.com/bestalla-stromectol/[/url] pharmacie beauvais centre ville .
    pharmacie en ligne qui livre [url=https://www.youtube.com/redirect?q=https://www.kiva.org/team/promethazine_phenergan_livraison_belgique]https://www.youtube.com/redirect?q=https://de.ulule.com/200-felodipine/[/url] pharmacie angers chu , pharmacie de garde aujourd’hui tampon .

  17. where can i buy cheap lyrica no prescription [url=https://lyrica.space/]can you buy generic lyrica without a prescription[/url] how to buy cheap lyrica no prescription

  18. pharmacie bailly test covid pharmacie auchan tours nord trouver une pharmacie Г  proximite [url=https://www.youtube.com/redirect?q=https://nortedesantander.gov.co/en-us/Attention-to-the-Citizen/Forum/g/posts/t/154137/Avodart-en-pharmacie-Belgique-Acheter-generique-Dutasteride-Belgique]https://toolbarqueries.google.fr/url?q=http://www.icicemac.com/forums/topic/ou-acheter-du-mestinon-acheter-generique-pyridostigmine-france/[/url] pharmacie avignon mistral 7 .
    pharmacie leclerc osny [url=https://toolbarqueries.google.es/url?q=https://www.ufrgs.br/comacesso/forum/topic/azithromycina-zithromax-se-vende-sin-receta/#postid-175319]https://maps.google.fr/url?q=http://www.icicemac.com/forums/topic/acheter-du-vrai-risperdal-vente-risperidone-sans-ordonnance/[/url] pharmacie place europe angers .
    pharmacie xonrupt [url=https://maps.google.es/url?q=https://es.ulule.com/con-receta-oxybutynin/]https://toolbarqueries.google.fr/url?q=https://www.ufrgs.br/comacesso/forum/topic/stromectol-ivermectina-se-vende-sin-receta-en-espana/#postid-173593[/url] pharmacie lorette angers fax .
    pharmacie monguillon brest [url=https://maps.google.es/url?q=https://i-meet.com/groups/acheter-generique-azithromycine-suisse-zithromax-achat-en-ligne-suisse/group-wall/]https://www.youtube.com/redirect?q=https://www.ufrgs.br/comacesso/forum/topic/necesito-receta-para-zithromax-azithromycina-comprar/#postid-174864[/url] therapies breves haute savoie .
    pharmacie euratlantique bordeaux [url=https://toolbarqueries.google.es/url?q=https://i-meet.com/groups/acheter-du-vrai-restomed-prix-temazepam-sans-ordonnance/group-wall/]https://toolbarqueries.google.fr/url?q=https://www.ufrgs.br/comacesso/forum/topic/cual-es-el-costo-de-azitromicina-zitromax-en-linea/#postid-172659[/url] pharmacie etampes , pharmacie bordeaux pellegrin .

  19. pharmacie grottes beaulieu pharmacie plateau saint jean beauvais pharmacie bourges rue louis mallet [url=https://www.youtube.com/redirect?q=https://es.ulule.com/precio-levitra/]https://www.youtube.com/redirect?q=https://i-meet.com/groups/acheter-generique-florinef-suisse-fludrocortisone-livraison-suisse/group-wall/[/url] pharmacie bordeaux rocade .
    pharmacie damiens noyon [url=https://maps.google.es/url?q=https://nortedesantander.gov.co/en-us/Attention-to-the-Citizen/Forum/g/posts/t/154901/Florinef–prix-sans-ordonnance-Vente-Fludrocortisone–sans-ordonnance]https://maps.google.fr/url?q=https://www.ufrgs.br/comacesso/forum/topic/prix-avodart-dutasteride-en-belgique/#postid-184261[/url] pharmacie avignon place pie .
    pharmacie argenteuil test covid [url=https://maps.google.es/url?q=https://nortedesantander.gov.co/en-us/Attention-to-the-Citizen/Forum/g/posts/t/154444/Prix-Restomed-sans-ordonnance-Temazepam–achat-en-ligne-Suisse]https://maps.google.fr/url?q=https://i-meet.com/groups/acheter-generique-priligy-suisse-acheter-dapoxetine-suisse/group-wall/[/url] pharmacie en ligne treated .
    therapie de couple neuchГўtel [url=https://toolbarqueries.google.es/url?q=https://roundme.com/@omnicefvente/about]https://toolbarqueries.google.fr/url?q=https://www.ufrgs.br/comacesso/forum/topic/cefixime-suprax-livraison-suisse-2/#postid-184010[/url] pharmacie en ligne quissac .
    pharmacie ouverte actuellement [url=https://www.youtube.com/redirect?q=https://www.kiva.org/team/fucidin_fusidic_gnrique_en_vente]https://toolbarqueries.google.fr/url?q=https://www.bark.com/fr/fr/company/levamisole-dicaris-livraison-france/l7DAD/[/url] act therapy app , pharmacie fremur angers .

  20. pharmacie monteux becker medicaments xls medical therapies comportementales et cognitives application [url=https://www.youtube.com/redirect?q=https://roundme.com/@zopiclonemedi/about]https://maps.google.fr/url?q=https://www.ufrgs.br/comacesso/forum/topic/ou-acheter-du-prednisolone-prednisolone-2/#postid-213638[/url] pharmacie de garde istres .
    pharmacie lafayette orthez [url=https://toolbarqueries.google.es/url?q=https://fr.ulule.com/bas-prix-lunesta/]https://maps.google.fr/url?q=https://fr.ulule.com/bon-marche-luvox/[/url] therapies used to treat a child with mental health problems .
    pharmacie de la gare [url=https://www.youtube.com/redirect?q=https://www.ufrgs.br/comacesso/forum/topic/sertraline-zoloft-prix-sans-ordonnance-2/#postid-213346]https://toolbarqueries.google.fr/url?q=https://roundme.com/@cetirizinesite/about[/url] medicaments xenical .
    pharmacie guetta argenteuil horaires [url=https://toolbarqueries.google.es/url?q=https://www.ufrgs.br/comacesso/forum/topic/prix-enalapril-dilvas-sans-ordonnance/#postid-185451]https://www.youtube.com/redirect?q=https://roundme.com/@vardenafilbasprix/about[/url] pharmacie bordeaux ornano .
    pharmacie coubertin boulogne-billancourt [url=https://toolbarqueries.google.es/url?q=https://www.ufrgs.br/comacesso/forum/topic/fosamax-alendronate-sans-ordonnance-belgique/#postid-210596]https://www.youtube.com/redirect?q=https://publiclab.org/notes/print/35336[/url] pharmacie lorette angers fax , traitement wakil .

  21. where to get generic aripiprazole without dr prescription [url=https://aripiprazolelife.online/]order generic aripiprazole pills[/url] where can i get aripiprazole tablets

  22. pharmacie de garde marseille aujourd’hui 13015 pharmacie leclerc oudairies roche yon pharmacie garde beaulieu sur mer [url=https://toolbarqueries.google.es/url?q=https://fr.ulule.com/vente-libre-eu-aciclovir/]https://toolbarqueries.google.fr/url?q=https://naturalvis.com/boards/topic/355438/mucopain-se-vende-sin-receta-en-ecuador-bemzocaine-se-vende-sin-receta[/url] zyrtec pharmacie en ligne .
    pharmacie auchan ponthierry [url=https://toolbarqueries.google.es/url?q=https://es.ulule.com/que-cura-diazepam/]https://toolbarqueries.google.fr/url?q=https://publiclab.org/notes/print/35932[/url] pharmacie brest .
    traitement tuberculose [url=https://www.youtube.com/redirect?q=https://publiclab.org/notes/print/35488]https://toolbarqueries.google.fr/url?q=https://publiclab.org/notes/print/35960[/url] therapie de couple islam .
    pharmacie de garde meaux [url=https://maps.google.es/url?q=https://www.kalaamad.com/boards/topic/133873/frusemide-en-pharmacie-suisse-furosemide-sans-ordonnance-suisse]https://www.youtube.com/redirect?q=https://www.bark.com/fr/fr/company/ivermectin-stromectol-sans-ordonnance-prix/YRRMp/[/url] pharmacie a proximite france .
    pharmacie grand annecy [url=https://maps.google.es/url?q=https://es.ulule.com/droga-armodafinil/]https://www.youtube.com/redirect?q=https://nocompromise.house/boards/topic/948511/valium-livraison-canada-diazepam-en-pharmacie-canada[/url] therapies used in psychiatry , pharmacie bailly paris click and collect .

  23. By contrast, 80 90 of primary episodes of malaria did not occur until after return to Australia, simply because the 14 day post exposure primaquine course was either ineffective in eradicating residual liver stages of Plasmodium vivax or had not been taken as prescribed when should i take viagra

LEAVE A REPLY

Please enter your comment!
Please enter your name here

− 4 = 1