报告XP.ReportEngine:新增 IReportService接口封装完整报告生成流程,支持外部类库直接调用;新增 ReportRequest、ReportServiceResult 请求/响应模型;新增引擎预热机制;PDF 生成改为 Task.Run 后台线程执行,解决进度窗口和主窗口卡死问题;完善文档。
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
<Window x:Class="XP.ReportEngine.Views.ReportDemoWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
|
||||
Title="报告生成演示 | Report Generation Demo"
|
||||
Width="560" Height="580"
|
||||
Width="580" Height="380"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
ResizeMode="NoResize">
|
||||
<Grid Margin="20">
|
||||
@@ -10,98 +11,98 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 标题 | Title -->
|
||||
<TextBlock Grid.Row="0" Text="XP.ReportEngine 报告生成演示"
|
||||
FontSize="18" FontWeight="Bold" Margin="0,0,0,12"/>
|
||||
FontSize="18" FontWeight="SemiBold" Margin="0,0,0,16"
|
||||
Foreground="#FF333333"/>
|
||||
|
||||
<!-- 输入表单 | Input form -->
|
||||
<Grid Grid.Row="1" Margin="0,0,0,12">
|
||||
<Grid Grid.Row="1" Margin="0,0,0,16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="90"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="20"/>
|
||||
<ColumnDefinition Width="24"/>
|
||||
<ColumnDefinition Width="90"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="28"/>
|
||||
<RowDefinition Height="28"/>
|
||||
<RowDefinition Height="28"/>
|
||||
<RowDefinition Height="28"/>
|
||||
<RowDefinition Height="28"/>
|
||||
<RowDefinition Height="32"/>
|
||||
<RowDefinition Height="32"/>
|
||||
<RowDefinition Height="32"/>
|
||||
<RowDefinition Height="32"/>
|
||||
<RowDefinition Height="32"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 第一列 | Column 1 -->
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="产品名称:" VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding ProductName, UpdateSourceTrigger=PropertyChanged}" VerticalContentAlignment="Center"/>
|
||||
<telerik:RadWatermarkTextBox Grid.Row="0" Grid.Column="1"
|
||||
Text="{Binding ProductName, UpdateSourceTrigger=PropertyChanged}"
|
||||
WatermarkContent="输入产品名称"
|
||||
telerik:StyleManager.Theme="Crystal"/>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="产品类型码:" VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding ProductCode, UpdateSourceTrigger=PropertyChanged}" VerticalContentAlignment="Center"/>
|
||||
<telerik:RadWatermarkTextBox Grid.Row="1" Grid.Column="1"
|
||||
Text="{Binding ProductCode, UpdateSourceTrigger=PropertyChanged}"
|
||||
WatermarkContent="输入产品类型码"
|
||||
telerik:StyleManager.Theme="Crystal"/>
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="工件 SN 码:" VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding WorkpieceSN, UpdateSourceTrigger=PropertyChanged}" VerticalContentAlignment="Center"/>
|
||||
<telerik:RadWatermarkTextBox Grid.Row="2" Grid.Column="1"
|
||||
Text="{Binding WorkpieceSN, UpdateSourceTrigger=PropertyChanged}"
|
||||
WatermarkContent="输入工件序列号"
|
||||
telerik:StyleManager.Theme="Crystal"/>
|
||||
|
||||
<TextBlock Grid.Row="3" Grid.Column="0" Text="CNC 程序:" VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding CncProgram, UpdateSourceTrigger=PropertyChanged}" VerticalContentAlignment="Center"/>
|
||||
<telerik:RadWatermarkTextBox Grid.Row="3" Grid.Column="1"
|
||||
Text="{Binding CncProgram, UpdateSourceTrigger=PropertyChanged}"
|
||||
WatermarkContent="输入 CNC 程序名"
|
||||
telerik:StyleManager.Theme="Crystal"/>
|
||||
|
||||
<TextBlock Grid.Row="4" Grid.Column="0" Text="操作员:" VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding OperatorName, UpdateSourceTrigger=PropertyChanged}" VerticalContentAlignment="Center"/>
|
||||
<telerik:RadWatermarkTextBox Grid.Row="4" Grid.Column="1"
|
||||
Text="{Binding OperatorName, UpdateSourceTrigger=PropertyChanged}"
|
||||
WatermarkContent="输入操作员"
|
||||
telerik:StyleManager.Theme="Crystal"/>
|
||||
|
||||
<!-- 第二列 | Column 2 -->
|
||||
<TextBlock Grid.Row="0" Grid.Column="3" Text="设备编号:" VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="0" Grid.Column="4" Text="{Binding DeviceId, UpdateSourceTrigger=PropertyChanged}" VerticalContentAlignment="Center"/>
|
||||
<telerik:RadWatermarkTextBox Grid.Row="0" Grid.Column="4"
|
||||
Text="{Binding DeviceId, UpdateSourceTrigger=PropertyChanged}"
|
||||
WatermarkContent="输入设备编号"
|
||||
telerik:StyleManager.Theme="Crystal"/>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="3" Text="生产机台号:" VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="4" Text="{Binding MachineId, UpdateSourceTrigger=PropertyChanged}" VerticalContentAlignment="Center"/>
|
||||
<telerik:RadWatermarkTextBox Grid.Row="1" Grid.Column="4"
|
||||
Text="{Binding MachineId, UpdateSourceTrigger=PropertyChanged}"
|
||||
WatermarkContent="输入机台号"
|
||||
telerik:StyleManager.Theme="Crystal"/>
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="3" Text="描述:" VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="4" Text="{Binding Description, UpdateSourceTrigger=PropertyChanged}" VerticalContentAlignment="Center"/>
|
||||
<telerik:RadWatermarkTextBox Grid.Row="2" Grid.Column="4"
|
||||
Text="{Binding Description, UpdateSourceTrigger=PropertyChanged}"
|
||||
WatermarkContent="输入描述信息"
|
||||
telerik:StyleManager.Theme="Crystal"/>
|
||||
</Grid>
|
||||
|
||||
<!-- 按钮区域 | Button area -->
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,12">
|
||||
<Button Content="生成报告" Command="{Binding GenerateReportCommand}"
|
||||
Width="100" Height="32" Margin="0,0,10,0"/>
|
||||
<Button Content="查看 PDF" Command="{Binding OpenViewerCommand}"
|
||||
Width="100" Height="32" Margin="0,0,10,0"/>
|
||||
<Button Content="打印报告" Command="{Binding PrintReportCommand}"
|
||||
Width="100" Height="32"/>
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,16">
|
||||
<telerik:RadButton Content="生成报告" Command="{Binding GenerateReportCommand}"
|
||||
Width="110" Height="30" Margin="0,0,12,0"
|
||||
telerik:StyleManager.Theme="Crystal"/>
|
||||
<telerik:RadButton Content="查看 PDF" Command="{Binding OpenViewerCommand}"
|
||||
Width="110" Height="30" Margin="0,0,12,0"
|
||||
telerik:StyleManager.Theme="Crystal"/>
|
||||
<telerik:RadButton Content="打印报告" Command="{Binding PrintReportCommand}"
|
||||
Width="110" Height="30"
|
||||
telerik:StyleManager.Theme="Crystal"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- 说明区域 | Instructions -->
|
||||
<Border Grid.Row="3" BorderBrush="#DDDDDD" BorderThickness="1"
|
||||
Background="#F9F9F9" CornerRadius="4" Padding="10">
|
||||
<TextBlock TextWrapping="Wrap" FontSize="12" Foreground="#555555">
|
||||
<Run FontWeight="Bold">使用说明:</Run>
|
||||
<LineBreak/>
|
||||
<Run>1. 填写产品信息、设备信息和操作员</Run>
|
||||
<LineBreak/>
|
||||
<Run>2. 点击"生成报告",系统将使用模拟检测数据生成 PDF</Run>
|
||||
<LineBreak/>
|
||||
<Run>3. 生成完成后,可点击"查看 PDF"在阅读器中预览</Run>
|
||||
<LineBreak/>
|
||||
<Run>4. 点击"打印报告"可将 PDF 发送到打印机</Run>
|
||||
<LineBreak/>
|
||||
<LineBreak/>
|
||||
<Run FontWeight="Bold">文件名模式(App.config 配置):</Run>
|
||||
<LineBreak/>
|
||||
<Run>{ReportId} {ProductName} {ProductCode} {WorkpieceSN}</Run>
|
||||
<LineBreak/>
|
||||
<Run>{CncProgram} {DeviceId} {MachineId} {Date} {Time} {Result}</Run>
|
||||
<LineBreak/>
|
||||
<LineBreak/>
|
||||
<Run FontWeight="Bold">重复文件处理:</Run>
|
||||
<Run>AutoIncrementOnDuplicate=true 时自动累加 (1)(2)...</Run>
|
||||
</TextBlock>
|
||||
</Border>
|
||||
|
||||
<!-- 状态栏 | Status bar -->
|
||||
<Border Grid.Row="4" Background="#F0F0F0" Margin="0,10,0,0" Padding="8,5">
|
||||
<TextBlock Text="{Binding StatusMessage}" FontSize="11" Foreground="#333333"
|
||||
<Border Grid.Row="3" Background="#F5F5F7" CornerRadius="4" Padding="10,8">
|
||||
<TextBlock Text="{Binding StatusMessage}" FontSize="12" Foreground="#FF333333"
|
||||
TextTrimming="CharacterEllipsis"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
Reference in New Issue
Block a user