Header Ads Widget

Responsive Advertisement

Print DataGridView Data with Header and Footer in C# Window Form with Source Code


Source Code Helpful?

That's project is helpful for those students that's wants to develop / create your on project in C# window form that has totally professional level development criteria.
That's source code has following control functions:

  • Who use DGVPrinter.cs Class?
  • Print DataGridView with Header and Footer

=> Copy DGVPrinter.cs file and add into solution


Download File Click Here


Source Code:

--Create Button Click Event 

        private void btnPrnt_Click(object sender, EventArgs e)
        {
            try
            {
                DGVPrinter print = new DGVPrinter();
                print.Title = "Product Detail Report";
                print.SubTitle = "Print Date: " + DateTime.Now.ToShortDateString();
                print.SubTitleFormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.NoClip;
                print.PageNumbers = true;
                print.PageNumberInHeader = false;
                print.PorportionalColumns = true;
                print.HeaderCellAlignment = StringAlignment.Near;
                print.Footer = "ULearn Tutorials on YouTube";
                print.FooterSpacing = 15;
                print.PrintDataGridView(dataGridView1);
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }


At YouTube Live Video:





Use Mobile Phone and Scan for direct access to link on mobile phone.



Post a Comment

1 Comments