Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
5.00/5 (3 votes)
See more:
I am performing printing in a C# application using charts. Whenever i send a document for printing, a message pops up "Printing one of the document". I don't want this message to appear, i.e the document should get printed but that printing dialogue (or message) should not be visible. Please suggest some solution for it. I know it is a message from windows not from the C# application, but there should be some way to control it, either through windows printer settings or in my code.
Posted

1 solution

Please paste in the relevant code, so I can take a look...
 
Share this answer
 
Comments
Anuja Pawar Indore 27-Jan-12 2:40am    
Use comment block, instead of posting it as an answer
Zil-e-Huma 31-Jan-12 0:18am    
Here is the portion of code. This code is about printing a small pulse. The only thing which i am interested in is that the dialogue stating "Printing 1 of the document" should not appear


chart.Series["Series4"].Points.AddY(80);
chart.Series["Series3"].Points.AddY(65);
chart.Series["Series2"].Points.AddY(50);
chart.Series["Series1"].Points.AddY(35);


for (int i = 1; i < 47; i++)
{

chart.Series["Series4"].Points.AddY(85);
chart.Series["Series3"].Points.AddY(70);
chart.Series["Series2"].Points.AddY(55);
chart.Series["Series1"].Points.AddY(40);
}



chart.Series["Series4"].Points.AddY(80);
chart.Series["Series3"].Points.AddY(65);
chart.Series["Series2"].Points.AddY(50);
chart.Series["Series1"].Points.AddY(35);


chart.Series["Series1"].ChartType = SeriesChartType.FastLine;

chart.Printing.PrintDocument.DefaultPageSettings.Landscape = true;
chart.Printing.PrintDocument.DefaultPageSettings.Margins.Left = 0;
chart.Printing.PrintDocument.DefaultPageSettings.Margins.Top = 0;
chart.Printing.PrintDocument.DefaultPageSettings.Margins.Right = 0;
chart.Printing.PrintDocument.DefaultPageSettings.Margins.Bottom = 0;
chart.Printing.PrintDocument.PrinterSettings.PrinterName = NormalPrinter;
chart.Printing.Print(false);

chart.Series["Series1"].Points.Clear();
chart.Series["Series2"].Points.Clear();
chart.Series["Series3"].Points.Clear();
chart.Series["Series4"].Points.Clear();

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900