开发者

How to create a shared DataSet programmatically in Report Server 2008 using Report Server Web Service?

I would like to know how to crea开发者_运维问答te a shared DataSet programmatically in Report Server using the report server web service?

I can create folders (using CreateFolder method), reports (CreateReport), data sources, but the web service doesn't have a method to create a DataSet.

example creating a report:

ReportingService2005 rs = new ReportingService2005();
rs.Credentials  = System.Net.CredentialCache.DefaultCredentials;

FileStream fileStream = File.OpenRead(Path.Combine(folderPath, fileInfo.Name));
byte[] bytes = new byte[fileStream.Length];
int x = fileStream.Read(bytes, 0, bytes.Length);

string reportName = Path.GetFileNameWithoutExtension(fileInfo.Name);
rs.CreateReport(reportName, "/reports", true, bytes, null);

thanks in advance fc


I've found the problem.

The problem was that I was using the 2005 wsdl specification. We should use the 2010 spec, wich allows to create datasets using CreateCatalogItem.

http://localhost/ReportServer_XXX/reportservice2010.asmx?wsdl

ReportingService2010 rs = new ReportingService2010(); ... rs.CreateCatalogItem("DataSet", reportName, "/DataSets", true, bytes, null, out warnings);

reference: ReportingService2010 Methods

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜