Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过WebClient byte[]或其他方式在Silverlight应用程序中安全地呈现SSRS报告_Silverlight_Reporting Services_Webclient - Fatal编程技术网

通过WebClient byte[]或其他方式在Silverlight应用程序中安全地呈现SSRS报告

通过WebClient byte[]或其他方式在Silverlight应用程序中安全地呈现SSRS报告,silverlight,reporting-services,webclient,Silverlight,Reporting Services,Webclient,我正在尝试在Silverlight 5应用程序中实现SSRS报告功能,该应用程序在浏览器模式下运行 尝试1) 最初的计划是在Silverlight客户端上使用URL技术呈现页面 var path = item.Path; // Where item.Path is something like '/MyReportFolder/Report1' var url= @"http://<MyServerAddress>/ReportServer/Pages/ReportViewer.as

我正在尝试在Silverlight 5应用程序中实现SSRS报告功能,该应用程序在浏览器模式下运行

尝试1) 最初的计划是在Silverlight客户端上使用URL技术呈现页面

var path = item.Path; // Where item.Path is something like '/MyReportFolder/Report1'
var url= @"http://<MyServerAddress>/ReportServer/Pages/ReportViewer.aspx?{0}&rs:Command=Render";
var completeUrl = string.Format(url, path.Replace(@"/", "%2f").Replace(" ", "+"));
System.Windows.Browser.HtmlPage.Window.Navigate(new Uri(completeUrl), "_newWindow", "toolbar=0,menubar=0,resizeable=1,scrollbars=1");
var path=item.path;//其中item.Path类似于“/MyReportFolder/Report1”
var url=@”http:///ReportServer/Pages/ReportViewer.aspx?{0}&rs:Command=Render”;
var completeUrl=string.Format(url,path.Replace(@“/”,“%2f”).Replace(“,”+”);
System.Windows.Browser.HtmlPage.Window.Navigate(新Uri(completeUrl),“\u newWindow”,“工具栏=0,菜单栏=0,可调整大小=1,滚动条=1”);
这里的问题是调用此URL的权限将很难管理,并且与Silverlight应用程序运行时的基本安全性无关

尝试2) 通过WebClient中类似的Url调用在IIS服务器上(而不是在客户端上,通过WCF调用代表用户)呈现报告,并下载字节[]输出,然后将字节[]发送到Silverlight客户端(作为对WCF调用的响应),然后在Silverlight应用程序中呈现内容

var path = itemPath;
var url = @"http://<MyServerAddress>/ReportServer/Pages/ReportViewer.aspx?{0}&rs:Command=Render";
var completeUrl = string.Format(url, path.Replace(@"/", "%2f").Replace(" ", "+"));

var tcs = new TaskCompletionSource<byte[]>();
var webClient = new WebClient();

webClient.DownloadDataCompleted += (sender, args) => tcs.TrySetResult(args.Error != null ? args.Result : new byte[0]);
webClient.DownloadDataAsync( new Uri(completeUrl));
return tcs.Task;
var path=itemPath;
var url=@”http:///ReportServer/Pages/ReportViewer.aspx?{0}&rs:Command=Render”;
var completeUrl=string.Format(url,path.Replace(@“/”,“%2f”).Replace(“,”+”);
var tcs=new TaskCompletionSource();
var webClient=新的webClient();
webClient.DownloadDataCompleted+=(发送方,args)=>tcs.TrySetResult(args.Error!=null?args.Result:新字节[0]);
DownloadDataAsync(新Uri(completeUrl));
返回tcs.Task;
还可以很好地将报告呈现为字节[],并且可以通过WCF服务操作调用轻松处理安全性。但是,一旦客户端接收到字节[],我就不知道如何在屏幕上显示结果。我的首选方法是打开一个新的浏览器窗口并将内容呈现到其中,但是System.Windows.browser.HtmlPage.window不支持此操作

因此,我的选择是:

  • 将IIS服务器上的结果呈现为临时文件,并将URL(而不是字节[])发送到Silverlight客户端,以便浏览器客户端可以打开结果。这是一个糟糕的结果,因为结果与尝试1非常相似,因为Url随后可供第三方接收方使用
  • 将报告呈现为TIFF字节[],但是我不确定这是否会处理多页报告,并且它可能不支持PDF和XLS报告内容,因为TIFF需要显示在Silverlight图像控件中,而不是浏览器中
  • 还有一些我还没考虑过的奇妙的选择… 是否有其他人尝试在Silverlight应用程序中使用企业SSRS功能并找到了类似问题的解决方案?

    有一个组件(我需要确认的是我们的组件),它使用基于本机XAML的查看器在Silverlight应用程序中无缝集成SSRS报告。所以我们显然找到了解决办法