I am writing c# code in .Net 2008 Winforms.
I created a print preview window to create a report. It works fine I can preview the report and then print it. The only problem is it is not as flexible as the Office Print preview. The users cannot chose a printer other that the default printer and they cannot limit the print to certain pages. Perhaps I am missing some prperties I need.
Here is a portion of the code I use:
PrintDocument pd = new PrintDocument();
pd.PrintPage += new PrintPageEventHandler(this.PrintTheGraph);
pd.DefaultPageSettings.Landscape = true;
// Allocate a print preview dialog object.
PrintPreviewDialog dlg = new PrintPreviewDialog();
dlg.Width = 100;
dlg.MinimumSize = new Size(375, 250);
dlg.SetBounds(100, -550, 800, 800);
dlg.Document = pd;
DialogResult result = dlg.ShowDialog();
Thanks,
Bob