Print function drop last column

Our customer is encountering a serious problem when printing a GridDataboundGrid. Sometimes the print function doesn''t print the last column of the grid. I cannot duplicate this defect on our printer but the customer has usually been facing it. Below is the code to print a document with a title at the top of the paper and the grid under. public static void PrintGrid(GridDataBoundGrid dtgbGrid, Font titFont,string strtitle) { try { //DataGridPrintDocument dgrPrintDoc = new DataGridPrintDocument ( titleFont, title); //dgrPrintDoc.Print(); titleFont=titFont; title=strtitle; PrintDataBoundGrid(dtgbGrid); if(log.LogDebug()) log.Info("Print Grid"); } catch(Exception ex) { MessageBox.Show(ex.Message, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); if(log.LogDebug()) log.Error(ex.Message); } } public static void PrintDataBoundGrid(GridDataBoundGrid dtgbGrid/*, Font titleFont,string title*/) { // // Add method to print the Title // //PrintGrid( try { GridPrintDocument pd = new GridPrintDocument(dtgbGrid); //Assumes the default printer pd.DefaultPageSettings.Margins.Top+=50; pd.DefaultPageSettings.Margins.Left-=25; pd.DefaultPageSettings.Margins.Right-=25; pd.PrintPage+=new PrintPageEventHandler(pd_PrintPage); pd.PrintController=new StandardPrintController(); dtgbGrid.Properties.PrintHorzLines = false; dtgbGrid.Properties.PrintVertLines = false; dtgbGrid.Properties.PrintFrame=false; dtgbGrid.Properties.CenterHorizontal=false; pd.Print(); if(log.LogDebug()) log.Info("Print Data bound grid"); } catch(Exception ex) { MessageBox.Show(ex.Message, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); if(log.LogDebug()) log.Error(ex.Message); } } private static void pd_PrintPage(object sender, PrintPageEventArgs e) { if(title!="") { Pen p=new Pen(Color.Black); e.Graphics.DrawString(title,titleFont,p.Brush,e.MarginBounds.Left,e.MarginBounds.Top-50); e.PageSettings.Margins.Top+=50; title=""; } }

3 Replies

AD Administrator Syncfusion Team January 10, 2005 07:20 AM UTC

Are you using 3.0.1.0? This has a fix for in it for handles one problem like you are describing.


DB David Bosak January 10, 2005 08:03 AM UTC

I''m using 2.1.0.9. Is the defect totally fixed in 3.0.1.0? Sorry for not understanding your statement "This has a fix for in it for handles one problem like you are describing". We are getting 3.0.1.0 and try to integrate to our current code. Thanks a lot. >Are you using 3.0.1.0? This has a fix for in it for handles one problem like you are describing.


AD Administrator Syncfusion Team January 10, 2005 08:12 AM UTC

>>Is the defect totally fixed in 3.0.1.0? I don''t know what the exact defect is that you are seeing. If you can upload a sample project showing the defect (or send it to [email protected]), then I can test it with 3010 and tell you if it is fixed or not. But without testing the exact defect you are seeing, I cannot explicitly tell you that it is fixed.

Loader.
Up arrow icon