SSR使用JAVA和SOAP Web服务呈现报告

SSR使用JAVA和SOAP Web服务呈现报告,java,web-services,sql-server-2008,soap,reporting-services,Java,Web Services,Sql Server 2008,Soap,Reporting Services,我正在使用SQL Server开发一个Java Web应用程序和一个报告服务器,我想知道是否可以使用SOAP Web服务将来自SSR的报告呈现给我的Java应用程序 我正在使用获取有关我的SSR的信息,如文件夹名称、报告名称等。。。但我无法呈现我的报告,也无法以PDF或其他扩展名上传报告 有什么建议吗 谢谢 编辑 我使用了上面提到的SSRS api()的下载函数(downloadReport),下面是该函数的代码: public void downloadReport(final String

我正在使用SQL Server开发一个Java Web应用程序和一个报告服务器,我想知道是否可以使用SOAP Web服务将来自SSR的报告呈现给我的Java应用程序

我正在使用获取有关我的SSR的信息,如文件夹名称、报告名称等。。。但我无法呈现我的报告,也无法以PDF或其他扩展名上传报告

有什么建议吗

谢谢

编辑

我使用了上面提到的SSRS api()的下载函数(downloadReport),下面是该函数的代码:

public void downloadReport(final String path, final String filename) {
    final File file = new File(filename);
    final String physicalName = toPhysicalFileName(path);

    info("Downloading Report with symbolic name " + path + " to " + file);

    final byte[] data = _soap.getReportDefinition(physicalName);

    try (final FileOutputStream out = new FileOutputStream(file)) {
        out.write(data);
    } catch (final IOException ioe) {
        final String message = "Failed to download report with symbolic name " + path + " to " + file;
        LOG.warning(message);
        if (file.exists() && !file.delete()) {
            throw new IllegalStateException(message + " and failed to delete temporary file", ioe);
        } else {
            throw new IllegalStateException(message, ioe);

        }
    }
}
public void downloadReport() {
    ssrs.downloadReport('Path/Report name', 'C:\\PATH\\TO\\A\\FOLDER\\REPORT.XML');
}
这是我用来调用这个函数的函数:

public void downloadReport(final String path, final String filename) {
    final File file = new File(filename);
    final String physicalName = toPhysicalFileName(path);

    info("Downloading Report with symbolic name " + path + " to " + file);

    final byte[] data = _soap.getReportDefinition(physicalName);

    try (final FileOutputStream out = new FileOutputStream(file)) {
        out.write(data);
    } catch (final IOException ioe) {
        final String message = "Failed to download report with symbolic name " + path + " to " + file;
        LOG.warning(message);
        if (file.exists() && !file.delete()) {
            throw new IllegalStateException(message + " and failed to delete temporary file", ioe);
        } else {
            throw new IllegalStateException(message, ioe);

        }
    }
}
public void downloadReport() {
    ssrs.downloadReport('Path/Report name', 'C:\\PATH\\TO\\A\\FOLDER\\REPORT.XML');
}
在给定的路径(C:/path/TO/A/FOLDER/REPORT.XML)中,我得到如下XML文件:

<?xml version="1.0" encoding="utf-8"?>
<Report xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner" xmlns:cl="http://schemas.microsoft.com/sqlserver/reporting/2010/01/componentdefinition" xmlns="http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition">
  <AutoRefresh>0</AutoRefresh>
  <DataSources>
    <DataSource Name="PercallAnalysisDW">
      <DataSourceReference>Entrepôt de données Percall Analysis</DataSourceReference>
      <rd:SecurityType>None</rd:SecurityType>
      <rd:DataSourceID>3a3e3aa4-c6d6-4b44-80f0-f18a9ecd2eac</rd:DataSourceID>
    </DataSource>
  </DataSources>
  <DataSets>
    <DataSet Name="DeliveryMarginCumuleDS">
      <SharedDataSet>
        <SharedDataSetReference>DeliveryMarginCumuleDS</SharedDataSetReference>
      </SharedDataSet>
      <Fields>
        <Field Name="Date">
          <DataField>Date</DataField>
          <rd:TypeName>System.String</rd:TypeName>
        </Field>
        <Field Name="Projet">
          <DataField>Projet</DataField>
          <rd:TypeName>System.String</rd:TypeName>
        </Field>
        <Field Name="LABOR_facturé">
          <DataField>LABOR_facturé</DataField>
          <rd:TypeName>System.Int32</rd:TypeName>
        </Field>
        <Field Name="TL_facturé">
          <DataField>TL_facturé</DataField>
          <rd:TypeName>System.Int32</rd:TypeName>
        </Field>
        <Field Name="Coût_total">
          <DataField>Coût_total</DataField>
          <rd:TypeName>System.Int32</rd:TypeName>
        </Field>
        <Field Name="DM">
          <DataField>DM</DataField>
          <rd:TypeName>System.Int32</rd:TypeName>
        </Field>
        <Field Name="Revenu">
          <Value>=Fields!LABOR_facturé.Value + Fields!TL_facturé.Value</Value>
        </Field>
      </Fields>
    </DataSet>
  </DataSets>
  <ReportSections>
    <ReportSection>
      <Body>
        <ReportItems>
          <Tablix Name="Tablix1">
            <TablixBody>
                ...

0
珀卡尔分析中心
没有一个
3a3e3aa4-c6d6-4b44-80f0-f18a9ecd2eac
交货期
日期
系统字符串
Projet
系统字符串
劳动工厂
System.Int32
工厂
System.Int32
总共
System.Int32
DM
System.Int32
=字段!人工制造。价值+字段!生产价值
...
这里有一篇来自的文章,但请注意这是2005年的: . 下面是一个在黑板上类似问题的答案:

但是,报表查看器控件仅在.Net中受支持 因此,不太可能将报告与java集成 基于前端,无需启动新的浏览器页面。我的 建议使用URL访问Web应用程序中的报告。 但是,如果执行此操作,报告将在新浏览器中打开 页面。“


我通过使用URL生成报告解决了这个问题,下面是允许我生成报告的函数:

public void downloadReportExcel(String path) {
    try {
        String url = "http://" + SSRS_IP + "/ReportServer?/" + path + "&rs:Format=Excel";

        FacesContext.getCurrentInstance().getExternalContext().redirect(url);

        return;
    } catch (IOException e) {
        throw new FacesException(e);
    }
}
函数在参数中获取路径,并使用2个参数将我重定向到服务器url:

  • ?/path:要生成的报告的完整路径(来自根文件夹)
  • rs:Format=Excel:是生成的格式(这里我想将报表导出到Excel,但它可以采用PDF格式,如:&rs:Format=PDF)

感谢您的帮助@RussellFox,我将尝试使用.NET解决方案

谢谢您的回复我将查看所有这些并向您反馈Hello@RussellFox我编辑了我的问题以添加我所做的,我现在可以获得我报告的XML描述,我想知道你是否知道如何将这个文件转换成PDF或EXCEL之类的报表。