The Visibility of the Time Input in the DateTime Parameters

By default, there is no possibility to set time in the DateTime parameters. The DateTimeParameterControl element is used for inputting the values of the DateTime parameters.
In order to display date as well as time you need to override the markup of the DateTimeParameterControl element and add the TimePicker element into it.

In order to override the markup of the element, add the following style to the resources of your application:

<Style TargetType="ssrs:DateTimeParameterControl" 
xmlns:inputToolkit="clr-namespace:System.Windows.Controls;
assembly=System.Windows.Controls.Input.Toolkit"
xmlns:ssrs="clr-namespace:PerpetuumSoft.ReportingServices.Viewer.Client;
assembly=PerpetuumSoft.ReportingServices.Viewer.Client"
xmlns:ex="clr-namespace:System.Windows.Controls;
assembly=System.Windows.Controls">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="ssrs:DateTimeParameterControl">
                <Grid Margin="3">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel
                        Orientation = "Horizontal"
                        Grid.Column="0" 
                        Margin = "5"
                        Width = "130">
                        <TextBlock 
                            Foreground = "{TemplateBinding Foreground}"
                            Text = "{TemplateBinding PromptText}"/>
                        <TextBlock 
                            x:Name="IsRequired"
                            Margin="3,0,0,0" 
                            Foreground="Red" 
                            Text="*"/>
                    </StackPanel>
                    <ex:DatePicker 
                        x:Name = "Value"
                        Grid.Column="1"
                        Width = "200"
                        Height="21"
                        VerticalAlignment="Center"
                        Foreground = "Black"
                        />
                    <inputToolkit:TimePicker
                        x:Name="TimeValue"
                        Grid.Column="2"
                        Width = "100"
                        Height="21"
                        VerticalAlignment="Center"
                        Foreground = "Black"
                        Background="White"
                        Format="Long"
                        />
                    <CheckBox
                        x:Name = "Nullable"
                        Grid.Column="3"
                        VerticalAlignment="Center"
                        Padding="0"
                        Margin = "5"
                        Foreground = "{TemplateBinding Foreground}"
                        Content="Null"
                        />
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

The appearance of the element will be as follows:

The TimePicker control from the System.Windows.Controls.Input.Toolkit library is used for the time input.

Add Feedback