Print wf without it's borders
- Given the PrintDocument command on
workflowPanel.workflowView.PrintDocument; -
--- This command print WF process like a Image more than one page.
But i want to print this WF with out it borders and in a single page. Is it possible?
Give the answer with example pls.
All Replies
- Hi,
Did you get a solution for printing a workflow in one page?
I am also trying to print a workflow from the rehosted workflow designer but no success as yet.
The code is given below. The workflow never prints.WorkflowView workflowView = this.workflowDesignerControl1.WorkflowView; if (null != workflowView) { //select printer PrintDialog printDialog = new System.Windows.Forms.PrintDialog(); printDialog.AllowPrintToFile = true; printDialog.AllowCurrentPage = true; printDialog.AllowSelection = true; printDialog.AllowSomePages = true; workflowView.FitToScreenSize(); //workflowView.FitToWorkflowSize(); printDialog.Document = workflowView.PrintDocument; try { DialogResult _result = printDialog.ShowDialog(); if (_result == DialogResult.OK) { //workflowView.PrintDocument.PrinterSettings = printDialog.PrinterSettings; //workflowView.PrintDocument.Print(); printDialog.Document.PrinterSettings = printDialog.PrinterSettings; printDialog.Document.Print(); } } catch(Exception exp) { MessageBox.Show(this, exp.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); } } - HI ASP2007
Thanks for ur reply and solution. I am working now in another one project. After i'l work out with ur code i'l confirm.
Thanks and Regards,
CRT. - I am using ur code with mine it was printed successfully. I don't know wat pbm with ur code...
Try to use the following pls...
if
(ProcessTreeView.SelectedNode == null)
return;
if (ProcessTreeView.SelectedNode.Level != 1)
{
ProcessTreeView.SelectedNode.Expand();
ProcessTreeView.SelectedNode = ProcessTreeView.SelectedNode.NextVisibleNode;
return;
}
workflowPanel.Visible =
false;
workflowPanel.LoadWorkFlow(PrintWFstring);
workflowPanel.workflowView.FitToScreenSize();
workflowPanel.workflowView.AutoSize.GetType();
workflowPanel.workflowView.PrintDocument.DocumentName = strtoPrintFileName;
m_PrintDialog =
new PrintDialog();
m_PrintDialog.Document = workflowPanel.workflowView.PrintDocument;
if
(m_PrintDialog.ShowDialog() == DialogResult.OK)
{
m_PrintDialog.Document.PrinterSettings = m_PrintDialog.PrinterSettings;
m_PrintDialog.Document.Print();
//m_PrintDialog.Document.Print();
}
This is only i have used to print the WF process. Use this and reply me. surely i'l help u.
Thanks & Regards,
CRT.


