• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JRXmlUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.sf.jasperreports.engine.util.JRXmlUtils的典型用法代码示例。如果您正苦于以下问题:Java JRXmlUtils类的具体用法?Java JRXmlUtils怎么用?Java JRXmlUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JRXmlUtils类属于net.sf.jasperreports.engine.util包,在下文中一共展示了JRXmlUtils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: SimpleFontExtensionHelper

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
/**
 *
 */
private SimpleFontExtensionHelper()
{
	try
	{
		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
		factory.setFeature(JRXmlUtils.FEATURE_DISALLOW_DOCTYPE, true);
		
		documentBuilder = factory.newDocumentBuilder();
		documentBuilder.setErrorHandler(this);
	}
	catch (ParserConfigurationException e)
	{
		throw new JRRuntimeException(e);
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:19,代码来源:SimpleFontExtensionHelper.java


示例2: getDocumentBuilder

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
protected DocumentBuilder getDocumentBuilder() throws JRException {
	try{
		if (documentBuilderFactory != null) {
			return documentBuilderFactory.newDocumentBuilder();
		} else {
			return JRXmlUtils.createDocumentBuilder();
		}
	} catch (ParserConfigurationException e)
	{
		throw 
			new JRException(
				EXCEPTION_MESSAGE_KEY_DOCUMENT_BUILDER_CREATION_FAILURE, 
				null,
				e);
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:17,代码来源:JRXmlDocumentProducer.java


示例3: getFields

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
@Override
public List<JRDesignField> getFields(DataAdapterService con, JasperReportsConfiguration jConfig, JRDataset jDataset) throws JRException, UnsupportedOperationException {
	Throwable t = null;
	ArrayList<JRDesignField> fields = new ArrayList<JRDesignField>();
	try {
		String fileName = getDataAdapter().getFileName();
		Document doc = JRXmlUtils.parse(new URL(fileName), XMLUtils.isNamespaceAware(getDataAdapter(), jConfig.getJasperDesign()));
		fields.addAll(getFieldsFromDocument(doc, jConfig, jDataset));
	} catch (IOException e) {
		t = e;
	}

	if (t != null) {
		UIUtils.showError(t);
	}
	return fields;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:18,代码来源:RemoteXMLDataAdapterDescriptor.java


示例4: createCheckboxes

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
protected void createCheckboxes(Properties prop){
	Integer connectionIndex = 0;
	String connectionXML = prop.getProperty("connection." + connectionIndex); //$NON-NLS-1$
	while(connectionXML != null){
		try {
			Document document = JRXmlUtils.parse(new InputSource(new StringReader(connectionXML)));
			NamedNodeMap rootAttributes = document.getChildNodes().item(0).getAttributes();
			String connectionName = rootAttributes.getNamedItem("name").getTextContent(); //$NON-NLS-1$
			String connectionClass = rootAttributes.getNamedItem("connectionClass").getTextContent(); //$NON-NLS-1$
			if (ImportUtility.hasAdapter(connectionClass)){
				Button checkButton = new Button(content, SWT.CHECK);
				String type = connectionClass.substring(connectionClass.lastIndexOf(".")+1); //$NON-NLS-1$
				checkButton.setText(connectionName+" ("+ type + ")"); //$NON-NLS-1$ //$NON-NLS-2$
				checkButton.setData(document);
				selectedElements.add(checkButton);
			}
		} catch (JRException e) {}
		connectionIndex++;
		connectionXML = prop.getProperty("connection." + connectionIndex); //$NON-NLS-1$
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:22,代码来源:ShowAdaptersPage.java


示例5: createCheckboxes

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
protected void createCheckboxes(Properties prop){
	String connectionXML = prop.getProperty("dataAdapters"); //$NON-NLS-1$
	Document document;
	try {
		document = JRXmlUtils.parse(new InputSource(new StringReader(connectionXML)));
		Node actualNode = document.getFirstChild();
		if (actualNode.hasChildNodes()) actualNode = actualNode.getFirstChild();
		else actualNode = null;
		while(actualNode != null){
			if (actualNode.getAttributes() != null){
				String name = actualNode.getChildNodes().item(0).getTextContent();
				String type = actualNode.getAttributes().getNamedItem("class").getTextContent();
				type = type.substring(type.lastIndexOf(".")+1);
				Button checkButton = new Button(content, SWT.CHECK);
				checkButton.setText(name+" ("+ type + ")"); //$NON-NLS-1$ //$NON-NLS-2$
				checkButton.setData(actualNode);
				selectedElements.add(checkButton);
			}
			actualNode = actualNode.getNextSibling();
		}
	} catch (JRException e) {
		e.printStackTrace();
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:25,代码来源:ShowJSSAdaptersPage.java


示例6: loadPreferences

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
/**
 * Load the list of the template set from the preferences file. If one of them has the default 
 * attribute set to true then it will be the selected default. If more of them has the attribute
 * to true only the last one will be the default. A template set is added to the available ones
 * only if it's file exist
 */
private void loadPreferences(){
	String defaults = prefs.get(DEFAULT_KEY, "");
	availableDefaults = new ArrayList<String>();
	if (!defaults.isEmpty()){
		try {
			Document document = JRXmlUtils.parse(new InputSource(new StringReader(defaults)));
			NodeList adapterNodes = document.getDocumentElement().getChildNodes();
			for (int i = 0; i < adapterNodes.getLength(); ++i) {
				Node adapterNode = adapterNodes.item(i);
				if (adapterNode.getNodeType() == Node.ELEMENT_NODE) {
					String path = adapterNode.getAttributes().getNamedItem("path").getNodeValue(); //$NON-NLS-1$
					String defaultReport = adapterNode.getAttributes().getNamedItem("default").getNodeValue(); //$NON-NLS-1$
					//Check file existence
					if (new File(path).exists()){
						availableDefaults.add(path);
						if (Boolean.parseBoolean(defaultReport)) actualDefault = path;
					}
				}
			}
		} catch (JRException e) {
			e.printStackTrace();
		}
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:31,代码来源:DefaultManager.java


示例7: configureReport

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
@Override
protected void configureReport(JasperReportBuilder rb) {
	try {
		rb.setLocale(Locale.ENGLISH)
			.columns(
				column1 =	col.column("Column1", field("field1", type.stringType()).setDescription("@field1")),
				column2 =	col.column("Column2", field("field2", type.integerType())),
				column3 =	col.column("Column3", field("field3", type.bigDecimalType())))
			.setQuery("/data/row1", QueryLanguage.XPATH)
			.setParameter(JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, JRXmlUtils.parse(XmlReportTest.class.getResourceAsStream("data.xml")))
			.summary(cmp.subreport(createSubreport()));
	} catch (JRException e) {
		e.printStackTrace();
		Assert.fail(e.getMessage());
	}
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:17,代码来源:XmlReportTest.java


示例8: fill

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
/**
 *
 */
public void fill() throws JRException
{
	long start = System.currentTimeMillis();
	Map<String, Object> params = new HashMap<String, Object>();
	Document document = JRXmlUtils.parse(JRLoader.getLocationInputStream("data/northwind.xml"));
	params.put(JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, document);
	params.put(JRXPathQueryExecuterFactory.XML_DATE_PATTERN, "yyyy-MM-dd");
	params.put(JRXPathQueryExecuterFactory.XML_NUMBER_PATTERN, "#,##0.##");
	params.put(JRXPathQueryExecuterFactory.XML_LOCALE, Locale.ENGLISH);
	params.put(JRParameter.REPORT_LOCALE, Locale.US);
	
	JasperFillManager.fillReportToFile("build/reports/CustomersReport.jasper", params);
	System.err.println("Filling time : " + (System.currentTimeMillis() - start));
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:18,代码来源:XmlDataSourceApp.java


示例9: loadDataDocument

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
protected Document loadDataDocument(XmlDataAdapter xmlDataAdapter, Map<String, Object> parameters) throws JRException
{
	DataFileUtils dataFileUtils = DataFileUtils.instance(getParameterContributorContext());
	DataFileStream dataStream = dataFileUtils.getDataStream(
			xmlDataAdapter.getDataFile(), parameters);
	try
	{
		Document dataDocument = JRXmlUtils.parse(dataStream, xmlDataAdapter.isNamespaceAware());
		return dataDocument;
	}
	finally
	{
		dataStream.dispose();
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:16,代码来源:XmlDataAdapterService.java


示例10: JRXmlDataSource

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
public JRXmlDataSource(
		JasperReportsContext jasperReportsContext,
		InputStream in, 
		String selectExpression,
		boolean isNamespaceAware
		) throws JRException 
{
	this(jasperReportsContext, JRXmlUtils.parse(new InputSource(in), isNamespaceAware), selectExpression);
	
	this.inputStream = in;
	this.closeInputStream = false;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:13,代码来源:JRXmlDataSource.java


示例11: subDocument

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
/**
 * Creates a document using the current node as root.
 * 
 * @return a document having the current node as root
 * @throws JRException
 */
@Override
public Document subDocument() throws JRException
{
	if(currentNode == null)
	{
		throw 
			new JRException(
				EXCEPTION_MESSAGE_KEY_NODE_NOT_AVAILABLE,
				(Object[])null);
	}
	
	// create a new document from the current node
	return JRXmlUtils.createDocument(currentNode);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:21,代码来源:JRXmlDataSource.java


示例12: loadServerProfiles

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
public static void loadServerProfiles(MServers root) {
	root.removeChildren();
	serverProfiles.clear();

	Preferences prefs = PropertiesHelper.INSTANCE_SCOPE.getNode(JaspersoftStudioPlugin.getUniqueIdentifier());

	String xml = prefs.get(PREF_TAG, null); //$NON-NLS-1$

	if (xml != null) {
		try {
			Document document = JRXmlUtils.parse(new InputSource(new StringReader(xml)));

			NodeList adapterNodes = document.getDocumentElement().getChildNodes();// .getElementsByTagName("dataAdapter");

			for (int i = 0; i < adapterNodes.getLength(); ++i) {
				Node adapterNode = adapterNodes.item(i);

				if (adapterNode.getNodeType() == Node.ELEMENT_NODE) {
					try {
						ServerProfile sprof = (ServerProfile) CastorUtil.read(adapterNode, MServerProfile.MAPPINGFILE);

						MServerProfile sp = new MServerProfile(root, sprof);
						new MDummy(sp);
						serverProfiles.add(sp);
					} catch (Exception ex) {
						ex.printStackTrace();
					}
				}
			}

		} catch (JRException e) {
			UIUtils.showError(e);
		}
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:36,代码来源:ServerManager.java


示例13: getFields

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
@Override
public List<JRDesignField> getFields(DataAdapterService con, JasperReportsConfiguration jConfig, JRDataset jDataset) throws JRException, UnsupportedOperationException {
	setRecursiveRetrieval(jConfig);
	ArrayList<JRDesignField> fields = new ArrayList<JRDesignField>();
	String fileName = getDataAdapter().getFileName();
	File in = new File(fileName);
	Document doc = JRXmlUtils.parse(in, XMLUtils.isNamespaceAware(getDataAdapter(), jConfig.getJasperDesign()));
	fields.addAll(getFieldsFromDocument(doc, jConfig, jDataset));
	return fields;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:11,代码来源:XMLDataAdapterDescriptor.java


示例14: findAll

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
/**
 * Read all the styles from the properties file
 */
private void findAll() {
	try {
		String xml = prefs.get(PREF_KEYS_STYLES, null);
		if (xml != null) {
			Document document = JRXmlUtils.parse(new InputSource(new StringReader(xml)));

			NodeList adapterNodes = document.getDocumentElement().getChildNodes();
			for (int i = 0; i < adapterNodes.getLength(); ++i) {
				Node adapterNode = adapterNodes.item(i);
				if (adapterNode.getNodeType() == Node.ELEMENT_NODE) {
					// 1. Find out the class of this styles...
					String className = adapterNode.getAttributes().getNamedItem("type").getNodeValue(); //$NON-NLS-1$
					TemplateStyle factory = getBuilder(className); 
					if (factory != null){
						TemplateStyle readStyle = factory.buildFromXML(adapterNode);
						Integer uniequeTemplateId = getId();
						readStyle.storePropertiy(STYLE_ID, uniequeTemplateId);
						styleDescriptors.put(uniequeTemplateId, readStyle);
					}
				}
			}

		} else {
			prefs.put(PREF_KEYS_STYLES, "<templateStyles></templateStyles>");
			prefs.flush();
		}
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:34,代码来源:PreferencesTemplateStylesStorage.java


示例15: readTemplateFromFile

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
public List<TemplateStyle> readTemplateFromFile(String xml) {
	List<TemplateStyle> result = new ArrayList<TemplateStyle>();
	try {
		if (xml != null) {
			Document document = JRXmlUtils.parse(new InputSource(new StringReader(xml)));
			NodeList adapterNodes = document.getDocumentElement().getChildNodes();
			for (int i = 0; i < adapterNodes.getLength(); ++i) {
				Node adapterNode = adapterNodes.item(i);
				if (adapterNode.getNodeType() == Node.ELEMENT_NODE && adapterNode.getAttributes().getNamedItem("type")!=null) {
					// 1. Find out the class of this styles...
					String className = adapterNode.getAttributes().getNamedItem("type").getNodeValue(); //$NON-NLS-1$
					TemplateStyle factory = getBuilder(className); 
					if (factory != null){
						TemplateStyle readStyle = factory.buildFromXML(adapterNode);
						Integer uniequeTemplateId = getId();
						readStyle.storePropertiy(STYLE_ID, uniequeTemplateId);
						result.add(readStyle);
					}
				}
			}

		} 
	} catch (Exception e) {
		e.printStackTrace();
	}
	return result;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:28,代码来源:PreferencesTemplateStylesStorage.java


示例16: readDataFile

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
protected Map<String, Object> readDataFile(String xmlDataFile) throws JRException {
    Document document = JRXmlUtils.parse(JRLoader.getLocationInputStream(xmlDataFile));
    Map<String, Object> params = new HashMap<String, Object>();
    params.put(JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, document);
    params.put(JRXPathQueryExecuterFactory.XML_DATE_PATTERN, "yyyy-MM-dd");
    params.put(JRXPathQueryExecuterFactory.XML_NUMBER_PATTERN, "#,##0.##");
    params.put(JRXPathQueryExecuterFactory.XML_LOCALE, Locale.ENGLISH);
    params.put(JRParameter.REPORT_LOCALE, Locale.US);
    return params;
}
 
开发者ID:stefanorosanelli,项目名称:jasper-service,代码行数:11,代码来源:JasperProcess.java


示例17: contributeParameters

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
@Override
public void contributeParameters(Map<String, Object> parameters) throws JRException 
{
	RemoteXmlDataAdapter remoteXmlDataAdapter = getRemoteXmlDataAdapter();
	if (remoteXmlDataAdapter != null)
	{
		if (remoteXmlDataAdapter.isUseConnection()) 
		{
			String fileName = remoteXmlDataAdapter.getFileName();
			if (fileName.toLowerCase().startsWith("https://") ||
				fileName.toLowerCase().startsWith("http://") ||
				fileName.toLowerCase().startsWith("file:")) {
				
				// JRXPathQueryExecuterFactory.XML_URL not available.
				// Once this is available, remove XML_URL from this class.
				parameters.put(XML_URL, fileName);
			}
			else 
			{
				InputStream dataStream = RepositoryUtil.getInstance(getJasperReportsContext()).getInputStreamFromLocation(remoteXmlDataAdapter.getFileName());
				try
				{
					Document document = JRXmlUtils.parse(dataStream, remoteXmlDataAdapter.isNamespaceAware());
					parameters.put(JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, document);
				}
				finally
				{
					try
					{
						dataStream.close();
					}
					catch (IOException e)
					{
						log.warn("Failed to close input stream for " + remoteXmlDataAdapter.getFileName());
					}
				}
			}
			
			Locale locale = remoteXmlDataAdapter.getLocale();
			if (locale != null) {
				parameters.put(JRXPathQueryExecuterFactory.XML_LOCALE, locale);
			}

			TimeZone timeZone = remoteXmlDataAdapter.getTimeZone();
			if (timeZone != null) {
				parameters.put(JRXPathQueryExecuterFactory.XML_TIME_ZONE, timeZone);
			}
			
			String datePattern = remoteXmlDataAdapter.getDatePattern();
			if (datePattern != null && datePattern.trim().length()>0) {
				parameters.put(JRXPathQueryExecuterFactory.XML_DATE_PATTERN, datePattern);
			}

			String numberPattern = remoteXmlDataAdapter.getNumberPattern();
			if (numberPattern != null && numberPattern.trim().length()>0) {
				parameters.put(JRXPathQueryExecuterFactory.XML_NUMBER_PATTERN, numberPattern);
			}
		}
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:61,代码来源:RemoteXmlDataAdapterService.java


示例18: fillReport

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
public JasperPrint fillReport(ReportEngineInput input) throws ProviderException
{
    Connection conn = null;

    Report report = input.getReport();
    Map<String,Object> parameters = input.getParameters();

    ReportDataSource dataSource = report.getDataSource();

    try
    {
        JasperReport jr = null;

        if (report.isQueryReport()) return fillQueryReport(report, parameters, input.getExportType());

        jr = (JasperReport) JRLoader
                .loadObject(directoryProvider.getReportDirectory() + report.getFile());

        List<ReportParameterMap> subReports = report.getSubReportParameters();
        if (subReports != null && subReports.size() > 0)
        {
            Iterator<ReportParameterMap> iterator = report.getSubReportParameters().iterator();
            while (iterator.hasNext())
            {
                ReportParameterMap rpMap = iterator.next();

                JasperReport subReport = (JasperReport) JRLoader.loadObject(directoryProvider
                        .getReportDirectory()
                        + rpMap.getReportParameter().getData());

                parameters.put(rpMap.getReportParameter().getName(), subReport);
            }
        }

        JasperPrint jp = null;

        // create new HashMap to send to JasperReports in order to
        // fix serialization problems
        Map<String,Object> jasperReportMap = new HashMap<String,Object>(parameters);

        if (input.getXmlInput() != null)
        {
            ByteArrayInputStream stream = new ByteArrayInputStream(input.getXmlInput().getBytes());
            Document document = JRXmlUtils.parse(stream);

            jasperReportMap.put(JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, document);

            jp = JasperFillManager.fillReport(jr, jasperReportMap);
        }
        else if (dataSource == null)
        {
            jp = JasperFillManager.fillReport(jr, jasperReportMap, new JREmptyDataSource());
        }
        else
        {
            conn = dataSourceProvider.getConnection(dataSource.getId());
            jp = JasperFillManager.fillReport(jr, jasperReportMap, conn);
        }

        if (jp == null || jp.getPages().size() < 1) throw new ProviderException(LocalStrings.ERROR_REPORT_EMPTY);

        return jp;
    }
    catch (Exception e)
    {
        if (!e.getMessage().equals(LocalStrings.ERROR_REPORT_EMPTY)) log.error("JasperReportEngine.fillReport", e);
        throw new ProviderException(e.getMessage());
    }
    finally
    {
        try
        {
            if (conn != null) conn.close();
        }
        catch (Exception ex)
        {
            log.error("Error closing connection: " + ex.getMessage());
        }
    }
}
 
开发者ID:mtpettyp,项目名称:openreports,代码行数:81,代码来源:JasperReportEngine.java


示例19: createCheckBoxData

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
protected List<ServerProfile> createCheckBoxData(Properties prop) {
	List<ServerProfile> result = new ArrayList<ServerProfile>();
	String xmlString = prop.getProperty("serverprofiles");
	if (xmlString == null)
		return result;

	Document document;
	try {
		document = JRXmlUtils.parse(new InputSource(new StringReader(xmlString)));
		Node actualNode = document.getFirstChild();
		if (actualNode.hasChildNodes())
			actualNode = actualNode.getFirstChild();
		else
			actualNode = null;
		while (actualNode != null) {
			if (actualNode.getNodeName().equals("serverProfile")) {
				Node child = actualNode.getFirstChild();
				ServerProfile srv = new ServerProfile();
				while (child != null) {
					if (child.getNodeName().equals("name"))
						srv.setName(child.getTextContent());
					if (child.getNodeName().equals("jrVersion"))
						srv.setJrVersion(child.getTextContent());
					if (child.getNodeName().equals("url")) {
						String connectionString = child.getTextContent();
						if (connectionString.endsWith("/services/repository")) { //$NON-NLS-1$
							connectionString = connectionString.substring(0, connectionString.lastIndexOf("services/repository")); //$NON-NLS-1$
						}
						srv.setUrl(connectionString);
					}
					if (child.getNodeName().equals("user"))
						srv.setUser(child.getTextContent());
					if (child.getNodeName().equals("pass"))
						srv.setPass(child.getTextContent());
					if (child.getNodeName().equals("supportsDateRanges"))
						srv.setSupportsDateRanges(child.getTextContent().equals("true"));
					if (child.getNodeName().equals("chunked"))
						srv.setChunked(child.getTextContent().equals("true"));
					if (child.getNodeName().equals("timeout"))
						srv.setTimeout(Integer.parseInt(child.getTextContent()));
					child = child.getNextSibling();
				}
				result.add(srv);
			}
			actualNode = actualNode.getNextSibling();
		}
	} catch (JRException e) {
		e.printStackTrace();
	}
	return result;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:52,代码来源:ImportJSSServersWizard.java


示例20: getSpecialParameters

import net.sf.jasperreports.engine.util.JRXmlUtils; //导入依赖的package包/类
/**
 * This method is call before the datasource is used and permit to add special parameters to the map
 *
 */
@SuppressWarnings("unchecked")
@Override
public java.util.Map getSpecialParameters(java.util.Map map) throws net.sf.jasperreports.engine.JRException
{
    if (isUseConnection())
    {
        
        /*
        if (this.getFilename().toLowerCase().startsWith("https://") ||
            this.getFilename().toLowerCase().startsWith("http://") ||
            this.getFilename().toLowerCase().startsWith("file:"))
        {
            map.put(JRXPathQueryExecuterFactory.XML_URL, this.getFilename());
        }
        else
        {
        */
            Document document = JRXmlUtils.parse(new File( this.getFilename()));
            map.put(JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, document);
        //}
        
        
        if (getLocale()!=null)
       {
           map.put(JRXPathQueryExecuterFactory.XML_LOCALE, getLocale());
       }
       
       if (getTimeZone() != null)
       {
           map.put(JRXPathQueryExecuterFactory.XML_TIME_ZONE, getTimeZone());
       }
       
       if (getDatePattern() != null && getDatePattern().trim().length()>0)
       {
           map.put(JRXPathQueryExecuterFactory.XML_DATE_PATTERN, getDatePattern());
       }
       
       if (getNumberPattern() != null && getNumberPattern().trim().length()>0)
       {
           map.put(JRXPathQueryExecuterFactory.XML_NUMBER_PATTERN, getNumberPattern());
       }
        
    }
    return map;
}
 
开发者ID:JockiHendry,项目名称:ireport-fork,代码行数:50,代码来源:JRXMLDataSourceConnection.java



注:本文中的net.sf.jasperreports.engine.util.JRXmlUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XMLStreamReaderImpl类代码示例发布时间:2022-05-23
下一篇:
Java PluginManager类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap