Using System;
Using System. Collections. Generic;
Using System. componentmodel;
Using System. Data;
Using System. drawing;
Using System. LINQ;
Using System. text;
Using System. Windows. forms;
Using Devexpress. xtrareports. UI;
Using Devexpress. xtrareports. userdesigner;
Using System. Drawing. design;
Using System. componentmodel. design;
namespace windowsformsapplication2
{< br> Public partial class form1: form
{< br> xtrareport R;
Public form1 ()
{< br> initializecomponent ();
}
VoidDesignform_formclosing (ObjectSender, formclosingeventargs E)
{
//The operations when the designer is disabled are processed here, and data is mainly saved with custom
//R. savelayout (@ "C: \ 1. repx ");
}
Void Designform_reportstatechanged ( Object Sender, reportstateeventargs E)
{
// Set the status to save as long as the report changes.
// This avoids the appearance of the default save dialog box.
If (E. reportstate = Reportstate. Changed)
{
(Xrdesignformex) sender). designpanel. reportstate = Reportstate. Saved;
}
}
Private Void Form1_load ( Object Sender, eventargs E)
{
R = New Xtrareport ();
// R. loadlayout (@ "C: \ 1. repx ");
Xrdesignformex designform = New Xrdesignformex ();
// Hide button
Designform. designpanel. setcommandvisibility ( New reportcommand [] {
reportcommand. newreport,
reportcommand. savefileas,
reportcommand. newreportwizard,
reportcommand. openfile
}, commandvisibility. none);
//Change status
Designform. reportstatechanged+ = NewReportstateeventhandler (designform_reportstatechanged );
Designform. formclosing+ = NewFormclosingeventhandler (designform_formclosing );
//Load the report.
Designform. openreport (R );
//Open the designer
Designform. showdialog ();
Designform. Dispose ();
}
}
}