We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Printing problems

This is a follow up post for some printing problems we discussed in your previous version. We have now upgraded to version 3.3, however, printing still seems dicy, or maybe we are doing something wrong. Here goes: 1. How do I make all the columns to fit in single page. ColWidths.ResizetoFit is not working. 2. If I have a row with text that spans over multiple pages, RowHeight.Resizetofit seems to do 2 things: a. If the text does not fit in the reamining height of the page, it is starting that row in a new page. As intended? b. If the text spans over multiple rows it only prints first page, the followup pages are empty. I know this was a bug in your prev version, Did u fix this in 3.3?

5 Replies

AD Administrator Syncfusion Team December 7, 2005 11:41 PM UTC

1) If you want the grid to fill the page when you print, then you will need to set the colwidths such that this happens. ColWidths.ResizeToFit does not set colwidths to fill a page. It sets the colwidths to hold the text. One way you can do this is to handle the QueryColWidth event and there set the widths there to fill the page when you are printing. Here is a little sample. http://www.syncfusion.com/Support/user/uploads/GC_CoveredCells_c30bb95e.zip 2) I am not sure I understand what you are saying. Are you saying you have one single cell whose height will cover more than 2 printed pages? Can you upload a sample project showing the problem you have?


AD Administrator Syncfusion Team December 8, 2005 12:17 AM UTC

>2) Are you saying you have one single cell whose height will cover more than 2 printed pages? Yes. I am attaching bmp (preview window) and txt (actual cellvalue of col3) files with shows the problem. Notice that page 4 is coming up blank instead of continuing where pages left off.

1.zip


AD Administrator Syncfusion Team December 8, 2005 02:03 AM UTC

I put this code in the saample I attached earlier. private void Form1_Load(object sender, System.EventArgs e) { this.gridControl1.ColCount = 4; this.gridControl1.RowCount = 201; this.gridControl1.VScrollPixel = true; this.gridControl1.QueryColWidth += new GridRowColSizeEventHandler(gridControl1_QueryColWidth); string s = ""; for(int i = 0; i <= 200; ++i) { gridControl1[i + 1, 1].Text = string.Format("a:{0}", i + 1); s += string.Format("line {0}", i) + Environment.NewLine; } gridControl1[70, 2].Text = s; this.gridControl1.RowHeights.ResizeToFit(GridRangeInfo.Cell(70, 2)); } Here is what I see with this code using version 4.1. There are no blank pages. Page 2 stops short at row 69. Page 3 starts at the top of row 70 and displays as much of the text in row 70 as will fit on a single printed page. Then Page 4 starts with row 71. So, with version 4.1, the large text cell is started on a new page and is limited to what can be seen on that page, and following this new page, the next cell is printed.


AD Administrator Syncfusion Team December 8, 2005 02:13 AM UTC

>Here is what I see with this code using version 4.1. There are no blank pages. Page 2 stops short at row 69. Page 3 starts at the top of row 70 and displays as much of the text in row 70 as will fit on a single printed page. Then Page 4 starts with row 71. So, with version 4.1, the large text cell is started on a new page and is limited to what can be seen on that page, and following this new page, the next cell is printed. Yup. Thats the bug. It should carry over from row 70 to page 4, instead of starting with row 71. We reported this is your prev version.


AD Administrator Syncfusion Team December 8, 2005 12:14 PM UTC

If you want to display more text than will fit on a single printed page, then I think you will need to use multiple cells (covered cells) to hold this text instead of a single cell. Here is a little sample that uses a covered cell range to printpreview a grid with a cell holding 200 lines of text without losing any lines. http://www.syncfusion.com/Support/user/uploads/GC_CoveredCells_a330f1e3.zip

Loader.
Live Chat Icon For mobile
Up arrow icon