[Dxperience.8. *] The xtrareport designer can be used with xrdesignformex.

Source: Internet
Author: User
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 ();
}
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.