lu
2024-10-25 fe09fca3e77be09fed738a975ff9c5a508c2dd0d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using DevExpress.Office.Model;
using DevExpress.XtraEditors;
using DevExpress.XtraLayout.Customization;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Data;
using System.Windows.Controls;
 
namespace Gs.DevApp.UserControl
{
    public partial class ShowRptWizard : DevExpress.XtraEditors.XtraForm
    {
 
        private string _rptParameter;
        public ShowRptWizard(string rptParameter)
        {
            _rptParameter = rptParameter;
            InitializeComponent();
            wizardControl1.NextClick += WizardControl1_NextClick;
            wizardControl1.FinishClick += WizardControl1_FinishClick;
        }
 
        private void WizardControl1_FinishClick(object sender, System.ComponentModel.CancelEventArgs e)
        {
            var _obj = new
            {
                rptParameter = this._rptParameter,
                // rptData = null,初始时不用设计模板
            };
            try
            {
                string strJson = UtilityHelper.HttpPost("", "Report/EdtTemplate", JsonConvert.SerializeObject(_obj));
                ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                if (_rtn.rtnCode > 0)
                {
                    Gs.DevApp.DevFrm.Sys.EasyRptDesign frm = new Gs.DevApp.DevFrm.Sys.EasyRptDesign(this._rptParameter);
                    frm.Show();
                }
                else
                {
                    ToolBox.MsgHelper.ShowError("提示:" + _rtn.rtnData["outMsg"].ToString());
                }
            }
            catch (Exception ex)
            {
                ToolBox.MsgHelper.ShowError("提示:" + ex.Message.ToString());
            }
        }
 
        private void WizardControl1_NextClick(object sender, DevExpress.XtraWizard.WizardCommandButtonClickEventArgs e)
        {
            if (this.wizardControl1.SelectedPage == this.welcomeWizardPage1)
            {
                this.lbParameter.Text = "该报表使用了如下参数:" + _rptParameter;
                return;
            }
        }
 
    }
}