1

我在 FlowDocument 中有一个包含 4 列的表。我已经设置了列的宽度,但是当在 FlowDocumentReader 中查看时,在页面模式或 2 页模式下,最右边的列被截断。

<FlowDocument >
<Table BorderBrush="Black" BorderThickness="1">
    <Table.Columns>
        <TableColumn Background="Red" Width="120" />
        <TableColumn Background="Green" Width="180" />
        <TableColumn Background="Blue" Width="140" />
        <TableColumn Background="Yellow" Width="140" />
    </Table.Columns>
    <TableRowGroup>
        <TableRow>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph>Row Number</Paragraph>
            </TableCell>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph>Text</Paragraph>
            </TableCell>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph>Another Column</Paragraph>
            </TableCell>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph>Yet Another Column</Paragraph>
            </TableCell>
        </TableRow>
        <TableRow>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph>1</Paragraph>
            </TableCell>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph >Lorem Ipsum is simply dummy text of the printing and typesetting industry.</Paragraph>
            </TableCell>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph>Hello World</Paragraph>
            </TableCell>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph>Where is my text?</Paragraph>
            </TableCell>
        </TableRow>
        <TableRow>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph>2</Paragraph>
            </TableCell>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod ...</Paragraph>
            </TableCell>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph></Paragraph>
            </TableCell>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph></Paragraph>
            </TableCell>
        </TableRow>
        <TableRow>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph>3</Paragraph>
            </TableCell>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque</Paragraph>
            </TableCell>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph></Paragraph>
            </TableCell>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph></Paragraph>
            </TableCell>
        </TableRow>
        <TableRow>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph>4</Paragraph>
            </TableCell>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</Paragraph>
            </TableCell>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph></Paragraph>
            </TableCell>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph></Paragraph>
            </TableCell>
        </TableRow>
        <TableRow>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph>5</Paragraph>
            </TableCell>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</Paragraph>
            </TableCell>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph></Paragraph>
            </TableCell>
            <TableCell BorderBrush="Black" BorderThickness="1">
                <Paragraph></Paragraph>
            </TableCell>
        </TableRow>
    </TableRowGroup>
</Table>

滚动模式看起来不错: 滚动模式 http://lh3.ggpht.com/_nAfWrUnRWwQ/TFG6S0OGdeI/AAAAAAAADic/lpQPFEAhIwI/All%20Columns%20Visible.png

在页面模式下,情况有所不同。请注意,第三列的一部分和第四列的全部都被截断。为什么截断右侧的列而不是在下一页显示它们会很有用? 页面模式 http://lh4.ggpht.com/_nAfWrUnRWwQ/TFG6TIzGX7I/AAAAAAADig/mLw1fV8-c90/truncated%20columns.png

4

1 回答 1

1

通过将 ColumnWidth 设置为与 PageWidth 相同的值,我能够使 FlowDocument 显示在单个列中。我正在使用 FlowDocument 进行打印,结果证明效果很好。PageWidth 和 PageHeight 属性设置为 PrintDialog 所说的可打印区域。然后我设置 ColumnWidth 以防止在多列中打印。

<FlowDocument PageWidth="850" PageHeight="1056" ColumnWidth="850" >
...
</FlowDocument>
于 2010-08-05T18:52:35.017 回答