我调用这个 rs.exe 脚本来运行和导出报告:
rs -i RunReport.rss -s http://localhost/reportserver -u myUsername -p myPassword -e Exec2005
我得到的错误是:
Could not connect to server: http://localhost/reportserver/ReportService2005.asmx
目前,我们所有的报告都设置为使用“用户提供的凭据”。如果我去报告并输入用户名和密码,它运行得很好。它只是无法运行脚本。
当我将报告的数据源更改为使用 Windows 集成安全性时,该脚本可以正常工作。
关于我做错了什么的任何想法?或者,有没有办法将报告的权限更改为 Windows Auth,然后再改回来?
SSRS 2012
我的 rss 脚本是
Public Sub Main()
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim format as string = "EXCEL"
Dim fileName as String = "C:\test.xls"
Dim reportPath as String = "/MyDirectory/Report1"
' Prepare Render arguments
Dim historyID as string = Nothing
Dim deviceInfo as string = Nothing
Dim extension as string = Nothing
Dim encoding as string
Dim mimeType as string
Dim warnings() AS Warning = Nothing
Dim streamIDs() as string = Nothing
Dim results() as Byte
rs.LoadReport(reportPath, historyID)
results = rs.Render(format, deviceInfo, extension, _
mimeType, encoding, warnings, streamIDs)
' Open a file stream and write out the report
Dim stream As FileStream = File.OpenWrite(fileName)
stream.Write(results, 0, results.Length)
stream.Close()
End Sub