Ask a questionAsk a question
 

General DiscussionPrint wf without it's borders

  • Thursday, July 02, 2009 4:56 AMRajanCRT Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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

  • Wednesday, July 15, 2009 6:14 PMAps2007 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    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);
                    }
                }



  • Friday, August 28, 2009 1:46 PMRajanCRT Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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.
  • Friday, November 06, 2009 12:32 PMRajanCRT Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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.