﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / Business Intelligence  / Writing custom code for reporting services / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 01:56:00 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Writing custom code for reporting services</title><link>http://www.sqlservercentral.com/Forums/Topic942384-147-1.aspx</link><description>HiThere's a tutorial on [url=http://www.wiseowl.co.uk/blog/s288/embedded-code-ssrs.htm]embedding code here[/url] (with a couple of full examples).  I'm hoping to get round to writing one on custom assemblies next, to complete the picture!</description><pubDate>Fri, 13 Jul 2012 09:00:27 GMT</pubDate><dc:creator>AndyOwl</dc:creator></item><item><title>RE: Writing custom code for reporting services</title><link>http://www.sqlservercentral.com/Forums/Topic942384-147-1.aspx</link><description>Hi All I wrote and Cutome code as below , that works well in development environment, During Preview it gives me perfect Output,but after  the deployement it gives me error. What must be fix to this. Please attached files where i added  customcode and reference to System.data.dll Function IsBudgetRevised(ByVal Proj_Id As Integer, ByVal Comp_Id As Integer, ByVal Sbu_Id As Integer, ByVal Contract_Type As Integer, ByVal FinYear as  Integer) As String        Dim oConn As New System.Data.SqlClient.SqlConnection        oConn.ConnectionString = "Data Source=C-41396\C41396;" &amp; _           "Initial Catalog=Finance_Dashboard; Integrated Security=true"        oConn.Open()        Dim oCmd As New System.Data.SqlClient.SqlCommand        oCmd.Connection = oConn        oCmd.CommandText = "Select Convert(Varchar(50),UpdatedBudget)+'-'+Convert(Varchar(50),LatestForecast) from tbl_CalculateUpdatedBudLatestFor" &amp; _                           " Where Proj_Id=@Proj_Id" &amp; _                           "  and Comp_Id=@Comp_Id" &amp; _                           " and Sbu_Id=@Sbu_Id  " &amp; _                           " and Contract_Type=@Contract_Type  "    &amp; _                            " and FinYear=   @FinYear     "                    oCmd.Parameters.AddWithValue("@Proj_Id", Proj_Id)        oCmd.Parameters.AddWithValue("@Comp_Id", Comp_Id)        oCmd.Parameters.AddWithValue("@Sbu_Id", Sbu_Id)        oCmd.Parameters.AddWithValue("@Contract_Type", Contract_Type)      oCmd.Parameters.AddWithValue("@FinYear",FinYear)        Dim nRetVal As String = oCmd.ExecuteScalar()        oConn.Close()  If(nRetVal&amp;lt;&amp;gt;Nothing)        Return nRetValelse Return "0-0"End If    End Function</description><pubDate>Fri, 18 Nov 2011 05:14:47 GMT</pubDate><dc:creator>sushilb</dc:creator></item><item><title>RE: Writing custom code for reporting services</title><link>http://www.sqlservercentral.com/Forums/Topic942384-147-1.aspx</link><description>Hi,Custom code u can use VB Functions... c# is not allowed.. but u can create DLL (Dynamic Link library) using C# or VB.net language.. in REPORT -&amp;gt;  PROPERTIES -&amp;gt; CODE (u can write your code here)...in REFERENCE TAB - &amp;gt; add dlls / references...</description><pubDate>Tue, 13 Jul 2010 01:06:15 GMT</pubDate><dc:creator>gayathridevi.msit</dc:creator></item><item><title>RE: Writing custom code for reporting services</title><link>http://www.sqlservercentral.com/Forums/Topic942384-147-1.aspx</link><description>Sample to get you started:[code="plain"]Private bOddRow As Boolean'*************************************************************************' -- Display green-bar type color banding in detail rows' -- Call from BackGroundColor property of all detail row textboxes' -- Set Toggle True for first item, False for others.'*************************************************************************Function AlternateColor(ByVal OddColor As String, _         ByVal EvenColor As String, ByVal Toggle As Boolean) As String    If Toggle Then bOddRow = Not bOddRow    If bOddRow Then        Return OddColor    Else        Return EvenColor    End IfEnd Function[/code]Then to use this on a table, add this to the expression on BackgroundColor: [code="other"]=Code.AlternateColor("White", "Whitesmoke", TRUE)[/code]</description><pubDate>Tue, 29 Jun 2010 09:46:31 GMT</pubDate><dc:creator>gsc_dba</dc:creator></item><item><title>RE: Writing custom code for reporting services</title><link>http://www.sqlservercentral.com/Forums/Topic942384-147-1.aspx</link><description>Ok, sounds like you're interested just in adding custom code to your reports.  I believe it's VB 2008, not VBA.  MSDN has a section using code [u][b][url=http://msdn.microsoft.com/en-us/library/ms155798.aspx]here[/url][/b][/u].</description><pubDate>Thu, 24 Jun 2010 11:52:17 GMT</pubDate><dc:creator>stevefromOZ</dc:creator></item><item><title>RE: Writing custom code for reporting services</title><link>http://www.sqlservercentral.com/Forums/Topic942384-147-1.aspx</link><description>Hi Steve,Thanks for responding. I have been creating reports in reporting services for a while now, and we have just upgraded to SSRS 2008. I am trying to beef up on a few areas in reporting servces where I have not needed to go before. I am now in charge of developing new reports for our clients to be used alongside the existing software we develop and provide for them. I am just interested in the particular language and syntax to use for writing code in reporting services. I take it you can put as many functions in there as you like? Can I use VBA??? Is it Microsoft Visual Basic 2008 like I use in SSIS script tasks?</description><pubDate>Thu, 24 Jun 2010 08:57:00 GMT</pubDate><dc:creator>billy.knight</dc:creator></item><item><title>RE: Writing custom code for reporting services</title><link>http://www.sqlservercentral.com/Forums/Topic942384-147-1.aspx</link><description>Billy,If you can expand a little on *why* you want to write code for this project, it might help us point you towards where to look as there are several areas in which you could write code.</description><pubDate>Thu, 24 Jun 2010 08:48:20 GMT</pubDate><dc:creator>stevefromOZ</dc:creator></item><item><title>Writing custom code for reporting services</title><link>http://www.sqlservercentral.com/Forums/Topic942384-147-1.aspx</link><description>I am interested in writing code for my new reporting services projects which I have just gotten involved with at work. Can anyone tell what language and syntax is required? Also are there any function reference libraries available for me to look at to see what I can use?ThanksBilly Knight</description><pubDate>Thu, 24 Jun 2010 06:06:16 GMT</pubDate><dc:creator>billy.knight</dc:creator></item></channel></rss>