From a9c9f13461dbe9ab88677d94f9033db30a6558b0 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期三, 23 十月 2024 16:40:09 +0800
Subject: [PATCH] 增加了一个测试窗体
---
DevApp/Gs.DevApp/DevFrm/Rpt/RptPreview.cs | 45 +++++++++++++++------------------------------
1 files changed, 15 insertions(+), 30 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Rpt/RptPreview.cs b/DevApp/Gs.DevApp/DevFrm/Rpt/RptPreview.cs
index e9e66fc..80d9096 100644
--- a/DevApp/Gs.DevApp/DevFrm/Rpt/RptPreview.cs
+++ b/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/GetUserRoleReport", 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)
{
--
Gitblit v1.9.3