Skip to content

Instantly share code, notes, and snippets.

View aduguid's full-sized avatar
🏠
online

Anthony aduguid

🏠
online
View GitHub Profile
@aduguid
aduguid / SSRS.CandyStripe.md
Last active October 30, 2017 01:58
SSRS.CandyStripe
Private Alt As Boolean

Public Function CandyStripe( _
Optional ByVal NewRow As Boolean = False _
, Optional ByVal OddColor as String = "Beige" _
, Optional ByVal EvenColor as String = "White") As String
'------------------------------------------------------------------------------------------------
' Purpose:  To candy stripe the detail rows of a report
' Example: BackgroundColor = Code.CandyStripe()
@aduguid
aduguid / SSRS.DateFormat.md
Last active October 30, 2017 01:58
SSRS.DateFormat
Public Function DateFormat()As String
'------------------------------------------------------------------------------------------------
' Purpose:  To standardize the date format in a report
' Example:  Format = Code.DateFormat()
'------------------------------------------------------------------------------------------------
	Return "dd-MMM-yyyy  hh:mm"

End Function
@aduguid
aduguid / SSRS.heatmap_example.md
Last active October 30, 2017 01:57
ssrs.heatmap_example
Public Function HeatMapColorGradate( _
  ByVal Value As Double _
, ByVal MaxPositive As Double _
, ByVal Neutral As Double _
, ByVal ColStr As String) As String
'------------------------------------------------------------------------------------------------
' Purpose:  To use a color gradations on a heatmap report
' Example:  BackgroundColor =Code.HeatMapColorGradate(25, 100, -10, Variables!ColorEventCountGradate.Value)
'           BackgroundColor =Code.HeatMapColorGradate(dayValue, maxValue, 0, "#2322EE")
@aduguid
aduguid / GITHUB.HtmlTags
Last active September 19, 2017 01:08
GITHUB.HtmlTags
<a>
<b>
<blockquote>
<br>
<code>
<dd>
<del>
<details>
<div>
<dl>
Public Sub SetCustomProperties( _
  propertyName As String _
, propertyValue As Variant _
, Optional propertyType As Office.MsoDocProperties = msoPropertyTypeString _
, Optional linkToContent As Boolean = False _
, Optional linkSource As Variant)
'--------------------------------------------------------------------------------------------------------------------
' Purpose:   Global error message for all procedures
' Example:   Call SetCustomProperties("ReleaseDate", "04-Oct-2017 4:25pm", msoPropertyTypeDate, False)
  Public Function IsMember( _
  domainName As String _
, groupName As String _
, memberName As String) As Boolean
On Error GoTo ErrTrap
Dim grp As Object
Dim pathName As String

 pathName = "WinNT://" &amp; domainName &amp; "/"
Public Sub PrintEnvironmentVariables()
On Error Resume Next
Dim strVar  As String
Dim i       As Long

    For i = 1 To 255
        strVar = Environ$(i)
        If LenB(strVar) = 0& Then Exit For
 Debug.Print strVar
Public Sub DisplayMessage( _
ByVal procedure As String, _
ByVal module As String, _
errNbr As Double, _
errDes As String, _
Optional ByVal errLine As Variant = 0, _
Optional ByVal title As String = "Unexpected Error")
'--------------------------------------------------------------------------------------------------------------------
' Purpose:  Global error message for all procedures
' Put this code into FileName.rss and then
'   execute with: rs -i FileName.rss -s ServerName/ReportServer
' Originally from http://social.msdn.microsoft.com/Forums/en/sqlreportingservices/thread/a2a9ebe1-0417-46bf-8589-ae4e4a16181c   in a post by Igor Gelin
' Additional fields from http://msdn.microsoft.com/en-us/library/reportservice2005.datasourcedefinition.aspx added.
'  This appears to ONLY work for Shared data sources, not Custom data source or embedded data source (i.e. per-report data sources)
Public Sub Main()
  Dim items As CatalogItem() = Nothing
  Dim dataSource As DataSourceDefinition
  Dim count as Integer = 0
@aduguid
aduguid / VisualStudio.CommandWindow.DiffFiles.md
Last active December 19, 2017 04:46
Visual Studio - Command Window - Diff Files
>Tools.DiffFiles "C:\Temp\old.sql" "C:\Temp\new.sql"