2010-07-29 487 views
1

我有一個FlowDocument內有4列的表。我已經設置了列的寬度,但是在FlowDocumentReader中查看時,處於頁面模式或2頁面模式時,最右邊的列被截斷。FlowDocument中的表格會截斷最右邊的列,爲什麼?

<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> 

滾動模式看起來不錯: Scroll Mode http://lh3.ggpht.com/_nAfWrUnRWwQ/TFG6S0OGdeI/AAAAAAAADic/lpQPFEAhIwI/All%20Columns%20Visible.png

當在頁模式下,情況就不同了。請注意,第三列的一部分和第四列的所有內容都被截斷。爲什麼截斷右側的列而不是在下一頁顯示它們會有用? Page Mode http://lh4.ggpht.com/_nAfWrUnRWwQ/TFG6TIzGX7I/AAAAAAAADig/mLw1fV8-c90/truncated%20columns.png

回答

1

我能夠通過將ColumnWidth設置爲與PageWidth相同的值來將FlowDocument顯示在單個列中。我正在使用FlowDocument進行打印,事實證明這很好。 PageWidth和PageHeight屬性設置爲PrintDialog所說的可打印區域。然後設置ColumnWidth以防止在多列中打印。

<FlowDocument PageWidth="850" PageHeight="1056" ColumnWidth="850" > 
... 
</FlowDocument> 
相關問題