Set the printcontrolCode
Using System;
Using System. Collections. Generic;
Using System. componentmodel;
Using System. Data;
Using System. drawing;
Using System. text;
Using System. Windows. forms;
Using Devexpress. xtraeditors;
Using Devexpress. xtrareports. UI;
Using Devexpress. xtraprinting. Preview;
Using Devexpress. xtraprinting;
Using Devexpress. xtraprinting. Control;
NamespaceWindowsformsapplication1
{
Public Partial ClassXtraform2: devexpress. xtraeditors. xtraform
{
PublicXtraform2 ()
{
Initializecomponent ();
}
Private Void Xtraform2_load ( Object Sender, eventargs E)
{
Xtrareport fxtrareport = New Xtrareport ();
// Fxtrareport. loadlayout (@ "C: \ 1. repx ");
Printingsystem printingsystem1 = New Printingsystem ();
Printcontrol printcontrol1= NewPrintcontrol ();
Printcontrol1.printingsystem=Printingsystem1;
Printbarmanager = New Printbarmanager ();
Printbarmanager. Form = Printcontrol1;
Printbarmanager. initialize (printcontrol1 );
Printbarmanager. mainmenu. Visible = False ;
Printbarmanager. allowcustomization = False ;
Printingsystem1.setcommandvisibility ( New Printingsystemcommand [] {
Printingsystemcommand. Open,
Printingsystemcommand. Save,
Printingsystemcommand. closepreview,
Printingsystemcommand. Customize,
Printingsystemcommand. sendcsv,
Printingsystemcommand. sendfile,
Printingsystemcommand. sendgraphic,
Printingsystemcommand. sendmht,
Printingsystemcommand. sendpdf,
Printingsystemcommand. sendrtf,
Printingsystemcommand. sendtxt,
Printingsystemcommand. sendxls
}, Commandvisibility. None );
Fxtrareport. printingsystem=Printingsystem1;
Fxtrareport. createdocument ();
controls. add (printcontrol1);
printcontrol1.dock = dockstyle. fill;
}< BR >}