lu
2024-10-23 1b619ce266db21c544c29dfb15bb05d4d1289c78
DevApp/Gs.DevApp/DevFrm/Rpt/RptPreview.cs
@@ -1,28 +1,8 @@

using DevExpress.XtraEditors;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraBars.Navigation;
using DevExpress.XtraTab;
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;
using Gs.DevApp.ToolBox;
using Newtonsoft.Json;
using Gs.DevApp.Entity;
using Newtonsoft.Json.Linq;
using System.IO;
@@ -30,41 +10,42 @@
{
    public partial class RptPreview : DevExpress.XtraEditors.XtraForm
    {
        private string _reportType;
        public RptPreview(string reportType)
        private string _rptService;
        public RptPreview(string rptService)
        {
            _reportType = reportType;
            _rptService = rptService;
            InitializeComponent();
            getPageList();
            this.Text = _rptService + "报表查看:";
            getRptData();
        }
        /// <summary>
        /// 读取报表数据列表
        /// </summary>
        private void getPageList()
        private void getRptData()
        {
            var _obj = new
            {
                reportType = _reportType,
                sortName = "a.userName",
                reportType = this._rptService,
                sortName = "a.userName asc,a.roleName asc,menuActionPath ",
                sortOrder = "asc",
                keyWhere = ""
            };
            try
            {
                string strJson = UtilityHelper.HttpPost("", "Report/GetReportList", JsonConvert.SerializeObject(_obj));
                string strJson = UtilityHelper.HttpPost("", "Report/" + _rptService, JsonConvert.SerializeObject(_obj));
                JObject _job = JObject.Parse(strJson);
                string rtnCode = _job["rtnCode"].ToString();
                if (int.Parse(rtnCode) > 0)
                {
                    JArray array = new JArray();
                    foreach (var a in _job["rtnData"]["list"])
                    foreach (var a in _job["rtnData"]["listM1"])
                    {
                        array.Add(a);
                    }
                    DataTable dt = JsonConvert.DeserializeObject<DataTable>(array.ToString());
                    DataSet ds = new DataSet();
                    dt.TableName = "Table1";
                    dt.TableName = "Table2";
                    ds.Tables.Add(dt);
                    FastReport.Report report = new FastReport.Report();
                    byte[] buffer = (byte[])_job["rtnData"]["reportData"];
@@ -77,6 +58,10 @@
                    report.Prepare();
                    report.ShowPrepared();
                }
                else
                {
                    ToolBox.MsgHelper.Warning("提示:" + _job["rtnMsg"].ToString());
                }
            }
            catch (Exception ex)
            {