Hi everyone,
I'm trying to take print out from C#(winforms) Gridview,when I give print I'm getting empty sheet out not printing data's on the paper and not getting any error too..Can anyone tell me whats wrong with my code??
Here is my code:
namespace PrintandPrintPreview{ public partial class Form1 : Form { #region Member Variables StringFormat strFormat; //Used to format the grid rows. ArrayList arrColumnLefts = new ArrayList();//Used to save left coordinates of columns ArrayList arrColumnWidths = new ArrayList();//Used to save column widths int iCellHeight = 0; //Used to get/set the datagridview cell height int iTotalWidth = 0; // int iRow = 0;//Used as counter bool bFirstPage = true; //Used to check whether we are printing first page bool bNewPage = false;// Used to check whether we are printing a new page int iHeaderHeight = 0; //Used for the header height #endregion public Form1() { InitializeComponent(); printDocument1.PrintPage += new PrintPageEventHandler(printDocument1_PrintPage); }