根据自定义模板绑定数据后台,打印相应报告单
<FlowDocument x:Class="CJJC.HMI.OS.PrintDocument"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
Background="#EFEFEF" ColumnWidth="1100"
>
<Table FontSize="16" FontFamily="宋体" >
<Table.Columns>
<TableColumn Width="70"></TableColumn>
<TableColumn Width="110"></TableColumn>
<TableColumn Width="70"></TableColumn>
<TableColumn Width="110"></TableColumn>
<TableColumn Width="70"></TableColumn>
<TableColumn Width="110"></TableColumn>
<TableColumn Width="75"></TableColumn>
<TableColumn Width="110"></TableColumn>
</Table.Columns>
<TableRowGroup >
<TableRow >
<TableCell ColumnSpan="8" >
<Paragraph FontSize="36" TextAlignment="Center" FontWeight="Bold" >报告单</Paragraph>
</TableCell>
</TableRow>
<TableRow >
<TableCell ColumnSpan="8" >
<Paragraph Background="Black" >
<Line Width="1000" Height="2" >
</Line>
</Paragraph>
</TableCell>
</TableRow>
<TableRow >
<TableCell >
<Paragraph FontWeight="Bold">
姓名
</Paragraph>
</TableCell>
<TableCell>
<Paragraph >
<!--这里绑定数据-->
<Run Text="{Binding Name}"></Run>
</Paragraph>
</TableCell>
<TableCell>
<Paragraph FontWeight="Bold">
性别
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
<Run Text="{Binding Sex}"></Run>
</Paragraph>
</TableCell>
<TableCell>
<Paragraph FontWeight="Bold">
年龄
</Paragraph>
</TableCell>
<TableCell>
<Paragraph>
<Run Text=</