How to display the design form of xtrareport in developer Express
The xtrareport designer can actually use xrdesignformex.
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 wfaxtrareport {public partial class form1: FORM {xtrareport R; // This can be the template public form1 () {initializecomponent ();} private void designform_formclosing (Object sender, formclosingeventargs e) {// processing the operation when the designer is disabled here, mainly using Custom Data Storage // R. savelayout (@ "C: \ 1. repx ");} private void designform_reportstatechanged (Object sender, reportstateeventargs E) {// set the status to save as long as the report changes. // avoid 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 the button designform. designpanel. setcommandvisibility (New reportcommand [] {reportcommand. newreport, reportcommand. savefileas, reportcommand. newreportwizard, reportcommand. openfile}, commandvisibility. none); // change the status of designform. reportstatechanged + = new reportstateeventhandler (designform_reportstatechanged); designform. formclosing + = new formclosingeventhandler (designform_formclosing); // load the report. designform. openreport (r); // open the designer designform. showdialog (); designform. dispose ();}}}In this way, we can control what to control when loading and destroying the design form. You can reload the data in it. For example, the design form display is a little slow. We load a wait form at the beginning and close it after it is displayed.
The xtrareport designer can actually use xrdesignformex.
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 wfaxtrareport {public partial class form1: FORM {xtrareport R; // This can be the template public form1 () {initializecomponent ();} private void designform_formclosing (Object sender, formclosingeventargs e) {// processing the operation when the designer is disabled here, mainly using Custom Data Storage // R. savelayout (@ "C: \ 1. repx ");} private void designform_reportstatechanged (Object sender, reportstateeventargs E) {// set the status to save as long as the report changes. // avoid 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 the button designform. designpanel. setcommandvisibility (New reportcommand [] {reportcommand. newreport, reportcommand. savefileas, reportcommand. newreportwizard, reportcommand. openfile}, commandvisibility. none); // change the status of designform. reportstatechanged + = new reportstateeventhandler (designform_reportstatechanged); designform. formclosing + = new formclosingeventhandler (designform_formclosing); // load the report. designform. openreport (r); // open the designer designform. showdialog (); designform. dispose ();}}} in this way, we can control what to load and destroy the design form. You can reload the data in the design form. For example, the design form display is a little slow. We load a wait form at the beginning and close the form after it is displayed.