<Window x:Class="自救器呼吸器综合检验仪.ReportWindow3"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="正压气密性检验报表" Height="730" Width="1024"
        WindowStartupLocation="CenterScreen" Loaded="Window_Loaded" Closed="Window_Closed" Closing="Window_Closing">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!-- 标题 -->
        <TextBlock Grid.Row="0" Text="正压气密性检验报表" FontSize="20" FontWeight="Bold" 
                   HorizontalAlignment="Center" Margin="10" Foreground="#FF1976D2"/>

        <!-- 数据表格 -->
        <DataGrid Grid.Row="1" x:Name="dataGrid" AutoGenerateColumns="False" 
                  IsReadOnly="True" Margin="10" FontSize="14">
            <DataGrid.Columns>
                <DataGridTextColumn Header="编号" Binding="{Binding Id}" Width="60"/>
                <DataGridTextColumn Header="时间" Binding="{Binding Time}" Width="80"/>
                <DataGridTextColumn Header="日期" Binding="{Binding Date}" Width="100"/>
                <DataGridTextColumn Header="初始压力" Binding="{Binding  StartPress,StringFormat=F2}" Width="120"/>
                <DataGridTextColumn Header="结束压力" Binding="{Binding EndPress,StringFormat=F2}" Width="100"/>
                <DataGridTextColumn Header="压差" Binding="{Binding DiffPress,StringFormat=F2}" Width="100"/>
                <DataGridTextColumn Header="样品编号" Binding="{Binding No,StringFormat=F2}" Width="100"/>
                <!--<DataGridTextColumn Header="样品编号" Binding="{Binding No,StringFormat=F2}" Width="100"/>-->
                <DataGridTextColumn Header="保压时间" Binding="{Binding ProtectTime}" Width="100"/>
                <DataGridTextColumn Header="记录时间" Binding="{Binding CreateTime, StringFormat=yyyy/MM/dd HH:mm}" Width="150"/>
            </DataGrid.Columns>
        </DataGrid>

        <!-- 底部按钮 -->
        <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="10">
            <Button Content="导出报表" x:Name="btnExport" Click="BtnExport_Click" 
                    Width="100" Height="30" Margin="5" Background="#FF4CAF50" Foreground="White"/>
            <Button Content="清空记录" x:Name="btnClear" Click="BtnClear_Click" 
                    Width="100" Height="30" Margin="5" Background="#FFf44336" Foreground="White"/>
            <Button Content="关闭" x:Name="btnClose" Click="BtnClose_Click" 
                    Width="100" Height="30" Margin="5" Background="#FF607D8B" Foreground="White"/>
            <Button Content="打印" x:Name="btnprint" Click="BtnPrint_Click"
Width="100" Height="30" Margin="5" Background="#FF4CAF50" Foreground="White"/>
        </StackPanel>
    </Grid>
</Window>