Completed
Last Updated: 21 May 2015 11:07 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 29 Jan 2015 14:57
Category: RichTextEditor
Type: Bug Report
1
FIX. RadRichTextEditor - missing table border when printing
To reproduce: use the following code snippet. The attached screenshot illustrates the missing border.

Note: It seems that the RadRichTextEditor remains in Portrait orientation although the RadPrintDocument.DefaultPageSettings.Landscape property is set to true. This issue can be replicated if you specify the PreferredWidth property in pixels in such a way that the table fits in A4 format (wider side). The A4 size print measures 21.0 x 29.7cm.


private void Form1_Load(object sender, EventArgs e)
{
    RadDocument document = new RadDocument();
    document.LayoutMode = Telerik.WinForms.Documents.Model.DocumentLayoutMode.Paged;
    Section sec = new Section();           
    sec.PageOrientation = PageOrientation.Landscape;
    sec.PageSize = PaperTypeConverter.ToSize(PaperTypes.A4);
    document.Sections.Add(sec);
    Paragraph para = new Paragraph();
    Table table = new Table();
    Border b = new Border(Telerik.WinForms.Documents.Model.BorderStyle.Single, System.Drawing.Color.Black);
    TableBorders tb = new TableBorders(b);
    table.Borders = tb;
    sec.Blocks.Add(table);
    //first row
    TableRow tableRow = new TableRow();
    table.AddRow(tableRow);
    //cell 0,0                   
    TableCell cell = new TableCell();
    cell.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent ,20);
    tableRow.Cells.Add(cell);
    cell.Blocks.Add(para);
    Span span = new Span("Cell 0,0");
    para.Inlines.Add(span);
    //cell 0,1
    cell = new TableCell();
    cell.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent ,80);
    tableRow.Cells.Add(cell);
    //second row
    tableRow = new TableRow();
    table.AddRow(tableRow);          
    //cell 1,0                     
    cell = new TableCell();
    cell.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent ,20);
    tableRow.Cells.Add(cell);
    para = new Paragraph();
    cell.Blocks.Add(para);
    span = new Span("Cell 1,0");
    para.Inlines.Add(span);
    //cell 1,1
    cell = new TableCell();
    cell.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent ,80);
    tableRow.Cells.Add(cell);
    radRichTextEditor1.Document = document;
    
    Telerik.WinControls.UI.RadPrintDocument printDocument = new Telerik.WinControls.UI.RadPrintDocument();
    printDocument.AssociatedObject = this.radRichTextEditor1;
    printDocument.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0);
    printDocument.DefaultPageSettings.Landscape = true;
    System.Drawing.Printing.PaperSize paperSize = new System.Drawing.Printing.PaperSize();
    paperSize.RawKind = 9;
    printDocument.DefaultPageSettings.PaperSize = paperSize;
    this.radRichTextEditor1.Print(true, printDocument);
}
Attached Files:
0 comments