csharp Reporting Services示例

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp Reporting Services示例相关的知识,希望对你有一定的参考价值。

###Todos los ejemplos parten de añadir las siguientes referencias a los servicios de Reporting Services:

- http://<reportserverurl>/ReportServer/ReportService2010.asmx
- http://<reportserverurl>/ReportServer/ReportExecution2005.asmx
using (var rs = new ReportingService2010())
{
    rs.Url = reportingURL;
    rs.Credentials = new NetworkCredential(reportingUsuario, reportingPassword, reportingDominio);
    
    return rs.ListItemHistory("/ruta/informe");
}

using (var rs = new ReportingService2010())
{
    rs.Url = reportingURL;
    rs.Credentials = new NetworkCredential("usuario", "password", "reportingDominio");

    CatalogItem[] items = rs.ListChildren("ruta", true);

    return items.Where(x => x.TypeName == ItemTypeEnum.Report.ToString()).ToList();
}
using (var rs = new ReportExecutionService.ReportExecutionService())
{
  string extension = null;
  string encoding = null;
  string mimeType = null;
  string[] streamIDs = null;
  Warning[] warnings = null;
  
  rs.Url = "http://<reportserverurl>/ReportServer/ReportExecution2005.asmx";
  rs.Credentials = new NetworkCredential("usuario", "contraseña", "dominio");
  
  string historyId = null;
  ExecutionHeader execHeader = new ExecutionHeader();
  
  rs.Timeout = 300000;
  rs.ExecutionHeaderValue = execHeader;
  ExecutionInfo2 execInfo2 = rs.LoadReport2(reportPath, historyId);
  
  if ((parameters != null))
  {
      rs.SetExecutionParameters(parameters, "es_es");
  }
  
  string deviceInfo = @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";
  
  return rs.Render2("PDF", deviceInfo, PageCountMode.Actual, out extension, out encoding, out mimeType, out warnings, out streamIDs);
}

以上是关于csharp Reporting Services示例的主要内容,如果未能解决你的问题,请参考以下文章

Reporting Services报表常用的URL参数

Reporting Services 配置工具

Reporting Services 身份验证问题

Reporting Services 中的复杂图表?

双轴图 - Reporting Services 2005

Reporting Services 中的 PDF 导出问题