此示例项目显示如何创建 表shapshot项目。为此,您可以使用reportsnapshots REST命令。作为参数,您需要指定命令缩进, 表快照名称和 表shapshot说明。这些参数可以作为请求发布数据传递。
下载Stimulsoft Reports Flex最新版本
此示例项目显示如何创建 表shapshot项目。为此,您可以使用reportsnapshots REST命令。作为参数,您需要指定命令缩进, 表快照名称和 表shapshot说明。这些参数可以作为请求发布数据传递。
#region Create Snapshoturl = "http://localhost:40010/1/reportsnapshots";var requestCreateSnapshot = WebRequest.Create(url);requestCreateSnapshot.Method = "POST";requestCreateSnapshot.ContentType = "application/x-www-form-urlencoded";requestCreateSnapshot.Headers.Add("x-sti-SessionKey", sessionKey); postData = "{'Ident': 'ReportSnapshotItem', 'Name': 'ReportSnapshot01', 'Description': ''}";Request(requestCreateSnapshot, postData);// Check Resultvar s = GetResponseResult(requestCreateSnapshot);json = JObject.Parse(s);var items = ((JArray)json["Items"]);#endregion
您可以使用以下方法向服务器发送请求并获取请求的结果。
private void Request(WebRequest request, string postData){ var bytesCreateSnapshot = Encoding.GetEncoding(1251).GetBytes(postData); request.ContentLength = bytesCreateSnapshot.Length; using (Stream ws = request.GetRequestStream()) { ws.Write(bytesCreateSnapshot, 0, bytesCreateSnapshot.Length); ws.Flush(); }} private string GetResponseResult(WebRequest request){ var resp = request.GetResponse(); var respStream = resp.GetResponseStream(); if (respStream != null) { using (var stream1 = new StreamReader(respStream)) { var s = stream1.ReadToEnd(); return s; } } return null;}
下面的屏幕截图中,您可以看到示例代码的结果。


下载示例
购买Stimulsoft正版授权,请点击“咨询在线客服”哟!

标签: 表 表控件StimulsoftServer
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!