Declare @XML XML
set @XML = ( Select * from pubs..authors Authors FOR XML AUTO , ELEMENTS )
Select @XML
|
- You cannot reference a value in a row other than the current row (as opposed to Excel for example).
- You cannot reference a value in another list or library.- You cannot reference lookup fields in a formula (see earlier blog)- You cannot reference the ID of a row for a newly inserted row. The ID does not yet exist when the calculation is performed.
parameters =Replace(Parameters!queryParam.Value,"@snapshot_type=null","@snapshot_type=2")
The colorPalette variable stores the definition of our custom color palette, which has 15 distinct colors. The count variable keeps track of the total count of distinct grouping values in order to wrap around once we exceed the number of distinct colors in the custom color palette. The mapping hash table keeps track of the mapping between grouping values and colors. This ensures that all data points within the same data series have the same color. Later it is used to synchronize the custom legend colors with the chart colors. The following code goes into the custom code window of the report.1.1 Define the chart series groups and category groups. (ie create the pie chart)1.2 Define the custom color palette and add custom code.
Private colorPalette As String() = {"Silver", "IndianRed", "RosyBrown", "Peru", "Goldenrod", "DarkKhaki", "Yellow", "YellowGreen", "PaleTurquoise", "Teal", "SkyBlue", "MediumPurple", "Plum", "HotPink"}
Private count As Integer = 0
Private mapping As New System.Collections.Hashtable()Public Function GetColor(ByVal groupingValue As String) As String
If mapping.ContainsKey(groupingValue) Then
Return mapping(groupingValue)
End If
Dim c As String = colorPalette(count Mod colorPalette.Length)
count = count + 1
mapping.Add(groupingValue, c)
Return c
End Function
=Code.GetColor(Fields!Security_Country_Name.Value)
function GetCountryColour(Security_Country_Name)
dim CountryColour as string
select case Security_Country_Name
case "Albania"
CountryColour = "LightGreen"
case "Algeria"
CountryColour = "yellow"
case "Angola"
CountryColour = "OrangeRed"
case "Argentina"
CountryColour = "CornflowerBlue"
case "Australia"
CountryColour = "Silver"
case "Austria"
CountryColour = "Red"
case "Azerbajan"
CountryColour = "Blue"
case "Bahamas"
CountryColour = "Green"
case "EMU"
CountryColour = "Purple"
case "United Kingdom"
CountryColour = "Orange"
case else
CountryColour = ""
end select
GetCountryColour= CountryColour
end function
=Code.GetCountryColour(Fields!Security_Country_Name.Value)
=iif(Fields!Day_Before_Yesterday_Price.Value is nothing, "", Format(CDbl(Fields!Day_Before_Yesterday_Price.Value), "#,##0.0000"))
Eg = "Market Value (" + ReportItems!textboxHiddenSystemCcy.Value + ")"
IIF(cbool(Fields!Canceled.Value), ChrW(&H2611), ChrW(&H2610))