Res.ComTrade.Citrix.XenDesktop.Reports.ApplicationAvailability.DowntimeEvents (ReportResource)

Element properties:

TypeReportResource
File NameComTrade.Citrix.XenDesktop.Reports.ApplicationAvailability.DowntimeEvents.rdl
AccessibilityPublic

File Content: ComTrade.Citrix.XenDesktop.Reports.ApplicationAvailability.DowntimeEvents.rdl

<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<Body><Script>
<ReportItems>
<Image Name="banner_image">
<Source>External</Source>
<Value>ComTrade.Citrix.XenDesktop.Reports.banner.png</Value>
<Top>0.15in</Top>
<Left>0.15in</Left>
<Height>0.53958in</Height>
<Width>8.05in</Width>
<Style /></Style>
</Image>
<Rectangle Name="rectangle2">
<ReportItems>
<Textbox Name="textbox29">
<CanGrow>true</CanGrow>
<CanShrink>true</CanShrink>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Code.GetLocTable("LT_Report").GetString("R.ReportDuration", "[Report Duration]")</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style /></Style>
</Paragraph>
</Paragraphs>
<Top>0.25in</Top>
<Left>0.2in</Left>
<Height>0.2in</Height>
<Width>1.65in</Width>
<DataElementOutput>NoOutput</DataElementOutput>
<Style></Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="textbox26">
<CanGrow>true</CanGrow>
<CanShrink>true</CanShrink>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Code.GetLocTable("LT_Report").GetString("R.ReportTime", "[Report Time]")</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style /></Style>
</Paragraph>
</Paragraphs>
<Top>0.05in</Top>
<Left>0.2in</Left>
<Height>0.2in</Height>
<Width>1.65in</Width>
<ZIndex>1</ZIndex>
<DataElementOutput>NoOutput</DataElementOutput>
<Style></Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="textbox25">
<CanGrow>true</CanGrow>
<CanShrink>true</CanShrink>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>:</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style /></Style>
</Paragraph>
</Paragraphs>
<Top>0.05in</Top>
<Left>1.85in</Left>
<Height>0.2in</Height>
<Width>0.1in</Width>
<ZIndex>2</ZIndex>
<DataElementOutput>NoOutput</DataElementOutput>
<Style></Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="ReportGeneratedTime">
<CanGrow>true</CanGrow>
<CanShrink>true</CanShrink>
<DataElementStyle>Element</DataElementStyle>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Code.FormatDateTime("g", Code.ToReportDate(DateTime.UtcNow))</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style /></Style>
</Paragraph>
</Paragraphs>
<Top>0.05in</Top>
<Left>1.95in</Left>
<Height>0.2in</Height>
<Width>6.05in</Width>
<ZIndex>3</ZIndex>
<DataElementName>Created</DataElementName>
<DataElementOutput>Output</DataElementOutput>
<Style></Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Image Name="parameterBottomImage">
<Source>External</Source>
<Value>../gradient_portrait.gif</Value>
<Top>0.9in</Top>
<Height>0.05in</Height>
<Width>8.05in</Width>
<ZIndex>4</ZIndex>
<Style /></Style>
</Image>
<Textbox Name="textbox23">
<CanGrow>true</CanGrow>
<CanShrink>true</CanShrink>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>:</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style /></Style>
</Paragraph>
</Paragraphs>
<Top>0.25in</Top>
<Left>1.85in</Left>
<Height>0.2in</Height>
<Width>0.1in</Width>
<ZIndex>5</ZIndex>
<DataElementOutput>NoOutput</DataElementOutput>
<Style></Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="textbox21">
<CanGrow>true</CanGrow>
<CanShrink>true</CanShrink>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Code.FormatString(Code.GetLocTable("LT_Table").GetString("RT.StartEndTimeFormat", "[From {0} to {1}]"), Code.FormatDateTime(IIf(Code.IsBusinessHours(Code.GetReportTimeFilter()) Or (CInt(Parameters!DataAggregation.Value) &gt; 0), "d", "g"), Code.GetReportStartDate()), Code.FormatDateTime(IIf(Code.IsBusinessHours(Code.GetReportTimeFilter()) Or (CInt(Parameters!DataAggregation.Value) &gt; 0), "d", "g"), Code.GetReportEndDate()))</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style /></Style>
</Paragraph>
</Paragraphs>
<Top>0.25in</Top>
<Left>1.95in</Left>
<Height>0.2in</Height>
<Width>6.05in</Width>
<ZIndex>6</ZIndex>
<DataElementOutput>NoOutput</DataElementOutput>
<Style></Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="textbox27">
<CanGrow>true</CanGrow>
<CanShrink>true</CanShrink>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Code.FormatBusinessHours2("{2} {0} - {1}", Code.GetReportTimeFilter2())</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style /></Style>
</Paragraph>
</Paragraphs>
<Top>0.45in</Top>
<Left>1.95in</Left>
<Height>0.2in</Height>
<Width>6.05in</Width>
<ZIndex>7</ZIndex>
<Visibility>
<Hidden>=Not Code.Comtrade_IsBusinessHoursType()</Hidden>
</Visibility>
<DataElementOutput>NoOutput</DataElementOutput>
<Style></Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="textbox48">
<CanGrow>true</CanGrow>
<CanShrink>true</CanShrink>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=IIF(Parameters!DowntimeForApplication.Value = 1, Code.GetLocTable("LT_Table").GetString("RT.Legend.SelectedApplication", "[Selected Application]"), Code.GetLocTable("LT_Table").GetString("RT.Legend.DeliveryGroup", "[Delivery Group]"))</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style /></Style>
</Paragraph>
</Paragraphs>
<Top>0.65in</Top>
<Left>0.2in</Left>
<Height>0.2in</Height>
<Width>1.65in</Width>
<ZIndex>8</ZIndex>
<DataElementOutput>NoOutput</DataElementOutput>
<Style></Style>
<Border>
<Style></Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="textbox47">
<CanGrow>true</CanGrow>
<CanShrink>true</CanShrink>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>:</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style /></Style>
</Paragraph>
</Paragraphs>
<Top>0.65in</Top>
<Left>1.85in</Left>
<Height>0.2in</Height>
<Width>0.1in</Width>
<ZIndex>9</ZIndex>
<DataElementOutput>NoOutput</DataElementOutput>
<Style></Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="textbox46">
<CanGrow>true</CanGrow>
<CanShrink>true</CanShrink>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Code.FormatString("{0}", Parameters!ApplicationOrServerName.Value)</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style /></Style>
</Paragraph>
</Paragraphs>
<Top>0.65in</Top>
<Left>1.95in</Left>
<Height>0.2in</Height>
<Width>6.05in</Width>
<ZIndex>10</ZIndex>
<DataElementOutput>NoOutput</DataElementOutput>
<Style></Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<DataElementOutput>ContentsOnly</DataElementOutput>
<Top>1.44167in</Top>
<Left>0.15in</Left>
<Height>0.95in</Height>
<Width>8.05in</Width>
<ZIndex>1</ZIndex>
<Style /></Style>
</Rectangle>
<Rectangle Name="rectangle3">
<ReportItems>
<Textbox Name="reportDescription">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Code.GetReportDescription()</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style /></Style>
</Paragraph>
</Paragraphs>
<Left>0.2in</Left>
<Height>0.2in</Height>
<Width>7.8in</Width>
<DataElementOutput>NoOutput</DataElementOutput>
<Style></Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<DataElementOutput>ContentsOnly</DataElementOutput>
<Top>1.19167in</Top>
<Left>0.15in</Left>
<Height>0.2in</Height>
<Width>8.05in</Width>
<ZIndex>2</ZIndex>
<Visibility>
<Hidden>true</Hidden>
<ToggleItem>reportDescriptionTitle</ToggleItem>
</Visibility>
<Style></Style>
<BackgroundColor>Gainsboro</BackgroundColor>
</Style>
</Rectangle>
<Rectangle Name="rectangle4">
<ReportItems>
<Textbox Name="reportTitle">
<CanGrow>true</CanGrow>
<DataElementStyle>Element</DataElementStyle>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Code.GetReportName()</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>11pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style /></Style>
</Paragraph>
</Paragraphs>
<Top>0.05in</Top>
<Left>0.2in</Left>
<Height>0.25in</Height>
<Width>7.8in</Width>
<DataElementName>Title</DataElementName>
<DataElementOutput>Output</DataElementOutput>
<Style></Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="reportDescriptionTitle">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Code.GetLocTable("LT_Report").GetString("R.DescriptionTitle", "[Report Description Title]")</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
<Color>DimGray</Color>
</Style>
</TextRun>
</TextRuns>
<Style /></Style>
</Paragraph>
</Paragraphs>
<Top>0.3in</Top>
<Height>0.2in</Height>
<Width>8in</Width>
<ZIndex>1</ZIndex>
<DataElementOutput>NoOutput</DataElementOutput>
<Style></Style>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<DataElementOutput>ContentsOnly</DataElementOutput>
<Top>0.69167in</Top>
<Left>0.15in</Left>
<Height>0.5in</Height>
<Width>8.05in</Width>
<ZIndex>3</ZIndex>
<Style></Style>
<BackgroundColor>Gainsboro</BackgroundColor>
</Style>
</Rectangle>
<Tablix Name="tableDTE">
<TablixBody>
<TablixColumns>
<TablixColumn>
<Width>1.584in</Width>
</TablixColumn>
<TablixColumn>
<Width>1.584in</Width>
</TablixColumn>
<TablixColumn>
<Width>1.32in</Width>
</TablixColumn>
<TablixColumn>
<Width>2.112in</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
<TablixRow>
<Height>0.25in</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="textbox56">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Code.GetLocTable("LT_Table").GetString("RT.Table.DowntimeStart", "[Downtime Start]")</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style></Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<ZIndex>7</ZIndex>
<DataElementOutput>NoOutput</DataElementOutput>
<Style></Style>
<Border>
<Color>DimGray</Color>
<Style></Style>Solid</Style>
</Border>
<BackgroundColor>Gray</BackgroundColor>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="textbox57">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Code.GetLocTable("LT_Table").GetString("RT.Table.DowntimeEnd", "[Downtime End]")</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style></Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<ZIndex>6</ZIndex>
<DataElementOutput>NoOutput</DataElementOutput>
<Style></Style>
<Border>
<Color>DimGray</Color>
<Style></Style>Solid</Style>
</Border>
<BackgroundColor>Gray</BackgroundColor>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="textbox22">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Code.GetLocTable("LT_Table").GetString("RT.Table.DowntimeDuration", "[Downtime Duration (HH:MM:SS)]")</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style></Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>textbox22</rd:DefaultName>
<ZIndex>5</ZIndex>
<DataElementOutput>NoOutput</DataElementOutput>
<Style></Style>
<Border>
<Color>DimGray</Color>
<Style></Style>Solid</Style>
</Border>
<BackgroundColor>Gray</BackgroundColor>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="textbox58">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Code.GetLocTable("LT_Table").GetString("RT.Table.DowntimeType", "[Downtime Type]")</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style></Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<ZIndex>4</ZIndex>
<DataElementOutput>NoOutput</DataElementOutput>
<Style></Style>
<Border>
<Color>DimGray</Color>
<Style></Style>Solid</Style>
</Border>
<BackgroundColor>Gray</BackgroundColor>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
</TablixCells>
</TablixRow>
<TablixRow>
<Height>0.2in</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="textbox1">
<CanShrink>true</CanShrink>
<DataElementStyle>Element</DataElementStyle>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=IIF(IsNothing(Fields!StartDateTime.Value),"", Code.FormatAggregatedTimeValueLabel2(Fields!StartDateTime.Value, 0) )</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style></Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<ZIndex>3</ZIndex>
<DataElementName>StartTime</DataElementName>
<DataElementOutput>Output</DataElementOutput>
<Style></Style>
<Border>
<Color>DarkGray</Color>
<Style></Style>Solid</Style>
<Width>0.5pt</Width>
</Border>
<BackgroundColor>=IIF(Parameters!DowntimeForApplication.Value = 1,(

IIF(Fields!HealthState.Value=0,"White",
IIF(Fields!HealthState.Value=1,"DarkSeaGreen",
IIF(Fields!HealthState.Value=2,"PaleGoldenrod",
IIF(Fields!HealthState.Value=3,"Salmon",
IIF(Fields!HealthState.Value=50,"Silver",
IIF(Fields!HealthState.Value=100,"Gray",
IIF(Fields!HealthState.Value=101,"SkyBlue","Transparent")))))))),


(IIF(Fields!HealthState.Value=0,"White",
IIF(Fields!HealthState.Value=1,"DarkSeaGreen",
IIF(Fields!HealthState.Value=2,"PaleGoldenrod",
IIF(Fields!HealthState.Value=3,"Salmon",
IIF(Fields!HealthState.Value=50,"Silver",
IIF(Fields!HealthState.Value=100,"Gray",
IIF(Fields!HealthState.Value=101,"SkyBlue","Transparent"))))))))
)</BackgroundColor>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="textbox2">
<CanShrink>true</CanShrink>
<DataElementStyle>Element</DataElementStyle>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=IIF(IsNothing(Fields!EndDateTime.Value),"", Code.FormatAggregatedTimeValueLabel2(Fields!EndDateTime.Value, 0) )</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style></Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<ZIndex>2</ZIndex>
<DataElementName>EndTime</DataElementName>
<DataElementOutput>Output</DataElementOutput>
<Style></Style>
<Border>
<Color>DarkGray</Color>
<Style></Style>Solid</Style>
<Width>0.5pt</Width>
</Border>
<BackgroundColor>=IIF(Parameters!DowntimeForApplication.Value = 1,(

IIF(Fields!HealthState.Value=0,"White",
IIF(Fields!HealthState.Value=1,"DarkSeaGreen",
IIF(Fields!HealthState.Value=2,"PaleGoldenrod",
IIF(Fields!HealthState.Value=3,"Salmon",
IIF(Fields!HealthState.Value=50,"Silver",
IIF(Fields!HealthState.Value=100,"Gray",
IIF(Fields!HealthState.Value=101,"SkyBlue","Transparent")))))))),


(IIF(Fields!HealthState.Value=0,"White",
IIF(Fields!HealthState.Value=1,"DarkSeaGreen",
IIF(Fields!HealthState.Value=2,"PaleGoldenrod",
IIF(Fields!HealthState.Value=3,"Salmon",
IIF(Fields!HealthState.Value=50,"Silver",
IIF(Fields!HealthState.Value=100,"Gray",
IIF(Fields!HealthState.Value=101,"SkyBlue","Transparent"))))))))
)</BackgroundColor>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="textbox3">
<CanGrow>true</CanGrow>
<DataElementStyle>Element</DataElementStyle>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Code.FormatTimeInterval(DateDiff("s", Fields!StartDateTime.Value, Code.GetIntervalEndValue(Fields!EndDateTime.Value)))</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style></Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<ZIndex>1</ZIndex>
<DataElementName>Duration</DataElementName>
<DataElementOutput>Output</DataElementOutput>
<Style></Style>
<Border>
<Color>DarkGray</Color>
<Style></Style>Solid</Style>
<Width>0.5pt</Width>
</Border>
<BackgroundColor>=IIF(Parameters!DowntimeForApplication.Value = 1,(

IIF(Fields!HealthState.Value=0,"White",
IIF(Fields!HealthState.Value=1,"DarkSeaGreen",
IIF(Fields!HealthState.Value=2,"PaleGoldenrod",
IIF(Fields!HealthState.Value=3,"Salmon",
IIF(Fields!HealthState.Value=50,"Silver",
IIF(Fields!HealthState.Value=100,"Gray",
IIF(Fields!HealthState.Value=101,"SkyBlue","Transparent")))))))),


(IIF(Fields!HealthState.Value=0,"White",
IIF(Fields!HealthState.Value=1,"DarkSeaGreen",
IIF(Fields!HealthState.Value=2,"PaleGoldenrod",
IIF(Fields!HealthState.Value=3,"Salmon",
IIF(Fields!HealthState.Value=50,"Silver",
IIF(Fields!HealthState.Value=100,"Gray",
IIF(Fields!HealthState.Value=101,"SkyBlue","Transparent"))))))))
)</BackgroundColor>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="textbox49">
<CanShrink>true</CanShrink>
<DataElementStyle>Element</DataElementStyle>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=IIF(Parameters!DowntimeForApplication.Value = 1, Code.StateIntervalNameApp(Fields!HealthStateValue.Value), Code.StateIntervalNameServer(Fields!HealthStateValue.Value))</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style></Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<DataElementName>Type</DataElementName>
<DataElementOutput>Output</DataElementOutput>
<Style></Style>
<Border>
<Color>DarkGray</Color>
<Style></Style>Solid</Style>
<Width>0.5pt</Width>
</Border>
<BackgroundColor>=IIF(Parameters!DowntimeForApplication.Value = 1,(

IIF(Fields!HealthState.Value=0,"White",
IIF(Fields!HealthState.Value=1,"DarkSeaGreen",
IIF(Fields!HealthState.Value=2,"PaleGoldenrod",
IIF(Fields!HealthState.Value=3,"Salmon",
IIF(Fields!HealthState.Value=50,"Silver",
IIF(Fields!HealthState.Value=100,"Gray",
IIF(Fields!HealthState.Value=101,"SkyBlue","Transparent")))))))),


(IIF(Fields!HealthState.Value=0,"White",
IIF(Fields!HealthState.Value=1,"DarkSeaGreen",
IIF(Fields!HealthState.Value=2,"PaleGoldenrod",
IIF(Fields!HealthState.Value=3,"Salmon",
IIF(Fields!HealthState.Value=50,"Silver",
IIF(Fields!HealthState.Value=100,"Gray",
IIF(Fields!HealthState.Value=101,"SkyBlue","Transparent"))))))))
)</BackgroundColor>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<rd:Selected>true</rd:Selected>
</CellContents>
</TablixCell>
</TablixCells>
</TablixRow>
</TablixRows>
</TablixBody>
<TablixColumnHierarchy>
<TablixMembers>
<TablixMember />
<TablixMember />
<TablixMember />
<TablixMember />
</TablixMembers>
</TablixColumnHierarchy>
<TablixRowHierarchy>
<TablixMembers>
<TablixMember>
<KeepWithGroup>After</KeepWithGroup>
<RepeatOnNewPage>true</RepeatOnNewPage>
<KeepTogether>true</KeepTogether>
</TablixMember>
<TablixMember>
<Group Name="tableDTE_Details_Group">
<DataElementName>Downtime</DataElementName>
</Group>
<SortExpressions>
<SortExpression>
<Value>=Fields!StartDateTime.Value</Value>
</SortExpression>
<SortExpression>
<Value>=Fields!EndDateTime.Value</Value>
</SortExpression>
</SortExpressions>
<TablixMembers>
<TablixMember />
</TablixMembers>
<DataElementName>DowntimePeriods</DataElementName>
<DataElementOutput>Output</DataElementOutput>
<KeepTogether>true</KeepTogether>
</TablixMember>
</TablixMembers>
</TablixRowHierarchy>
<KeepTogether>true</KeepTogether>
<DataSetName>DownTimeEvents</DataSetName>
<Top>2.9in</Top>
<Left>0.15in</Left>
<Height>0.45in</Height>
<Width>6.6in</Width>
<ZIndex>4</ZIndex>
<DataElementName>DowntimeSummaryTable</DataElementName>
<DataElementOutput>Output</DataElementOutput>
<Style /></Style>
</Tablix>
<Textbox Name="textbox4">
<CanGrow>true</CanGrow>
<CanShrink>true</CanShrink>
<DataElementStyle>Element</DataElementStyle>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Code.FormatString(Code.GetLocTable("LT_Table").GetString("RT.Legend.DownTime.Periods", "[Downtime periods for {0}]"), Parameters!ApplicationOrServerName.Value)</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>9pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style /></Style>
</Paragraph>
</Paragraphs>
<Top>2.6in</Top>
<Left>0.15in</Left>
<Height>0.25in</Height>
<Width>6.6in</Width>
<ZIndex>5</ZIndex>
<DataElementName>Max</DataElementName>
<DataElementOutput>Output</DataElementOutput>
<Style></Style>
<BottomBorder>
<Style></Style>Solid</Style>
</BottomBorder>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<Height>3.35in</Height>
<Style /></Style>
</Script></Body>
<Width>8.4in</Width>
<Page>
<PageFooter>
<Height>0.35in</Height>
<PrintOnFirstPage>true</PrintOnFirstPage>
<PrintOnLastPage>true</PrintOnLastPage>
<ReportItems>
<Textbox Name="textbox37">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Code.FormatString(Code.GetLocTable("LT_Report").GetString("R.TimeZoneFormat", "[All dates and times are shown in {0}]"), Parameters!TimeZoneName.Value)</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
<Color>DimGray</Color>
</Style>
</TextRun>
</TextRuns>
<Style /></Style>
</Paragraph>
</Paragraphs>
<Top>0.1in</Top>
<Left>0.15in</Left>
<Height>0.1875in</Height>
<Width>6.15in</Width>
<Style></Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="textbox19">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Code.FormatString(Code.GetLocTable("LT_Report").GetString("R.PageFormat", "[Page {0} of {1}]"), Globals!PageNumber, Globals!TotalPages)</Value>
<Style></Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>8pt</FontSize>
<Color>DimGray</Color>
</Style>
</TextRun>
</TextRuns>
<Style></Style>
<TextAlign>Right</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<Top>0.1in</Top>
<Left>6.45in</Left>
<Height>0.1875in</Height>
<Width>1.7in</Width>
<ZIndex>1</ZIndex>
<Style></Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<Style /></Style>
</PageFooter>
<Style /></Style>
</Page>
<Author>Citrix Systems, Inc.</Author>
<AutoRefresh>0</AutoRefresh>
<DataSources>
<DataSource Name="DataWarehouseMain">
<DataSourceReference>Data Warehouse Main</DataSourceReference>
<rd:SecurityType>None</rd:SecurityType>
<rd:DataSourceID>e4235c51-407f-4065-8519-a1e57374bc45</rd:DataSourceID>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name="DownTimeEvents">
<Query>
<DataSourceName>DataWarehouseMain</DataSourceName>
<QueryParameters>
<QueryParameter Name="@StartDate_BaseValue">
<Value>=Code.GetReportStartDate2DB()</Value>
</QueryParameter>
<QueryParameter Name="@EndDate_BaseValue">
<Value>=Code.GetReportEndDate2DB()</Value>
</QueryParameter>
<QueryParameter Name="@BusinessTimeType">
<Value>=Code.Comtrade_isBusinessTimeType()</Value>
</QueryParameter>
<QueryParameter Name="@BusinessDay1">
<Value>=Code.Comtrade_isBusinessDay(1)</Value>
</QueryParameter>
<QueryParameter Name="@BusinessDay2">
<Value>=Code.Comtrade_isBusinessDay(2)</Value>
</QueryParameter>
<QueryParameter Name="@BusinessDay3">
<Value>=Code.Comtrade_isBusinessDay(3)</Value>
</QueryParameter>
<QueryParameter Name="@BusinessDay4">
<Value>=Code.Comtrade_isBusinessDay(4)</Value>
</QueryParameter>
<QueryParameter Name="@BusinessDay5">
<Value>=Code.Comtrade_isBusinessDay(5)</Value>
</QueryParameter>
<QueryParameter Name="@BusinessDay6">
<Value>=Code.Comtrade_isBusinessDay(6)</Value>
</QueryParameter>
<QueryParameter Name="@BusinessDay7">
<Value>=Code.Comtrade_isBusinessDay(7)</Value>
</QueryParameter>
<QueryParameter Name="@StartDate_BaseValueGMT">
<Value>=Code.ToDbDate(Code.GetReportStartDate2DB())</Value>
</QueryParameter>
<QueryParameter Name="@ManagedEntityMonitorRowId">
<Value>=Parameters!MEMonitorRowID.Value</Value>
</QueryParameter>
</QueryParameters>
<CommandType>StoredProcedure</CommandType>
<CommandText>ComtradeMPXAXD_ApplicationAvailability_DownTimeEvents_DataGet</CommandText>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
</Query>
<Fields>
<Field Name="ManagedEntityMonitorRowId">
<DataField>ManagedEntityMonitorRowId</DataField>
</Field>
<Field Name="StartDateTime">
<DataField>StartDateTime</DataField>
</Field>
<Field Name="EndDateTime">
<DataField>EndDateTime</DataField>
</Field>
<Field Name="HealthState">
<DataField>HealthState</DataField>
</Field>
<Field Name="HealthStateValue">
<Value>
=IIF(Fields!HealthState.Value=0, CInt(Code.StateIntervalType.Gray),
IIF(Fields!HealthState.Value=1, CInt(Code.StateIntervalType.Green),
IIF(Fields!HealthState.Value=2, CInt(Code.StateIntervalType.Yellow),
IIF(Fields!HealthState.Value=3, CInt(Code.StateIntervalType.Red),
IIF(Fields!HealthState.Value=50, CInt(Code.StateIntervalType.ServiceGray),
IIF(Fields!HealthState.Value=100, CInt(Code.StateIntervalType.Black),
IIF(Fields!HealthState.Value=101, CInt(Code.StateIntervalType.Blue), CInt(Code.StateIntervalType.White))))))))
</Value>
</Field>
</Fields>
<Filters>
<Filter>
<FilterExpression>
=IIF(Parameters!DowntimeForApplication.Value = 1,
Code.IsDownTimeApp(Fields!HealthStateValue.Value),
Code.IsDownTime(Fields!HealthStateValue.Value))
</FilterExpression>
<Operator>Equal</Operator>
<FilterValues>
<FilterValue>=True</FilterValue>
</FilterValues>
</Filter>
</Filters>
</DataSet>
<DataSet Name="LT_Report_Query">
<Fields>
<Field Name="ValueXml">
<DataField>XML_F52E2B61-18A1-11d1-B105-00805F49916B</DataField>
</Field>
<Field Name="ValueName">
<Value>="LT"</Value>
</Field>
</Fields>
<Query>
<DataSourceName>DataWarehouseMain</DataSourceName>
<CommandType>StoredProcedure</CommandType>
<CommandText>ReportDisplayStringGet</CommandText>
<QueryParameters>
<QueryParameter Name="@ManagementGroupGuid">
<Value>=Code.GetCallingManagementGroupId()</Value>
</QueryParameter>
<QueryParameter Name="@ManagementPackSystemName">
<Value>Comtrade.Citrix.XenApp.And.XenDesktop.Reports</Value>
</QueryParameter>
<QueryParameter Name="@ReportSystemName">
<Value>ComTrade.Citrix.XenDesktop.Reports.ApplicationAvailability.DowntimeEvents</Value>
</QueryParameter>
<QueryParameter Name="@LanguageCode">
<Value>=Code.GetReportLocLanguageCode()</Value>
</QueryParameter>
<QueryParameter Name="@Scope">
<Value>R.%</Value>
</QueryParameter>
</QueryParameters>
</Query>
</DataSet>
<DataSet Name="LT_Table_Query">
<Fields>
<Field Name="ValueXml">
<DataField>XML_F52E2B61-18A1-11d1-B105-00805F49916B</DataField>
</Field>
<Field Name="ValueName">
<Value>="LT"</Value>
</Field>
</Fields>
<Query>
<DataSourceName>DataWarehouseMain</DataSourceName>
<CommandType>StoredProcedure</CommandType>
<CommandText>ReportDisplayStringGet</CommandText>
<QueryParameters>
<QueryParameter Name="@ManagementGroupGuid">
<Value>=Code.GetCallingManagementGroupId()</Value>
</QueryParameter>
<QueryParameter Name="@ManagementPackSystemName">
<Value>Comtrade.Citrix.XenApp.And.XenDesktop.Reports</Value>
</QueryParameter>
<QueryParameter Name="@ReportSystemName">
<Value>ComTrade.Citrix.XenDesktop.Reports.ApplicationAvailability.DowntimeEvents</Value>
</QueryParameter>
<QueryParameter Name="@LanguageCode">
<Value>=Code.GetReportLocLanguageCode()</Value>
</QueryParameter>
<QueryParameter Name="@Scope">
<Value>RT.%</Value>
</QueryParameter>
</QueryParameters>
</Query>
</DataSet>
</DataSets>
<ReportParameters>
<ReportParameter Name="DownTime">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>=CInt(Code.StateIntervalType.Black)</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>[Down Time]</Prompt>
<ValidValues>
<ParameterValues>
<ParameterValue>
<Value>=CInt(Code.StateIntervalType.ServiceGray)</Value>
<Label>Monitoring unavailable</Label>
</ParameterValue>
<ParameterValue>
<Value>=CInt(Code.StateIntervalType.Yellow)</Value>
<Label>Delivery Group In Citrix Maintenance</Label>
</ParameterValue>
<ParameterValue>
<Value>=CInt(Code.StateIntervalType.Blue)</Value>
<Label>Planned Maintenance</Label>
</ParameterValue>
<ParameterValue>
<Value>=CInt(Code.StateIntervalType.Black)</Value>
<Label>Unplanned Maintenance</Label>
</ParameterValue>
<ParameterValue>
<Value>=CInt(Code.StateIntervalType.Gray)</Value>
<Label>Monitor disabled</Label>
</ParameterValue>
<ParameterValue>
<Value>=CInt(Code.StateIntervalType.White)</Value>
<Label>Unmonitored</Label>
</ParameterValue>
</ParameterValues>
</ValidValues>
<MultiValue>true</MultiValue>
</ReportParameter>
<ReportParameter Name="StartDate_BaseType">
<DataType>String</DataType>
<Prompt>[Start Date Base]</Prompt>
</ReportParameter>
<ReportParameter Name="StartDate_BaseValue">
<DataType>DateTime</DataType>
<Prompt>[From]</Prompt>
</ReportParameter>
<ReportParameter Name="StartDate_OffsetType">
<DataType>String</DataType>
<Prompt>[Start Date Offset Type]</Prompt>
</ReportParameter>
<ReportParameter Name="StartDate_OffsetValue">
<DataType>Integer</DataType>
<AllowBlank>true</AllowBlank>
<Prompt>[Start Date Offset]</Prompt>
</ReportParameter>
<ReportParameter Name="EndDate_BaseType">
<DataType>String</DataType>
<Prompt>[End Date Base]</Prompt>
</ReportParameter>
<ReportParameter Name="EndDate_BaseValue">
<DataType>DateTime</DataType>
<Prompt>[To]</Prompt>
</ReportParameter>
<ReportParameter Name="EndDate_OffsetType">
<DataType>String</DataType>
<Prompt>[End Date Offset Type]</Prompt>
</ReportParameter>
<ReportParameter Name="EndDate_OffsetValue">
<DataType>Integer</DataType>
<AllowBlank>true</AllowBlank>
<Prompt>[End Date Offset]</Prompt>
</ReportParameter>
<ReportParameter Name="TimeType">
<DataType>String</DataType>
<AllowBlank>true</AllowBlank>
<Prompt>[Time Type]</Prompt>
</ReportParameter>
<ReportParameter Name="TimeWeekMap">
<DataType>String</DataType>
<Prompt>[Week Days]</Prompt>
<MultiValue>true</MultiValue>
</ReportParameter>
<ReportParameter Name="TimeZone">
<DataType>String</DataType>
<Prompt>[Time Zone]</Prompt>
</ReportParameter>
<ReportParameter Name="TimeZoneName">
<DataType>String</DataType>
<Nullable>true</Nullable>
<DefaultValue>
<Values>
<Value xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>Time Zone Name</Prompt>
<Hidden>true</Hidden>
</ReportParameter>
<ReportParameter Name="DataAggregation">
<DataType>Integer</DataType>
<DefaultValue>
<Values>
<Value>0</Value>
</Values>
</DefaultValue>
<Prompt>[Aggregation]</Prompt>
<ValidValues>
<ParameterValues>
<ParameterValue>
<Value>0</Value>
<Label>Hourly</Label>
</ParameterValue>
<ParameterValue>
<Value>1</Value>
<Label>Daily</Label>
</ParameterValue>
<ParameterValue>
<Value>2</Value>
<Label>Monthly</Label>
</ParameterValue>
<ParameterValue>
<Value>3</Value>
<Label>Yearly</Label>
</ParameterValue>
</ParameterValues>
</ValidValues>
</ReportParameter>
<ReportParameter Name="DowntimeForApplication">
<DataType>Integer</DataType>
<DefaultValue>
<Values>
<Value>1</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>[DowntimeForApplication]</Prompt>
</ReportParameter>
<ReportParameter Name="MEMonitorRowID">
<DataType>Integer</DataType>
<AllowBlank>true</AllowBlank>
<Prompt>[MEMonitorRowID]</Prompt>
</ReportParameter>
<ReportParameter Name="ApplicationOrServerName">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>&lt;ApplicationName&gt;</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>[ApplicationOrServerName]</Prompt>
</ReportParameter>
<ReportParameter Name="ReportName">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>Downtime periods</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>[ReportName]</Prompt>
</ReportParameter>
<ReportParameter Name="ReportDescription">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>Downtime periods</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>[ReportDescription]</Prompt>
</ReportParameter>
<ReportParameter Name="LT_Report">
<DataType>String</DataType>
<DefaultValue>
<DataSetReference>
<DataSetName>LT_Report_Query</DataSetName>
<ValueField>ValueXml</ValueField>
</DataSetReference>
</DefaultValue>
<ValidValues>
<DataSetReference>
<DataSetName>LT_Report_Query</DataSetName>
<ValueField>ValueXml</ValueField>
<LabelField>ValueName</LabelField>
</DataSetReference>
</ValidValues>
<Hidden>true</Hidden>
</ReportParameter>
<ReportParameter Name="LT_Table">
<DataType>String</DataType>
<DefaultValue>
<DataSetReference>
<DataSetName>LT_Table_Query</DataSetName>
<ValueField>ValueXml</ValueField>
</DataSetReference>
</DefaultValue>
<ValidValues>
<DataSetReference>
<DataSetName>LT_Table_Query</DataSetName>
<ValueField>ValueXml</ValueField>
<LabelField>ValueName</LabelField>
</DataSetReference>
</ValidValues>
<Hidden>true</Hidden>
</ReportParameter>
</ReportParameters>
<Code><Script>
Const LocTableStringQuery As String = "R/S[@N='{0}']/text()"

Const YAxis_Label = "YAxis_Label"
Const ReportDescription = "ReportDescription"
Const ReportName = "ReportName"

Const TimeZoneParameterName As String = "TimeZone"
Const SD_BaseTypeParameterName As String = "StartDate_BaseType"
Const SD_BaseValueParameterName As String = "StartDate_BaseValue"
Const SD_OffsetTypeParameterName As String = "StartDate_OffsetType"
Const SD_OffsetValueParameterName As String = "StartDate_OffsetValue"
Const ED_BaseTypeParameterName As String = "EndDate_BaseType"
Const ED_BaseValueParameterName As String = "EndDate_BaseValue"
Const ED_OffsetTypeParameterName As String = "EndDate_OffsetType"
Const ED_OffsetValueParameterName As String = "EndDate_OffsetValue"
Const IsRelativeTimeSupported As Boolean = True
Const TimeTypeParameterName As String = "TimeType"
Const TimeWeekMapParameterName As String = "TimeWeekMap"
Const DataAggregationParameterName As String = "DataAggregation"
Const TD_BaseValueParameterName As String = "EndDateTrend_BaseValue"

Dim LocTables As System.Collections.Generic.Dictionary(Of String, Microsoft.EnterpriseManagement.Reporting.XmlStringTable)
Dim ReportTimeZone As Microsoft.EnterpriseManagement.Reporting.TimeZoneCoreInformation
Dim ReportStartDate As DateTime
Dim ReportEndDate As DateTime
Dim ReportEndDateTrend1 as DateTime
Dim ReportEndDateTrend2 as DateTime

Dim ReportTime As Microsoft.EnterpriseManagement.Reporting.ParameterProcessor.RelativeTime
Dim ReportCulture As System.Globalization.CultureInfo
Dim ParameterProcessor As Microsoft.EnterpriseManagement.Reporting.ParameterProcessor

Protected Overrides Sub OnInit()
LocTables = new System.Collections.Generic.Dictionary(Of String, Microsoft.EnterpriseManagement.Reporting.XmlStringTable)()
ReportTimeZone = Nothing
ReportStartDate = DateTime.MinValue
ReportEndDate = DateTime.MinValue
ReportTime = Nothing
ReportCulture = System.Globalization.CultureInfo.GetCultureInfo(Report.User("Language"))
ParameterProcessor = New Microsoft.EnterpriseManagement.Reporting.ParameterProcessor(ReportCulture)
End Sub

'''''''''''''''''''''''''''''''''
'ComTrade aggregate custom code
'''''''''''''''''''''''''''''''''
Public values1 As New System.Collections.ArrayList
Public values2 As New System.Collections.ArrayList
Public values3 As New System.Collections.ArrayList
Public values4 As New System.Collections.ArrayList
Public values5 As New System.Collections.ArrayList
Public values6 As New System.Collections.ArrayList
Public samples1 As New System.Collections.ArrayList
Public samples2 As New System.Collections.ArrayList
Public samples3 As New System.Collections.ArrayList
Public samples4 As New System.Collections.ArrayList
Public samples5 As New System.Collections.ArrayList
Public samples6 As New System.Collections.ArrayList

Function CTInitValues() as Decimal
values1.Clear()
values2.Clear()
values3.Clear()
values4.Clear()
values5.Clear()
values6.Clear()
samples1.Clear()
samples2.Clear()
samples3.Clear()
samples4.Clear()
samples5.Clear()
samples6.Clear()
CTInitValues = 0.0
End Function

Function CTAddValue(newValue As Object, newSamples as Object, index as Integer) As Object

Dim values
Dim samples
If index = 1 Then
values = values1
samples = samples1
ElseIf index = 2 Then
values = values2
samples = samples2
ElseIf index = 3 Then
values = values3
samples = samples3
ElseIf index = 4 Then
values = values4
samples = samples4
ElseIf index = 5 Then
values = values5
samples = samples5
Else
values = values6
samples = samples6
End If

values.Add(newValue)
samples.Add(newSamples)

CTAddValue = newValue
End Function

Function CTGetAvgOfValues(index as Integer) As Decimal
Dim values
Dim samples
If index = 1 Then
values = values1
samples = samples1
ElseIf index = 2 Then
values = values2
samples = samples2
ElseIf index = 3 Then
values = values3
samples = samples3
ElseIf index = 4 Then
values = values4
samples = samples4
ElseIf index = 5 Then
values = values5
samples = samples5
Else
values = values6
samples = samples6
End If

Dim sumValues
Dim cnt
Dim OneItemAvg
cnt = 0
sumValues = 0

For Each OneItemAvg in values
If OneItemAvg is Nothing Then
'do nothing with NULL
Else
cnt = cnt + 1
sumValues = sumValues + OneItemAvg
End If
Next

If cnt &gt; 0 Then
CTGetAvgOfValues = (sumValues / cnt) * 1.0
Else
CTGetAvgOfValues = 0.0
End If

End Function


''''''''''''''''''''''''''''''''''
' down time functions
''''''''''''''''''''''''''''''''''

Const DownTimeParameterName As String = "DownTime"
Dim DownTimeTable As System.Collections.Generic.List(Of Integer)

Public Enum StateIntervalType
Red = 0
Green = 1
Yellow = 2
White = 3
Gray = 4
Black = 5
Blue = 6
ServiceGray = 7
End Enum


Public Function StateIntervalNameApp(time As StateIntervalType)
Select Case time
Case StateIntervalType.Red
Return "Application unavailable"
Case StateIntervalType.Green
Return "Application available"
Case StateIntervalType.Yellow
Return "Delivery Groups In Maintenance"
Case StateIntervalType.White
Return "Unmonitored"
Case StateIntervalType.Gray
Return "Monitor disabled"
Case StateIntervalType.Black
Return "Unplanned Maintenance"
Case StateIntervalType.Blue
Return "Planned Maintenance"
Case StateIntervalType.ServiceGray
Return "Monitoring unavailable"
Case Else
Return ""
End Select
End Function

Public Function StateIntervalNameServer(time As StateIntervalType)
Select Case time
Case StateIntervalType.Red
Return "Delivery Group unavailable"
Case StateIntervalType.Green
Return "Delivery Group available"
Case StateIntervalType.Yellow
Return "Delivery Group In Citrix Maintenance"
Case StateIntervalType.White
Return "Unmonitored"
Case StateIntervalType.Gray
Return "Monitor disabled"
Case StateIntervalType.Black
Return "Unplanned Maintenance"
Case StateIntervalType.Blue
Return "Planned Maintenance"
Case StateIntervalType.ServiceGray
Return "Monitoring unavailable"
Case Else
Return ""
End Select
End Function


Public Function IsDownTime(time As StateIntervalType)
Select Case time
Case StateIntervalType.Red
Return True

'Case StateIntervalType.Yellow 'Citrix Maintenance means UPtime for server availability
' Return False

Case StateIntervalType.Green
Return False

Case Else
If IsNothing(DownTimeTable) Then
DownTimeTable = New System.Collections.Generic.List(Of Integer)()
Dim val As String
For Each val in Report.Parameters(DownTimeParameterName).Value
DownTimeTable.Add(CInt(val))
Next
End If

Return DownTimeTable.Contains(CInt(time))
End Select
End Function

Public Function IsDownTimeApp(time As StateIntervalType)
Select Case time
Case StateIntervalType.Red
Return True

'Case StateIntervalType.Yellow 'Citrix Maintenance means Downtime for application availability
'Return True

Case StateIntervalType.Green
Return False

Case Else
If IsNothing(DownTimeTable) Then
DownTimeTable = New System.Collections.Generic.List(Of Integer)()
Dim val As String
For Each val in Report.Parameters(DownTimeParameterName).Value
DownTimeTable.Add(CInt(val))
Next
End If

Return DownTimeTable.Contains(CInt(time))
End Select
End Function



Public Function FormatTimeInterval(ByVal TimeInSeconds As Integer) As String
Dim Hours, Minutes, Seconds As Integer

Hours = Math.Floor(TimeInSeconds / 3600)
Minutes = Math.Floor((TimeInSeconds Mod 3600) / 60)
Seconds = TimeInSeconds Mod 60

Return FormatString("{0}:{1}:{2}", Hours.ToString(), Minutes.ToString("00"), Seconds.ToString("00"))
End Function

Public Function FormatChartLabel(ByVal LabelValue As Double, ByVal FormatCode As String, ByVal LowThreshold As Double, ByVal HighThreshold As Double, ByVal PointsCount As Double, ByVal PointsThreshold As Double) As String
Dim Result As String
If ((PointsCount &lt;= PointsThreshold) And ((LowThreshold &lt; 0) Or (LabelValue &gt; LowThreshold)) And ((HighThreshold &lt; 0) Or (LabelValue &lt; HighThreshold))) Then
Result = LabelValue.ToString(FormatCode, ReportCulture)
Else
Result = String.Empty
End If
Return Result
End Function

'''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''

Public Function GetYAxisLabel() As String
return Report.Parameters(YAxis_Label).Value
End Function

Public Function GetReportName() As String
return Report.Parameters(ReportName).Value
End Function

Public Function GetReportDescription() As String
return Report.Parameters(ReportDescription).Value
End Function


Public Function GetCallingManagementGroupId() As String
Return Microsoft.EnterpriseManagement.Reporting.ReportingConfiguration.ManagementGroupId
End Function

Public Function GetReportLocLanguageCode() As String
Return ReportCulture.ThreeLetterWindowsLanguageName
End Function

Public Function GetLocTable(Name As String) As Microsoft.EnterpriseManagement.Reporting.XmlStringTable
Dim LocTable As Microsoft.EnterpriseManagement.Reporting.XmlStringTable

If Not LocTables.TryGetValue(Name, LocTable) Then
LocTable = New Microsoft.EnterpriseManagement.Reporting.XmlStringTable(LocTableStringQuery, Report.Parameters(Name).Value)
LocTables.Add(Name, LocTable)
End If

Return LocTable
End Function

'''''''''''''''''''''''''''''''''''
'' ComTrade Functions
'''''''''''''''''''''''''''''''''''
Public Function GetDistinctValuesAsString(parameter As Object) As String
Dim exitString
exitString = ""
Dim items As Object() = parameter
System.Array.Sort(items)

Dim k As Integer = 0
For i As Integer = 0 To items.Length - 1
If i &gt; 0 AndAlso items(i).Equals(items(i - 1)) Then
Continue For
End If
items(k) = items(i)
exitString = exitString + ", " + items(k)
k += 1
Next

Dim unique As [String]() = New [String](k - 1) {}

System.Array.Copy(items, 0, unique, 0, k)
'Return unique
Return exitString
End Function

''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''

Public Function GetReportTimeZone() As Microsoft.EnterpriseManagement.Reporting.TimeZoneCoreInformation
If IsNothing(ReportTimeZone) Then ReportTimeZone = Microsoft.EnterpriseManagement.Reporting.TimeZoneCoreInformation.FromValueString(Report.Parameters(TimeZoneParameterName).Value)
Return ReportTimeZone
End Function

Public Function ToDbDate(ByVal DateValue As DateTime) As DateTime
return GetReportTimeZone.ToUniversalTime(DateValue)
End Function

Public Function ToReportDate(ByVal DateValue As DateTime) As DateTime
return GetReportTimeZone.ToLocalTime(DateValue)
End Function

Public Function DisplayDate(ByVal DateValue As DateTime) as DateTime
return DateValue
End Function

Public Function IsNull(InValue, DefaultValue) as Double
return InValue
'if InValue IS System.DBNull.value then
' return InValue
'else
' return DefaultValue
'end if
End Function


Public Function Comtrade_isBusinessDay(DayOfWeek as Integer) As Integer
If DayOfWeek = 1 Then
return HLS_searchTimeWeekMap("Monday")
Else If DayOfWeek = 2 Then
return HLS_searchTimeWeekMap("Tuesday")
Else If DayOfWeek = 3 Then
return HLS_searchTimeWeekMap("Wednesday")
Else If DayOfWeek = 4 Then
return HLS_searchTimeWeekMap("Thursday")
Else If DayOfWeek = 5 Then
return HLS_searchTimeWeekMap("Friday")
Else If DayOfWeek = 6 Then
return HLS_searchTimeWeekMap("Saturday")
Else If DayOfWeek = 7 Then
return HLS_searchTimeWeekMap("Sunday")
Else
return -1
End If
End Function

Private Function HLS_searchTimeWeekMap(ss as String) as Integer
For Each vrstica As System.Object In Report.Parameters(TimeWeekMapParameterName).Value
If UCase(vrstica) = UCase(ss) Then
return 1
End If
Next
return 0
End Function


Public Function Comtrade_isBusinessTimeType() As Integer
If Report.Parameters(TimeTypeParameterName).Value = "Business" Then
return 1
Else
return 0
End If
End Function

Public Function Comtrade_IsBusinessHoursType() As Boolean
If Comtrade_isBusinessTimeType() = 1 Then
Return True
Else
Return False
End If
End Function

Public Function GetReportStartDate2() As DateTime
ReportStartDate = Convert.ToDateTime(Report.Parameters(SD_BaseValueParameterName).Value)
return ReportStartDate
End Function

Public Function GetReportEndDate2() As DateTime
ReportEndDate = Convert.ToDateTime(Report.Parameters(ED_BaseValueParameterName).Value)
return ReportEndDate
End Function

Public Function GetReportEndDateTrend() As DateTime
ReportEndDateTrend1 = Convert.ToDateTime(Report.Parameters(TD_BaseValueParameterName).Value)
ReportEndDateTrend2 = Convert.ToDateTime(Report.Parameters(ED_BaseValueParameterName).Value)
if ReportEndDateTrend1 &gt; ReportEndDateTrend2
return ReportEndDateTrend1
else
return ReportEndDateTrend2
end if
End Function

Public Function GetReportStartDate() As DateTime
If (ReportStartDate = DateTime.MinValue) Then
If (IsRelativeTimeSupported) Then
ReportStartDate = ParameterProcessor.GetDateTime(ToReportDate(DateTime.UtcNow), Report.Parameters(SD_BaseTypeParameterName).Value, Report.Parameters(SD_BaseValueParameterName).Value, Report.Parameters(SD_OffsetTypeParameterName).Value, Report.Parameters(SD_OffsetValueParameterName).Value, Report.Parameters(TimeTypeParameterName).Value)
Else
ReportStartDate = ParameterProcessor.GetDateTime(ToReportDate(DateTime.UtcNow), Report.Parameters(SD_BaseTypeParameterName).Value, Report.Parameters(SD_BaseValueParameterName).Value, Report.Parameters(SD_OffsetTypeParameterName).Value, Report.Parameters(SD_OffsetValueParameterName).Value)
End if

If (CInt(Report.Parameters(DataAggregationParameterName).Value) &gt; 0) Then
ReportStartDate = ReportStartDate.Date
End If
End If
return ReportStartDate
End Function

'do not use business hour conversion, we need busines hours in SQL QUERY
Public Function GetReportStartDate2DB() As DateTime
If (ReportStartDate = DateTime.MinValue) Then
If False Then 'If (IsRelativeTimeSupported) Then
ReportStartDate = ParameterProcessor.GetDateTime(ToReportDate(DateTime.UtcNow), Report.Parameters(SD_BaseTypeParameterName).Value, Report.Parameters(SD_BaseValueParameterName).Value, Report.Parameters(SD_OffsetTypeParameterName).Value, Report.Parameters(SD_OffsetValueParameterName).Value, Report.Parameters(TimeTypeParameterName).Value)
Else
ReportStartDate = ParameterProcessor.GetDateTime(ToReportDate(DateTime.UtcNow), Report.Parameters(SD_BaseTypeParameterName).Value, Report.Parameters(SD_BaseValueParameterName).Value, Report.Parameters(SD_OffsetTypeParameterName).Value, Report.Parameters(SD_OffsetValueParameterName).Value)
End if

End If
return ReportStartDate
End Function

'do not use business hour conversion, we need busines hours in SQL QUERY
Public Function GetReportEndDate2DB() As DateTime
If (ReportEndDate = DateTime.MinValue) Then
If False Then 'If (IsRelativeTimeSupported) Then
ReportEndDate = ParameterProcessor.GetDateTime(ToReportDate(DateTime.UtcNow), Report.Parameters(ED_BaseTypeParameterName).Value, Report.Parameters(ED_BaseValueParameterName).Value, Report.Parameters(ED_OffsetTypeParameterName).Value, Report.Parameters(ED_OffsetValueParameterName).Value, Report.Parameters(TimeTypeParameterName).Value)
If IsBusinessHours(GetReportTimeFilter()) Then ReportEndDate = ReportCulture.Calendar.AddDays(ReportEndDate, 1)
Else
ReportEndDate = ParameterProcessor.GetDateTime(ToReportDate(DateTime.UtcNow), Report.Parameters(ED_BaseTypeParameterName).Value, Report.Parameters(ED_BaseValueParameterName).Value, Report.Parameters(ED_OffsetTypeParameterName).Value, Report.Parameters(ED_OffsetValueParameterName).Value)
End if

End If
return ReportEndDate
End Function

Public Function GetReportEndDate() As DateTime
If (ReportEndDate = DateTime.MinValue) Then
If (IsRelativeTimeSupported) Then
ReportEndDate = ParameterProcessor.GetDateTime(ToReportDate(DateTime.UtcNow), Report.Parameters(ED_BaseTypeParameterName).Value, Report.Parameters(ED_BaseValueParameterName).Value, Report.Parameters(ED_OffsetTypeParameterName).Value, Report.Parameters(ED_OffsetValueParameterName).Value, Report.Parameters(TimeTypeParameterName).Value)
If IsBusinessHours(GetReportTimeFilter()) Then ReportEndDate = ReportCulture.Calendar.AddDays(ReportEndDate, 1)
Else
ReportEndDate = ParameterProcessor.GetDateTime(ToReportDate(DateTime.UtcNow), Report.Parameters(ED_BaseTypeParameterName).Value, Report.Parameters(ED_BaseValueParameterName).Value, Report.Parameters(ED_OffsetTypeParameterName).Value, Report.Parameters(ED_OffsetValueParameterName).Value)
End if

If (CInt(Report.Parameters(DataAggregationParameterName).Value) &gt; 0) Then
ReportEndDate = ReportEndDate.Date
End If
End If
return ReportEndDate
End Function

Public Function GetReportTimeFilter2() As Microsoft.EnterpriseManagement.Reporting.ParameterProcessor.RelativeTime
ReportTime = New Microsoft.EnterpriseManagement.Reporting.ParameterProcessor.RelativeTime(Report.Parameters(TimeTypeParameterName).Value, Report.Parameters(SD_BaseValueParameterName).Value, Report.Parameters(ED_BaseValueParameterName).Value, CStr(Join(Report.Parameters(TimeWeekMapParameterName).Value, ",")))
return ReportTime
End Function


Public Function GetReportTimeFilter() As Microsoft.EnterpriseManagement.Reporting.ParameterProcessor.RelativeTime
If IsNothing(ReportTime) Then
If (CInt(Report.Parameters(DataAggregationParameterName).Value) = 0)
ReportTime = New Microsoft.EnterpriseManagement.Reporting.ParameterProcessor.RelativeTime(Report.Parameters(TimeTypeParameterName).Value, Report.Parameters(SD_BaseValueParameterName).Value, Report.Parameters(ED_BaseValueParameterName).Value, CStr(Join(Report.Parameters(TimeWeekMapParameterName).Value, ",")))
Else
ReportTime = New Microsoft.EnterpriseManagement.Reporting.ParameterProcessor.RelativeTime(Microsoft.EnterpriseManagement.Reporting.ParameterProcessor.RelativeTimeType.Regular, Report.Parameters(SD_BaseValueParameterName).Value, Report.Parameters(ED_BaseValueParameterName).Value, CStr(Join(Report.Parameters(TimeWeekMapParameterName).Value, ",")))
End if
End If
return ReportTime
End Function

Public Function IsBusinessHours(Value As Microsoft.EnterpriseManagement.Reporting.ParameterProcessor.RelativeTime) As Boolean
return (Not IsNothing(Value)) And (Value.TimeType = Microsoft.EnterpriseManagement.Reporting.ParameterProcessor.RelativeTimeType.Business)
End Function



Public Function FormatDateTime(Format As String, Value As DateTime) As String
return Value.ToString(Format, ReportCulture)
End Function

Public Function FormatNumber(Format As String, Value As Decimal) As String
if IsDBNull(Value) then
return "-"
else
return Value.ToString(Format, ReportCulture)
end if
End Function

Public Function FormatString(Format As String, ParamArray Values() as Object) As String
return String.Format(ReportCulture, Format, Values)
End Function

Public Function NullFormatString(Format As String, Value as String) As String
return IIF(String.IsNullOrEmpty(Value), String.Empty, String.Format(ReportCulture, Format, Value))
End Function

Public Function GetDrilledObjectTypesPathVector(ObjPath As String, DrilledObj As String) As String
Dim found, a, x
Dim newObjPath
newObjPath = ""
found = False
a = Split(ObjPath, ",")
For Each x In a
If found Then
newObjPath = newObjPath + "," + x
End If

If x = DrilledObj And found = False Then
found = True
newObjPath = DrilledObj
End If
Next
return newObjPath
End Function

Public Function GetNextDrilledDownObjectTypes(DrilledObjVector As String)
Dim found
Dim newObjPath
Dim a, x
newObjPath = ""
found = False
a = Split(DrilledObjVector, ",")
For Each x In a
If found Then
If newObjPath = "" Then
newObjPath = newObjPath + x
Else
newObjPath = newObjPath + "," + x
End If
End If
'skip the first one
If found = False Then
found = True
End If
Next
return newObjPath
End Function

Public Function GetCurrentDrilledDownObjectType(DrilledObjVector As String)
Dim found
Dim newObjPath
Dim a, x
newObjPath = ""
found = False
a = Split(DrilledObjVector, ",")
For Each x In a
'skip the first one
If found = False Then
found = True
newObjPath = newObjPath + x
End If
Next
return newObjPath
End Function

Public Function FormatBusinessHours2(Format As String, Value As Microsoft.EnterpriseManagement.Reporting.ParameterProcessor.RelativeTime) As String
Dim result As String

If Comtrade_isBusinessTimeType = 1 Then

Dim firstDay As DayOfWeek
Dim days As System.Collections.Generic.List(Of String)

firstDay = ReportCulture.DateTimeFormat.FirstDayOfWeek
days = new System.Collections.Generic.List(Of String)()

For loopDay As DayOfWeek = DayOfWeek.Sunday To DayOfWeek.Saturday
Dim day As DayOfWeek
day = CType((CInt(loopDay) + CInt(firstDay)) Mod 7, DayOfWeek)

If value.WeekMap.Contains(day) Then days.Add(ReportCulture.DateTimeFormat.GetAbbreviatedDayName(day))
Next loopDay

result = FormatString(Format, DateTime.Today.Add(Value.StartTime).ToString(ReportCulture.DateTimeFormat.ShortTimePattern), DateTime.Today.Add(Value.EndTime).ToString(ReportCulture.DateTimeFormat.ShortTimePattern), String.Join(",", days.ToArray()))

Else
result = String.Empty
End if

return result
End Function

Public Function FormatBusinessHours(Format As String, Value As Microsoft.EnterpriseManagement.Reporting.ParameterProcessor.RelativeTime) As String
Dim result As String

If IsBusinessHours(Value) Then

Dim firstDay As DayOfWeek
Dim days As System.Collections.Generic.List(Of String)

firstDay = ReportCulture.DateTimeFormat.FirstDayOfWeek
days = new System.Collections.Generic.List(Of String)()

For loopDay As DayOfWeek = DayOfWeek.Sunday To DayOfWeek.Saturday
Dim day As DayOfWeek
day = CType((CInt(loopDay) + CInt(firstDay)) Mod 7, DayOfWeek)

If value.WeekMap.Contains(day) Then days.Add(ReportCulture.DateTimeFormat.GetAbbreviatedDayName(day))
Next loopDay

result = FormatString(Format, DateTime.Today.Add(Value.StartTime).ToString(ReportCulture.DateTimeFormat.ShortTimePattern), DateTime.Today.Add(Value.EndTime).ToString(ReportCulture.DateTimeFormat.ShortTimePattern), String.Join(",", days.ToArray()))

Else
result = String.Empty
End if

return result
End Function

Public Function BuildXmlValueList(ByVal ValueList() As Object) As String
Return Microsoft.EnterpriseManagement.Reporting.MultiValueParameter.ToXml("Data", "Value", ValueList)
End Function

REM ----------------------------------------

Public Enum DataAggregationType
Hourly = 0
Daily = 1
End Enum

Public Enum AggregationType
None = 0
Daily = 1
Weekly = 2
Monthly = 3
Yearly = 4
End Enum

Public Function FormatAggregatedTimeValue(ByVal TimeValue As DateTime, ByVal AggType As AggregationType, ByVal DataAggType As DataAggregationType) As Long
Dim Result As Long

Select Case (AggType)
Case AggregationType.Daily
If DataAggType = DataAggregationType.Daily Then
Result = TimeValue.Ticks
Else
Result = TimeValue.Hour
End If

Case AggregationType.Weekly
Result = CInt(TimeValue.DayOfWeek)

Case AggregationType.Monthly
Result = TimeValue.Day

Case AggregationType.Yearly
Result = TimeValue.Month

Case Else
Result = TimeValue.Ticks
End Select

Return Result
End Function

Public Function FormatAggregatedTimeValueLabel2(ByVal TimeValue As DateTime, DataAggType As Integer) As String
Dim Result As String

Select Case (DataAggType)
Case 0
Result = TimeValue.ToString("G", ReportCulture)
Case 1
Result = TimeValue.ToString("d", ReportCulture)
Case 2
Result = TimeValue.ToString("MMMM yyyy", ReportCulture)
Case 3
Result = TimeValue.ToString("yyyy", ReportCulture)
Case Else
Result = TimeValue.ToString("G", ReportCulture)

'Case AggregationType.Weekly
' Result = ReportCulture.DateTimeFormat.GetDayName(TimeValue.DayOfWeek)

'Case AggregationType.Yearly
' Result = ReportCulture.DateTimeFormat.GetMonthName(TimeValue.Month)

End Select

Return Result
End Function

Public Function FormatAggregatedTimeValueLabel(ByVal TimeValue As DateTime, ByVal AggType As AggregationType, ByVal DataAggType As DataAggregationType) As String
Dim Result As String

Select Case (AggType)
Case AggregationType.Daily
If DataAggType = DataAggregationType.Daily Then
Result = TimeValue.ToString("d", ReportCulture)
Else
Result = TimeValue.ToString("t", ReportCulture)
End If

Case AggregationType.Weekly
Result = ReportCulture.DateTimeFormat.GetDayName(TimeValue.DayOfWeek)

Case AggregationType.Monthly
Result = TimeValue.Day.ToString()

Case AggregationType.Yearly
Result = ReportCulture.DateTimeFormat.GetMonthName(TimeValue.Month)

Case Else
If DataAggType = DataAggregationType.Daily Then
Result = TimeValue.ToString("d", ReportCulture)
Else
Result = TimeValue.ToString("G", ReportCulture)
End If
End Select

Return Result
End Function

Public Function Options_SplitByObject(ByVal OptionsXml As String, ByVal ObjectTag As String, ByVal ObjectsXml As String) As String
Dim Xml, ListXml As System.Xml.XmlDocument

Xml = New System.Xml.XmlDocument()
Xml.LoadXml(OptionsXml)

ListXml = New System.Xml.XmlDocument()
ListXml.LoadXml(ObjectsXml)

Dim Format As System.Text.StringBuilder
Format = New System.Text.StringBuilder("&lt;Value&gt;&lt;" +ObjectTag+ "&gt;{0}&lt;/" +ObjectTag+ "&gt;")
For Each Node As System.Xml.XmlNode In Xml.DocumentElement.ChildNodes
If Node.Name &lt;&gt; ObjectTag Then Format.Append(Node.OuterXml)
Next
Format.Append("&lt;/Value&gt;")

Dim Result As System.Text.StringBuilder
Result = New System.Text.StringBuilder()
For Each ObjectNode As System.Xml.XmlNode In ListXml.DocumentElement.ChildNodes
Result.Append(String.Format(Format.ToString(), ObjectNode.InnerText))
Next

Return Result.ToString()
End Function

Public Function Options_GetObjectList(ByVal OptionsXml As String) As String()
Dim Xml As System.Xml.XmlDocument
Xml = New System.Xml.XmlDocument()
Xml.LoadXml(OptionsXml)

Dim Result As System.Collections.Generic.List(Of String)
Result = New System.Collections.Generic.List(Of String)
For Each ObjectNode As System.Xml.XmlNode In Xml.SelectNodes("/Value/Object")
Result.Add(ObjectNode.InnerText)
Next

Return Result.ToArray()
End Function

REM ----------------------------------------

Public Function GetStartDrillTimeValue(ByVal TimeValue As DateTime, ByVal DataAggregation As Integer) As DateTime
Dim Result As DateTime
Dim StartDate As DateTime
StartDate = GetReportStartDate()

Select Case (DataAggregation)
Case 0 'HOURLY
Result = StartDate

Case 1 'Daily
If TimeValue.Date &lt; StartDate Then Result = StartDate Else Result = TimeValue.Date

Case 2 'Monthly
If TimeValue.Date &lt; StartDate Then Result = StartDate Else Result = TimeValue.Date

Case 3 'Yearly
If TimeValue.Date &lt; StartDate Then Result = StartDate Else Result = TimeValue.Date

End Select

If (IsRelativeTimeSupported) Then
Dim TimeFilter As Microsoft.EnterpriseManagement.Reporting.ParameterProcessor.RelativeTime
TimeFilter = GetReportTimeFilter()

If IsBusinessHours(TimeFilter) Then Result = Result.Add(TimeFilter.StartTime)
End If

Return Result
End Function

Public Function GetEndDrillTimeValue(ByVal TimeValue As DateTime, ByVal DataAggregation As Integer) As DateTime
Dim Result, EndTimeValue As DateTime
Dim EndDate As DateTime
EndDate = GetReportEndDate()

Select Case (DataAggregation)
Case 0 'Hourly
Result = EndDate

Case 1 'Daily
EndTimeValue = ReportCulture.Calendar.AddDays(TimeValue.Date, 1)
If EndTimeValue.Date &gt; EndDate Then Result = EndDate Else Result = EndTimeValue.Date

Case 2 'Monthly
EndTimeValue = ReportCulture.Calendar.AddMonths(TimeValue.Date, 1)
If EndTimeValue.Date &gt; EndDate Then Result = EndDate Else Result = EndTimeValue.Date

Case 3 'Yearly
EndTimeValue = ReportCulture.Calendar.AddYears(TimeValue.Date, 1)
If EndTimeValue.Date &gt; EndDate Then Result = EndDate Else Result = EndTimeValue.Date

End Select

If (IsRelativeTimeSupported) Then
Dim TimeFilter As Microsoft.EnterpriseManagement.Reporting.ParameterProcessor.RelativeTime
TimeFilter = GetReportTimeFilter()

If IsBusinessHours(TimeFilter) Then Result = ReportCulture.Calendar.AddDays(Result, -1).Add(TimeFilter.EndTime)
End If

Return Result
End Function

Dim ReportIntervalEndDate As DateTime

Public Function GetIntervalEndValue(ByVal Value As Object) As DateTime
If (ReportIntervalEndDate = DateTime.MinValue) Then
ReportIntervalEndDate = DateTime.Now
End If
Return IIF(IsNothing(Value), ReportIntervalEndDate, CDate(Value))
End Function

Public Dim CurrentObjectList As String
Public Dim CurrentInstanceList As String

Public Function InitList(ByRef List As String) As String
List = String.Empty
Return List
End Function

Public Function AddListItem(ByRef List As String, Item as String) As String
List = List + Item
Return List
End Function
</Script></Code>
<Language>en-US</Language>
<CodeModules>
<CodeModule>Microsoft.EnterpriseManagement.Reporting.Code, Version=6.0.0.0, Culture=neutral</CodeModule>
<CodeModule>System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</CodeModule>
</CodeModules>
<ConsumeContainerWhitespace>true</ConsumeContainerWhitespace>
<DataElementStyle>Element</DataElementStyle>
<rd:ReportUnitType>Inch</rd:ReportUnitType>
<rd:ReportID>b9fa0110-f7fc-4632-be5f-a7ec1d5124e7</rd:ReportID>
</Report>