本文介绍了以编程方式将 XML 文件上传到 SSRS 服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何以编程方式将 XSLT 文件上传到 SSRS 服务器数据库?我想要与上传文件"完全相同的功能,最好使用rs"命令.

How do I programmatically upload an XSLT file to an SSRS server database?I would like exactly the same functionality as the 'Upload File', preferably using the 'rs' command.

我尝试过 rs.CreateResource,但它似乎不适用于 XML/XSLT 文件(尽管它适用于 Excel 和图像文件)

I have tried rs.CreateResource, but it doesn't seem to work for XML/XSLT files (though it works for Excel and image files)

我了解不支持操作 SSRS 数据库.

I understand that manipulating the SSRS db is not supported.

推荐答案

终于发现问题了.上传的 XSLT 文件在文件末尾带有一个尾随空字节.必须使用十六进制查看器才能看到这一点.

Finally found the problem.The XSLT file was getting uploaded with a trailing null byte at the end of file. Had to use a Hex viewer to see this.

为了修复它,我将数组复制到另一个数组中,减去最后一个字符,现在一切正常.

To fix it I copied the array into another array, minus the last character and it's all good now.

Dim Temp() As Byte = New Byte(ArrayLength-1) {}
For i As Integer = 0 To ArrayLength-1
  Temp(i)=Contents(i)
Next
rs.CreateResource(XSLTFileName, ReportFolder, True, Temp, "application/xml", Nothing)

这篇关于以编程方式将 XML 文件上传到 SSRS 服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 18:16
查看更多