【Stimulsoft Reports Server教程】创建报表快照

此示例项目显示如何创建报表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

Stimulsoft

下载示例

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

Stimulsoft资源合集专题页
标签:报表报表控件StimulsoftServer

来源:慧都

声明:本站部分文章及图片转载于互联网,内容版权归原作者所有,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2019年1月11日
下一篇 2019年1月11日

相关推荐

发表回复

登录后才能评论