|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, July 16, 2012 2:33 AM
Points: 2,
Visits: 35
|
|
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?
Thanks
Billy Knight
|
|
|
|
|
SSCommitted
      
Group: Moderators
Last Login: 2 days ago @ 11:00 AM
Points: 1,763,
Visits: 3,187
|
|
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.
Steve.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, July 16, 2012 2:33 AM
Points: 2,
Visits: 35
|
|
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?
|
|
|
|
|
SSCommitted
      
Group: Moderators
Last Login: 2 days ago @ 11:00 AM
Points: 1,763,
Visits: 3,187
|
|
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 here.
Steve.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: 2 days ago @ 6:48 AM
Points: 1,065,
Visits: 1,328
|
|
Sample to get you started:
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 If End Function
Then to use this on a table, add this to the expression on BackgroundColor: =Code.AlternateColor("White", "Whitesmoke", TRUE)
_____________________________________________________________________________________ gsc_dba
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, July 16, 2010 2:00 AM
Points: 44,
Visits: 65
|
|
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 -> PROPERTIES -> CODE (u can write your code here)...
in REFERENCE TAB - > add dlls / references...
Regards, Gayathri
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, November 18, 2011 5:04 AM
Points: 26,
Visits: 39
|
|
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;" & _ "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" & _ " Where Proj_Id=@Proj_Id" & _ " and Comp_Id=@Comp_Id" & _ " and Sbu_Id=@Sbu_Id " & _ " and Contract_Type=@Contract_Type " & _ " 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<>Nothing) Return nRetVal else Return "0-0" End If End Function
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 3:09 AM
Points: 12,
Visits: 168
|
|
|
|
|