Here is a workaround solution to your problem, if you place the
ChartingControl inside a
Panel control on the Windows Form. You can then print the panel, inside the panel you can add the document heading as a label and whatever other stuff you want to add.
Firstly from the toolbox add a
PrintDocument control and call it
Then add a
Panel control and put your chart inside it.
Make sure you have imported the
System.Drawing namespace, then you can print the panel like this.
Bitmap MyChartPanel = new Bitmap(panel1.Width, panel1.Height);
panel1.DrawToBitmap(MyChartPanel, new Rectangle(0, 0, panel1.Width, panel1.Height));
PrintDialog MyPrintDialog = new PrintDialog();
if (MyPrintDialog.ShowDialog() == DialogResult.OK)
values = MyPrintDialog.PrinterSettings;
MyPrintDialog.Document = MyPrintDocument;
MyPrintDocument.PrintController = new System.Drawing.Printing.StandardPrintController();
This code converts the panel into a
Bitmap and then prints that
You could condense this into a function like:
public void PrintPanel(Panel MyPanel)
// Add code from above in here, changing panel1 to MyPanel...