wangchizhong
作者wangchizhong·2012-10-07 20:45
软件开发工程师·高伟达软件股份

SDK生成报表规范并运行

字数 22384阅读 4730评论 2赞 7

直接上测试通过的代码。
COGNOS 10 - SDK 

package com.git.report.cognos;

import java.net.URL;

import com.cognos.developer.schemas.bibus._3.AsynchDetail;
import com.cognos.developer.schemas.bibus._3.AsynchDetailReportOutput;
import com.cognos.developer.schemas.bibus._3.AsynchReply;
import com.cognos.developer.schemas.bibus._3.ContentManagerService_PortType;
import com.cognos.developer.schemas.bibus._3.ContentManagerService_ServiceLocator;
import com.cognos.developer.schemas.bibus._3.Option;
import com.cognos.developer.schemas.bibus._3.OutputEncapsulationEnum;
import com.cognos.developer.schemas.bibus._3.ParameterValue;
import com.cognos.developer.schemas.bibus._3.ReportServiceReportSpecification;
import com.cognos.developer.schemas.bibus._3.ReportService_PortType;
import com.cognos.developer.schemas.bibus._3.ReportService_ServiceLocator;
import com.cognos.developer.schemas.bibus._3.RunOptionBoolean;
import com.cognos.developer.schemas.bibus._3.RunOptionEnum;
import com.cognos.developer.schemas.bibus._3.RunOptionLanguageArray;
import com.cognos.developer.schemas.bibus._3.RunOptionOutputEncapsulation;
import com.cognos.developer.schemas.bibus._3.RunOptionStringArray;
import com.cognos.developer.schemas.bibus._3.Specification;

public class Service {
public static final String LOCAL_COGNOS_ADDRESS = "http://localhost:9300/p2pd/servlet/dispatch";

public ReportService_PortType getReportService(String url) {
// 实例化所需服务的 ServiceLocator
ReportService_ServiceLocator reportLocator = new ReportService_ServiceLocator();
// 通过 ServiceLocator 获得 ServicePort
return this.getReportService(reportLocator, url);
}

public ReportService_PortType getReportService(
ReportService_ServiceLocator reportLocator, String url) {
// 通过 ServiceLocator 获得 ServicePort
try {
ReportService_PortType reportService = reportLocator
.getreportService(new URL(
url == null ? LOCAL_COGNOS_ADDRESS : url));
return reportService;
} catch (Exception e) {
e.printStackTrace();
}

return null;
}

public ContentManagerService_PortType getContentManagerService(String url) {
try {
ContentManagerService_ServiceLocator cmsLocator = new ContentManagerService_ServiceLocator();
ContentManagerService_PortType cms = cmsLocator
.getcontentManagerService(new URL(
url == null ? LOCAL_COGNOS_ADDRESS : url));
return cms;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}

public String runReport(String reportDefinition) {
return runReport(reportDefinition, getReportService(null));
}

public String runReport(String reportDefinition,
ReportService_PortType reportService) {
Specification spec = new Specification(reportDefinition);
ReportServiceReportSpecification reportSpec = new ReportServiceReportSpecification();
reportSpec.setValue(spec);

RunOptionBoolean saveOutput = new RunOptionBoolean();
saveOutput.setName(RunOptionEnum.saveOutput);
saveOutput.setValue(false);

RunOptionStringArray outputFormat = new RunOptionStringArray();
outputFormat.setName(RunOptionEnum.outputFormat);
outputFormat.setValue(new String[] { "XML" });
// outputFormat.setValue(new String[] { "singleXLS" });
// 格式还可以为CSV , HTMLFragment, MHT, PDF, singleXLS, XHTML, XLS, XLWA, XML

RunOptionLanguageArray outputLocale = new RunOptionLanguageArray();
outputLocale.setName(RunOptionEnum.outputLocale);
outputLocale.setValue(new String[] { "zh" });

// 指定存储输出的位置
RunOptionOutputEncapsulation outputEncapsulation = new RunOptionOutputEncapsulation();
outputEncapsulation.setName(RunOptionEnum.outputEncapsulation);
outputEncapsulation.setValue(OutputEncapsulationEnum.none);

try {

// AsynchReply report2 = reportService.runSpecification(rs,
// new ParameterValue[] {}, new Option[] { saveOutput,
// outputFormat });

AsynchReply report = reportService.runSpecification(reportSpec,
new ParameterValue[] {}, new Option[] { saveOutput,
outputFormat, outputLocale, outputEncapsulation });

AsynchDetail[] details = report.getDetails();
for (AsynchDetail detail : details) {
if (detail instanceof AsynchDetailReportOutput) {
String[] arr = ((AsynchDetailReportOutput) detail)
.getOutputPages();
Object obj = arr[0];
// System.out.println("-------------nnnnnn<html><body>"
// + obj + "</body></html>");
StringBuffer sb = new StringBuffer(1024 * 10);
for (int i = 0; i < arr.length; i++) {
obj = arr[i];
// System.out.println(obj);
sb.append(obj);
}

return sb.toString();
// obj = ((AsynchDetailReportOutput) detail)
// .getOutputObjects()[0];
// String searchPath =
// ((com.cognos.developer.schemas.bibus._3.Output) obj)
// .getSearchPath().getValue();
// SearchPathMultipleObject outSearchPath = new
// SearchPathMultipleObject(
// searchPath + "/graphic");
// BaseClass[] g = cms.query(outSearchPath, new PropEnum[] {
// PropEnum.searchPath, PropEnum.data,
// PropEnum.dataType }, new Sort[] {},
// new QueryOptions());
//
// System.out.println(((Graphic) g[0]).getData());
// System.out.println(((Graphic) g[0]).getSearchPath()
// .getValue());
// System.out
// .println(((Graphic) g[0]).getData().getValue().length);
//
// FileOutputStream fo = new FileOutputStream(
// "c:\Users\wsc\Desktop\img.jpg");
// fo.write(((Graphic) g[0]).getData().getValue());
// fo.flush();
// fo.close();
} else {
System.out.println("===========nnnnnn");
System.out.println(detail);
}
}
} catch (Exception e) {
e.printStackTrace();
}

return null;
}
}







/** 
Licensed Materials - Property of IBM

IBM Cognos Products: DOCS

(C) Copyright IBM Corp. 2005, 2010

US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
IBM Corp.
 */
/**
 * Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
 * Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
 */

package com.git.report.cognos;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.List;

import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

public class API/* implements ReportBuilder */
{
// private String sReportSpec;
public static final String sREPORT = "report";
private static final String QUERY = "Query1";
private static final String PAGE = "Page1";
private Document oDocument;

private int queryCount = 1;
private int pageCount = 1;
private int measureCount = 0;
private String measurePath = "";

public API(String sReportSpec) {
try {
SAXReader xmlReader = new SAXReader();
ByteArrayInputStream bais = new ByteArrayInputStream(sReportSpec
.getBytes());
oDocument = xmlReader.read((InputStream) bais);
} catch (Exception e) {
e.printStackTrace();
}
}

public API() {
Element e = DocumentHelper.createElement("report");
e.addNamespace("", "http://developer.cognos.com/schemas/report/7.0/");
e.addAttribute("expressionLocale", "zh-cn");
e.add(DocumentHelper.createElement("queries"));
e.add(DocumentHelper.createElement("layouts"));
oDocument = DocumentHelper.createDocument(e);
}

public String getXML() {
String strXML = oDocument.asXML();

// strip out extraneous empty xmlns attributes added by use of
// addNamespace
strXML = strXML.replaceAll(" xmlns=""", "");

return strXML;
}

public void addModelPath(String p_sModelPath) {
// assume report node exists
Element e = DocumentHelper.createElement("modelPath");
e.setText(p_sModelPath);
oDocument.getRootElement().add(e);
return;
}

/*
* private void addQueries() { Element e =
* DocumentHelper.createElement("queries");
* oDocument.getRootElement().add(e); }
*/
public Element addQuery() {
return addQuery("Query" + queryCount++);
}

public Element addQuery(String p_sName) {
Element n = (Element) oDocument.selectSingleNode("/report/queries");
Element e = DocumentHelper.createElement("query");
Element source = DocumentHelper.createElement("source");

source.add(DocumentHelper.createElement("model"));
e.addAttribute("name", p_sName);
e.add(source);
e.add(DocumentHelper.createElement("selection"));
e.add(DocumentHelper.createElement("detailFilters"));
n.add(e);

return e;
}

/*
* private void addLayouts() { Element e =
* DocumentHelper.createElement("layouts");
* oDocument.getRootElement().add(e); }
*/
public Element addLayout() {
Element n = (Element) oDocument.selectSingleNode("/report/layouts");
Element e = DocumentHelper.createElement("layout");
n.add(e);
return e;
}

public Element addReportPages() {
Element n = (Element) oDocument
.selectSingleNode("/report/layouts/layout");
Element e = DocumentHelper.createElement("reportPages");
n.add(e);
return e;
}

public Element addPage() {
return addPage("Page" + pageCount++);
}

public Element addPage(String p_sName) {
Element n = (Element) oDocument
.selectSingleNode("/report/layouts/layout/reportPages");
Element e = DocumentHelper.createElement("page");
Element eStyle = buildStyle("pg");

e.addAttribute("name", p_sName);
e.add(eStyle);
n.add(e);
return e;
}

public void addPageBody(String p_sAddToPage) {
Element n = (Element) oDocument
.selectSingleNode("/report/layouts//page[@name='"
+ p_sAddToPage + "']");
Element e = DocumentHelper.createElement("pageBody");
e.add(DocumentHelper.createElement("contents"));
n.add(e);
}

public void addStyle(String p_sType, String p_sPageName, String p_sCSSValue) {
Element n = (Element) oDocument
.selectSingleNode("/report//reportPages/page[@name='"
+ p_sPageName + "']//" + p_sType + "/style");
// Element e = DocumentHelper.createElement("style");
Element css = DocumentHelper.createElement("CSS");
css.addAttribute("value", p_sCSSValue);
// e.add(css);
// n.add(e);
n.add(css);
}

public void addDataItem(String p_sAddToQuery, String p_sName,
String p_sExpression) {
addDataItem(p_sAddToQuery, p_sName, p_sExpression, null);
}

public void addDataItem(String p_sAddToQuery, String p_sName,
String p_sExpression, String p_sAggregate) {
Element n = (Element) oDocument
.selectSingleNode("/report//query[@name='" + p_sAddToQuery
+ "']/selection");
Element e1 = DocumentHelper.createElement("dataItem");
Element e2 = DocumentHelper.createElement("expression");

e1.addAttribute("name", p_sName);
if (p_sAggregate != null) {
e1.addAttribute("aggregate", p_sAggregate);
}

e2.setText(p_sExpression);
e1.add(e2);
n.add(e1);
}

public void addDetailFilter(String p_sAddToQuery, String p_sExpression) {
addDetailFilter(p_sAddToQuery, p_sExpression, false);
}

public void addDetailFilter(String p_sAddToQuery, String p_sExpression,
boolean postAutoAggregation) {
Element n = (Element) oDocument
.selectSingleNode("/report//query[@name='" + p_sAddToQuery
+ "']/detailFilters");
Element e1 = DocumentHelper.createElement("detailFilter");
Element e2 = DocumentHelper.createElement("filterExpression");

e1.addAttribute("use", "required");
e1.addAttribute("postAutoAggregation", postAutoAggregation ? "true"
: "false");

e2.setText(p_sExpression.replaceAll(">", "&gt;")
.replaceAll("<", "&gt;"));
e1.add(e2);
n.add(e1);
}

/*
* public void addDataItemSort(String p_sElementName, String p_sSort) {
* Element n =(Element)oDocument.selectSingleNode(
* "/report/querySet/BIQuery/tabularModel/dataItem[@name='" + p_sElementName
* + "'"); n.addAttribute("sort", p_sSort); }
*/

public void addList(String p_sAddToPage, String p_sQueryName) {
Element n = (Element) oDocument
.selectSingleNode("/report//reportPages/page[@name='"
+ p_sAddToPage + "']/pageBody/contents");
Element e = DocumentHelper.createElement("list");
Element eStyle = buildStyle("ls");

// p_sName should be the same as the query name
e.addAttribute("refQuery", p_sQueryName);
e.add(eStyle);
e.add(DocumentHelper.createElement("listColumns"));
n.add(e);

}

public void addListStyle(String p_sPageName, String p_sCSSValue) {
addStyle("list", p_sPageName, p_sCSSValue);
}

public void addListColumn(String p_sPageName, String p_sDataItem,
String p_sColumnTitle) {
Element n = (Element) oDocument.selectSingleNode("//page[@name='"
+ p_sPageName + "']//list/listColumns");
Element e1 = DocumentHelper.createElement("listColumn");
Element e2 = DocumentHelper.createElement("listColumnTitle");
Element e3 = DocumentHelper.createElement("contents");
Element e4 = DocumentHelper.createElement("textItem");
Element e5 = DocumentHelper.createElement("dataSource");
// Element e6 = DocumentHelper.createElement("dataItemLabel");
Element e6 = DocumentHelper.createElement("staticValue");
Element eStyleTitle = buildStyle("lt");
Element eStyleBody = buildStyle("lc");

// e6.addAttribute("refDataItem", p_sDataItem);
e6.setText(p_sColumnTitle);
e5.add(e6);
e4.add(e5);
e3.add(e4);
e2.add(eStyleTitle);
e2.add(e3);
e1.add(e2);

e2 = DocumentHelper.createElement("listColumnBody");
e3 = DocumentHelper.createElement("contents");
e4 = DocumentHelper.createElement("textItem");
e5 = DocumentHelper.createElement("dataSource");
e6 = DocumentHelper.createElement("dataItemValue");

e6.addAttribute("refDataItem", p_sDataItem);
e2.add(eStyleBody);
e5.add(e6);
e4.add(e5);
e3.add(e4);
e2.add(e3);
e1.add(e2);
n.add(e1);
}

/**
* Crosstab layout methods
*/
public void addCrosstab(String p_sAddToPage, String p_sQueryName) {
Element n = (Element) oDocument
.selectSingleNode("/report//reportPages/page[@name='"
+ p_sAddToPage + "']/pageBody/contents");
Element e1 = DocumentHelper.createElement("crosstab");
Element e2 = DocumentHelper.createElement("defaultMeasure");
Element e3 = DocumentHelper.createElement("crosstabFactCell");
Element e4 = DocumentHelper.createElement("contents");
Element e5 = DocumentHelper.createElement("textItem");
Element e6 = DocumentHelper.createElement("dataSource");
Element eStyle1 = buildStyle("xt");
Element eStyle3 = buildStyle("mv");

e1.addAttribute("refQuery", p_sQueryName);

e6.add(DocumentHelper.createElement("cellValue"));
e5.add(e6);
e4.add(e5);

e3.add(eStyle3);
e3.add(e4);

e1.add(eStyle1);
e1.add(e3);
e1.add(e2);
n.add(e1);
}

public void addCrosstabStyle(String p_sPageName, String p_sCSSValue) {
addStyle("crosstab", p_sPageName, p_sCSSValue);
}

public void addCrosstabCorner(String p_sAddToPage, String p_sName) {
Element n = (Element) oDocument
.selectSingleNode("/report//page[@name='" + p_sAddToPage
+ "']//crosstab");
Element e1 = (Element) n.selectNodes("crosstabCorner");
if (e1 == null) {
e1 = DocumentHelper.createElement("crosstabCorner");
n.add(e1);
}
Element e2 = DocumentHelper.createElement("contents");
Element e3 = DocumentHelper.createElement("textItem");
Element e4 = DocumentHelper.createElement("dataSource");
Element e5 = DocumentHelper.createElement("dataItemLabel");
e5.addAttribute("refDataItem", p_sName);
e4.add(e5);
e3.add(e4);
e2.add(e3);
e1.add(e2);
}

public void addCrosstabNodeSet(String p_sPageName, String p_sType) {
Element n = (Element) oDocument.selectSingleNode("//page[@name='"
+ p_sPageName + "']//crosstab");
if (n.selectSingleNode(p_sType) != null) {
return;
}
Element e = DocumentHelper.createElement(p_sType);
n.add(e);
}

public void addCrosstabRows(String p_sPageName) {
addCrosstabNodeSet(p_sPageName, "crosstabRows");
}

public void addCrosstabRow(String p_sPageName, String p_sDataItem) {
addCrosstabNode(p_sPageName, p_sDataItem, "crosstabRows");
}

public void addCrosstabColumns(String p_sPageName) {
addCrosstabNodeSet(p_sPageName, "crosstabColumns");
}

@SuppressWarnings("unchecked")
public void addCrosstabColumn(String p_sPageName, String p_sDataItem) {
if (measurePath.equals("")) {
addCrosstabNode(p_sPageName, p_sDataItem, "crosstabColumns");
} else {
Element n = (Element) oDocument.selectSingleNode(measurePath);
Element e1 = makeCrosstabNode(p_sDataItem);
Element e2 = DocumentHelper.createElement("crosstabNestedNodes");
e1.add(e2);

List l = n.selectNodes("crosstabNode");
for (int i = 0; i < l.size(); i++) {
e2.add((Element) l.get(i));
n.remove((Element) l.get(i));
}
n.add(e1);
measurePath = e2.getPath();
}
}

private void addCrosstabNode(String p_sPageName, String p_sDataItem,
String p_sType) {
Element n = (Element) oDocument
.selectSingleNode("/report//page[@name='" + p_sPageName
+ "']//crosstab/" + p_sType + "");

if (n.selectSingleNode("crosstabNode") == null) {
n.add(makeCrosstabNode(p_sDataItem));
} else {
Element e = DocumentHelper.createElement("crosstabNestedNodes");
e.add(makeCrosstabNode(p_sDataItem));
getLowestCrosstabNode((Element) n.selectSingleNode("crosstabNode"))
.add(e);
}
}

public void addCrosstabMeasure(String p_sPageName, String p_sDataItem) {
Element addTo;
Element n = (Element) oDocument
.selectSingleNode("/report//page[@name='" + p_sPageName
+ "']//crosstab/defaultMeasure");

switch (measureCount) {
case 0:
n.addAttribute("refDataItem", p_sDataItem);
break;

case 1:
String firstMeasure = n.attributeValue("refDataItem");

Element crosstab = n.getParent();
if ((Element) crosstab.selectSingleNode("crosstabColumns") == null)
;
{
addCrosstabColumns(p_sPageName);
}

Element node = (Element) crosstab
.selectSingleNode("crosstabColumns/crosstabNode");
if (node == null) {
addTo = (Element) crosstab.selectSingleNode("crosstabColumns");
} else {
node = getLowestCrosstabNode(node);
addTo = DocumentHelper.createElement("crosstabNestedNodes");
node.add(addTo);
}
addTo.add(makeCrosstabNode(firstMeasure));
addTo.add(makeCrosstabNode(p_sDataItem));
measurePath = addTo.getPath();
crosstab.remove(n);
break;

default:
addTo = (Element) oDocument.selectSingleNode(measurePath);
addTo.add(makeCrosstabNode(p_sDataItem));
}
measureCount++;
}

public void addListSort(String p_sPageName, String p_sItem, String p_sSort) {
Element n = (Element) oDocument
.selectSingleNode("/report//page[@name='" + p_sPageName
+ "']//list/sortList");
if (n == null) {
Element list = (Element) oDocument
.selectSingleNode("/report//page[@name='" + p_sPageName
+ "']//list");
n = DocumentHelper.createElement("sortList");
list.add(n);
}
Element e = DocumentHelper.createElement("sortItem");
e.addAttribute("refDataItem", p_sItem);
e.addAttribute("sortOrder", p_sSort);
n.add(e);
}

public void addCrosstabSort(String p_sPageName, String p_sItem,
String p_sSort) {
Element n = (Element) oDocument
.selectSingleNode("/report//page[@name='" + p_sPageName
+ "']//crosstabNodeMember[@refDataItem='" + p_sItem
+ "']");
Element e1 = DocumentHelper.createElement("sortList");
Element e2 = DocumentHelper.createElement("sortItem");
e2.addAttribute("refDataItem", p_sItem);
e2.addAttribute("sortOrder", p_sSort);

e1.add(e2);
n.add(e1);
}

public void addListGroup(String p_sPageName, String p_sDataItem) {
Element n = (Element) oDocument
.selectSingleNode("/report//page[@name='" + p_sPageName + "']"
+ "//list//dataItemValue[@refDataItem='" + p_sDataItem
+ "']");
n = n.getParent().getParent().getParent().getParent();
Element e = DocumentHelper.createElement("listColumnRowSpan");
e.addAttribute("refDataItem", p_sDataItem);
n.add(e);

n = n.getParent().getParent().getParent();
e = (Element) n.selectSingleNode("listGroups");
if (e == null) {
e = DocumentHelper.createElement("listGroups");
n.add(e);
}
Element e2 = DocumentHelper.createElement("listGroup");
e2.addAttribute("refDataItem", p_sDataItem);
e.add(e2);
}

private Element makeCrosstabNode(String p_sDataItem) {
Element e1 = DocumentHelper.createElement("crosstabNode");
Element e2 = DocumentHelper.createElement("crosstabNodeMembers");
Element e3 = DocumentHelper.createElement("crosstabNodeMember");
Element e4 = DocumentHelper.createElement("contents");
Element e5 = DocumentHelper.createElement("textItem");
Element e6 = DocumentHelper.createElement("dataSource");
Element eStyle = buildStyle("ml");

e3.addAttribute("refDataItem", p_sDataItem);

e6.add(DocumentHelper.createElement("memberCaption"));
e5.add(e6);
e4.add(e5);
e3.add(eStyle);
e3.add(e4);
e2.add(e3);
e1.add(e2);

return e1;
}

private Element buildStyle(String sName) {

Element eStyle = DocumentHelper.createElement("style");
Element eDefaultStyles = DocumentHelper.createElement("defaultStyles");
Element eDefinedStyle = DocumentHelper.createElement("defaultStyle");
eDefinedStyle.addAttribute("refStyle", sName);

eDefaultStyles.add(eDefinedStyle);
eStyle.add(eDefaultStyles);

return eStyle;
}

private Element getLowestCrosstabNode(Element p_oRoot) {
Element e1 = (Element) p_oRoot
.selectSingleNode("crosstabNestedNodes/crosstabNode"), e2 = null;
while (e1 != null) {
e2 = e1;
e1 = (Element) e1
.selectSingleNode("crosstabNestedNodes/crosstabNode");
}
return e2 == null ? p_oRoot : e2;
}

public static void main(String[] args) throws Exception {
API oAPI = new API();
oAPI.addModelPath("/content/package[@name='package_test']");
oAPI.addQuery();
oAPI.addLayout();
oAPI.addReportPages();
oAPI.addPage();
oAPI.addPageBody(PAGE);
oAPI.addList(PAGE, QUERY);
oAPI.addListStyle(PAGE, "border-collapse:collapse");
oAPI.addDataItem(QUERY, "name_xxx",
"[Model].[query_subject_test].[NAME]");
oAPI.addListColumn(PAGE, "name_xxx", "ddddd......");// Ôö¼ÓÒ»ÁÐ

oAPI.addDataItem(QUERY, "PID", "[Model].[query_subject_test].[PID]");
oAPI.addListColumn(PAGE, "PID", "PID...ÖÐÎÄ¡£¡£¡£...");// Ôö¼ÓÒ»ÁÐ

oAPI.addDataItem(QUERY, "PROMOPRICE",
"[Model].[query_subject_test].[PROMOPRICE]");
oAPI.addListColumn(PAGE, "PROMOPRICE", "PROMOPRICE...ABCD...");// Ôö¼ÓÒ»ÁÐ

oAPI.addDataItem(QUERY, "PROMOPRICE_22", "[PROMOPRICE]+200000");
oAPI.addListColumn(PAGE, "PROMOPRICE_22", "PROMOPRICE_22");// Ôö¼ÓÒ»ÁУ¨Í¨¹ý¼ÆËã»ñµÃ½á¹û£©

oAPI.addDataItem(QUERY, "PROMOPRICE_333",
"if ([PROMOPRICE]>10) then ('abcd') else ('cdef')");// Ôö¼ÓÒ»ÁУ¨Èç¹û¡­¡­ÄÇô¡­¡­£©
oAPI.addListColumn(PAGE, "PROMOPRICE_333", "PROMOPRICE_333");

oAPI.addDetailFilter(QUERY, "[PROMOPRICE] is not null");// Ôö¼Ó¹ýÂËÌõ¼þ

// System.out.println(oAPI.getXML().substring("<?xml version="1.0" encoding="UTF-8"?>".length()
// + 1));

Service service = new Service();
String xmlResult = service.runReport(oAPI.getXML().substring(
"<?xml version="1.0" encoding="UTF-8"?>".length() + 1));
System.out.println(xmlResult);
}
}

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

7

添加新评论2 条评论

zkf100zkf100软件开发工程师亚信
2013-02-26 16:47
请问String reportDefinition, 这个参数是什么意思?
贝克汉姆贝克汉姆软件开发工程师IBM
2012-10-26 16:13
都是JAVA高手
Ctrl+Enter 发表

相关文章

相关问题

相关资料

X社区推广