2010-07-29 10 views
1

J'ai une table avec 4 colonnes dans un FlowDocument. J'ai défini la largeur des colonnes, mais lorsqu'elle est affichée dans FlowDocumentReader, en mode Page ou en mode Page 2, la colonne la plus à droite est tronquée.La table à l'intérieur de FlowDocument tronque les colonnes les plus à droite, pourquoi?

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

Mode défilement semble correct: Scroll Mode http://lh3.ggpht.com/_nAfWrUnRWwQ/TFG6S0OGdeI/AAAAAAAADic/lpQPFEAhIwI/All%20Columns%20Visible.png

Quand en mode page, les choses sont différentes. Notez qu'une partie de la troisième colonne et la totalité de la quatrième colonne sont tronquées. Pourquoi est-il utile de tronquer les colonnes de droite au lieu de les afficher sur la page suivante? Page Mode http://lh4.ggpht.com/_nAfWrUnRWwQ/TFG6TIzGX7I/AAAAAAAADig/mLw1fV8-c90/truncated%20columns.png

Répondre

1

J'ai été en mesure d'afficher FlowDocument dans une seule colonne en définissant la propriété ColumnWidth à la même valeur que PageWidth. J'utilise FlowDocument pour imprimer et cela fonctionne très bien. Les propriétés PageWidth et PageHeight sont définies sur tout ce que PrintDialog indique comme zone imprimable. Je définis ensuite la ColumnWidth pour empêcher l'impression dans plus d'une colonne.

<FlowDocument PageWidth="850" PageHeight="1056" ColumnWidth="850" > 
... 
</FlowDocument>