0
votes

I wrote a java proxy to get a drill down report from ssrs 2008. it works perfectly fine if i access it through the reports server url, but in my java spring app, it loses functionality. For example, i have a drill down report that if i click on the plus sign to expand it it works in the ssrs url but in my jsp, the rendered html does not, it must work as if i was using the reports server url. here is a sample of my code, please tell me if this is possible.

public String getReport(String ReportUrl) throws Exception
 {
  ReportExecutionServiceSoapStub service = getService();


   ExecutionInfo info = service.loadReport(ReportUrl, null); //Load report
   info.setHasDocumentMap(false);
   setExecutionId(service, info.getExecutionID()); //You must set the session id before continuing


   String format = "HTML4.0"; //Valid options are HTML4.0, MHTML, EXCEL, CSV, PDF, etc
   String deviceInfo = "<DeviceInfo><Toolbar>True</Toolbar></DeviceInfo>"; //Only generate an HTML fragment
   ByteArrayHolder result = new ByteArrayHolder();
   StringHolder extension = new StringHolder();
   StringHolder mimeType = new StringHolder();
   StringHolder encoding = new StringHolder();
   ArrayOfWarningHolder warnings = new ArrayOfWarningHolder();
   ArrayOfStringHolder streamIDs = new ArrayOfStringHolder();   

   service.render(format, deviceInfo, result, extension, mimeType, encoding, warnings, streamIDs); //Render report to HTML

   System.out.println(new String(result.value)); //Prints the report HTML; this could be embedded in a JSP   
   return new String(result.value);
 }

 public static void setExecutionId(ReportExecutionServiceSoapStub service, String id) throws SOAPException
 {
  SOAPHeaderElement sessionHeader = new SOAPHeaderElement("http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", "ExecutionHeader");
  sessionHeader.addChildElement("ExecutionID").addTextNode(id);
  service.setHeader(sessionHeader);
 }

 public static ReportExecutionServiceSoapStub getService() throws Exception{

   String endpoint = "http://192.168.69.213/reportserver/ReportExecution2005.asmx";
   AuthPolicy.registerAuthScheme(AuthPolicy.NTLM, JCIFS_NTLMScheme.class);
   ReportExecutionServiceSoapStub service = (ReportExecutionServiceSoapStub)new ReportExecutionServiceLocator(getEngineConfiguration()).getReportExecutionServiceSoap(new URL(endpoint));
   service.setUsername("192.168.69.213\\administrator");
   service.setPassword("secret");

   return service;
 }

 public static org.apache.axis.EngineConfiguration getEngineConfiguration()
 {
  java.lang.StringBuffer sb = new java.lang.StringBuffer();

  sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n");
  sb.append("<deployment name=\"defaultClientConfig\"\r\n");
  sb.append("xmlns=\"http://xml.apache.org/axis/wsdd/\"\r\n");
  sb.append("xmlns:java=\"http://xml.apache.org/axis/wsdd/providers/java\">\r\n");
  sb.append("<globalConfiguration>\r\n");
  sb.append("<parameter name=\"disablePrettyXML\" value=\"true\"/>\r\n");
  sb.append("<parameter name=\"enableNamespacePrefixOptimization\" value=\"true\"/>\r\n");
  sb.append("</globalConfiguration>\r\n");
  sb.append("<transport name=\"http\" pivot=\"java:org.apache.axis.transport.http.CommonsHTTPSender\"/>\r\n");
  sb.append("<transport name=\"local\" pivot=\"java:org.apache.axis.transport.local.LocalSender\"/>\r\n");
  sb.append("<transport name=\"java\" pivot=\"java:org.apache.axis.transport.java.JavaSender\"/>\r\n");
  sb.append("</deployment>\r\n");

  return new org.apache.axis.configuration.XMLStringProvider(sb.toString());
 }

Thanks, any help would be appreciated.

1

1 Answers

0
votes

As one possible solution I will be doing the following.

Ssrs has the plus and minus gif images which you can download and include in your war project. A user will click on one of the grouped rows, I will then call another report to get the grouped data and replace the plus image with a minus image. Its pretty much the way drill through's work except you doing some logic to build up the html differently.
If you open the report in we browser, look at its source to get an idea of what to manipulate.