private void button1_Click(object sender, EventArgs e)
        {
            XtraReport   report = new XtraReport();
            XRDesignForm form   = new XRDesignForm();

            form.DesignMdiController.AddService(typeof(IMenuCreationService),
                                                new CustomMenuCreationService(form.DesignMdiController));
            form.OpenReport(report);
            form.ShowDialog();
        }
Exemple #2
0
        private void buttonReportDesignerRuntime_Click(object sender, EventArgs e)
        {
            var xr = new XRDesignForm();
            var b  = new XtraReportTabular();
            var v  = new ReportLayout("XtraReportTabular.repx");

            if (v.HasLayout)
            {
                b.LoadLayout(v.LayoutPath);
            }
            xr.OpenReport(b);
            xr.Show(this);
        }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            // Create a new Design form.
            XRDesignForm designForm = new XRDesignForm();

            // Obtain the Field List and bring it to front.
            designForm.DesignDockManager[DesignDockPanelType.FieldList].Show();

            // Create a new blank report.
            designForm.OpenReport(new XtraReport1());

            // Show the Design form.
            designForm.ShowDialog();
        }
Exemple #4
0
        private void Form1_Load(object sender, EventArgs e)
        {
            // Create an End-User Designer form.
            XRDesignForm designForm = new XRDesignForm();

            // Handle the DesignPanelLoaded event.
            designForm.DesignMdiController.DesignPanelLoaded +=
                DesignMdiController_DesignPanelLoaded;
            // Load a report into the Designer.
            designForm.OpenReport(new XtraReport1());

            // Show the End-User Designer form, modally.
            designForm.ShowDialog();
        }
Exemple #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            // Create a new End-User Designer.
            XRDesignForm designForm = new XRDesignForm();

            // Handle the DesignPanelLoaded event.
            designForm.DesignMdiController.DesignPanelLoaded +=
                new DesignerLoadedEventHandler(DesignMdiController_DesignPanelLoaded);

            // Load the report into the designer.
            designForm.OpenReport(new XtraReport1());

            // Show the End-User Designer window.
            designForm.Show();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            // Create an End-User Designer form.
            XRDesignForm designForm = new XRDesignForm();

            // Open a new blank report in it.
            designForm.OpenReport(new XtraReport1());

            // Access the Group and Sort panel.
            GroupAndSortDockPanel groupSort =
                (GroupAndSortDockPanel)designForm.DesignDockManager[DesignDockPanelType.GroupAndSort];

            groupSort.Visibility = DockVisibility.AutoHide;

            // Access the Script Errors panel.
            ErrorListDockPanel errorList =
                (ErrorListDockPanel)designForm.DesignDockManager[DesignDockPanelType.ErrorList];

            errorList.Visibility = DockVisibility.AutoHide;

            // Access the Field List.
            FieldListDockPanel fieldList =
                (FieldListDockPanel)designForm.DesignDockManager[DesignDockPanelType.FieldList];

            fieldList.ShowNodeToolTips   = false;
            fieldList.ShowParametersNode = false;

            // Access the Report Explorer.
            ReportExplorerDockPanel reportExplorer =
                (ReportExplorerDockPanel)designForm.DesignDockManager[DesignDockPanelType.ReportExplorer];

            reportExplorer.CollapseAll();

            // Access the Property Grid.
            PropertyGridDockPanel propertyGrid =
                (PropertyGridDockPanel)designForm.DesignDockManager[DesignDockPanelType.PropertyGrid];

            propertyGrid.ShowCategories  = false;
            propertyGrid.ShowDescription = false;

            // Show the End-User Designer form.
            designForm.ShowDialog();
        }
        private void buttonDesign_Click(object sender, EventArgs e)
        {
            // Open a selected report in the report designer.
            XRDesignForm form = new XRDesignForm();
            string       url  = GetSelectedUrl();

            if (!string.IsNullOrEmpty(url))
            {
                form.OpenReport(url);
            }
            form.ShowDialog(this);

            object selectedItem = listBox1.SelectedItem;

            FillListBox();
            if (selectedItem != null && listBox1.Items.Contains(selectedItem))
            {
                listBox1.SelectedItem = selectedItem;
            }
        }
Exemple #8
0
        public void DesignReport()
        {
            try
            {
                if (gridView1.FocusedRowHandle < 0)
                {
                    return;
                }
                this.Cursor = Cursors.WaitCursor;
                string rptName = gridView1.GetFocusedRowCellValue("Report_Name").ToStringEx();
                string rptId   = gridView1.GetFocusedRowCellValue("Report_Id").ToStringEx();
                var    list    = new List <MyParameter>();
                list.Add("cReport_Id", DbType.String, rptId, null);
                object obj = BaseService.Get("SystemReport_Data", list);

                string    wk = gridView1.GetFocusedRowCellValue("Report_WorkSet").ToStringEx();
                DataTable dt = new DataTable();

                if (!string.IsNullOrEmpty(wk))
                {
                    var mps = InitializeBind(wk);
                    dt = BaseService.Open(wk, mps);
                }
                dt.TableName = "DataSource";
                string       rptFile    = Guid.NewGuid().ToString();
                XRDesignForm designForm = new XRDesignForm();
                XtraReport   xtraReport = new XtraReport();
                xtraReport.Name = rptName;
                if (obj != DBNull.Value)
                {
                    byte[] bs = (byte[])obj;
                    File.WriteAllBytes(rptFile, bs);
                    xtraReport.LoadLayout(bs.ToStream());
                }
                //xtraReport.RequestParameters = false;
                xtraReport.DataSource = dt;
                //xtraReport.Parameters.Clear();
                //xtraReport.Parameters.AddRange(ps.ToArray());
                designForm.OpenReport(xtraReport);
                designForm.Shown += delegate
                {
                    if (designForm.ActiveDesignPanel != null)
                    {
                        designForm.ActiveDesignPanel.Text     = rptName;
                        designForm.ActiveDesignPanel.FileName = rptFile;
                    }
                };
                designForm.FormClosing += delegate
                {
                    MemoryStream ms = new MemoryStream();
                    designForm.ActiveDesignPanel.Report.SaveLayout(ms);
                    list.Add("Report_Bytes", DbType.Binary, ms.ToBytes(), null);
                    BaseService.Execute("SystemReport_Data", list, "U");
                    //gridView1.SetFocusedRowCellValue("Report_Bytes", ms.ToBytes());
                    File.Delete(rptFile);
                };
                designForm.Show();
            }
            catch (Exception ex)
            {
                SharedFunc.RaiseError(ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }