我正在使用基于Web的SSRS编辑器。我已经成功开发了一种解析器,该解析器可从数据库的CATALOG表访问SSRS架构并将其转换为HTML。
用户可以从此处修改报告并提交更改,然后Parser再次接收HTML并将其转换为Desire结果。
但是,当我在ReportViewer中访问该报表时,它仍显示旧报表。
当我从报告管理URL下载报告时,它显示了我从应用程序中所做的更改。
我怀疑微软是否还会以物理格式存储RDL。
请帮忙..
终于我找到了解决方案。在我直接更新目录表中的“内容”列之前,尽管更改已在数据库中更新,但并没有反映在实际的实时报表中。
经过一番搜索,我发现了这一点。如何通过代码部署报告并完成。
class Sample {
static void Main(string[] args)
{
ReportingService2010 rs = new ReportingService2010();
rs.Url = "http://<Server Name>" +
"/_vti_bin/ReportServer/ReportService2010.asmx";
rs.Credentials =
System.Net.CredentialCache.DefaultCredentials;
Byte[] definition = null;
Warning[] warnings = null;
string name = "MyReport.rdl";
try
{
FileStream stream = File.OpenRead("MyReport.rdl");
definition = new Byte[stream.Length];
stream.Read(definition, 0, (int)stream.Length);
stream.Close();
}
catch (IOException e)
{
Console.WriteLine(e.Message);
}
try
{
string parent = "http://<Server Name>/Docs/Documents/";
CatalogItem report = rs.CreateCatalogItem("Report", name, parent,
false, definition, null, out warnings);
if (warnings != null)
{
foreach (Warning warning in warnings)
{
Console.WriteLine(warning.Message);
}
}
else
Console.WriteLine("Report: {0} created successfully " +
" with no warnings", name);
}
catch (SoapException e)
{
Console.WriteLine(e.Detail.InnerXml.ToString());
}
} }
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句