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

Java JRDataset类代码示例

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

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



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

示例1: getGroupList

import net.sf.jasperreports.engine.JRDataset; //导入依赖的package包/类
public static List<?> getGroupList(TableComponent table, JRReport report) 
{
	List<?> groupsList = null;
	JRDatasetRun datasetRun = table.getDatasetRun();
	if (datasetRun != null) 
	{
		String dataSetName = datasetRun.getDatasetName();
		JRDataset[] datasets = report.getDatasets();
		if (datasets != null && dataSetName != null)
		{
			for (JRDataset ds : datasets)
			{
				JRGroup[] groups = ds.getGroups();
				if (dataSetName.equals(ds.getName()) && groups != null)
				{
					groupsList = Arrays.asList(groups);
					break;
				}
			}
		}
	}
	return groupsList;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:24,代码来源:TableUtil.java


示例2: JRJpaQueryExecuter

import net.sf.jasperreports.engine.JRDataset; //导入依赖的package包/类
/**
 * 
 */
public JRJpaQueryExecuter(
	JasperReportsContext jasperReportsContext, 
	JRDataset dataset, 
	Map<String,? extends JRValueParameter> parameters
	) 
{
	super(jasperReportsContext, dataset, parameters);
	
	em = (EntityManager)getParameterValue(JRJpaQueryExecuterFactory.PARAMETER_JPA_ENTITY_MANAGER);
	reportMaxCount = (Integer)getParameterValue(JRParameter.REPORT_MAX_COUNT);

	if (em == null) {
		log.warn("The supplied javax.persistence.EntityManager object is null.");
	}

	parseQuery();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:21,代码来源:JRJpaQueryExecuter.java


示例3: JaxenXPathQueryExecuter

import net.sf.jasperreports.engine.JRDataset; //导入依赖的package包/类
/**
 * 
 */
public JaxenXPathQueryExecuter(
	JasperReportsContext jasperReportsContext,
	JRDataset dataset, 
	Map<String,? extends JRValueParameter> parametersMap
	)
{
	super(jasperReportsContext, dataset, parametersMap);
			
	document = (Document) getParameterValue(JaxenXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT);
	documentBuilderFactory = (DocumentBuilderFactory) getParameterValue(
			JaxenXPathQueryExecuterFactory.PARAMETER_DOCUMENT_BUILDER_FACTORY, true);
	namespacesMap = (Map<String, String>) getParameterValue(
			JaxenXPathQueryExecuterFactory.PARAMETER_XML_NAMESPACE_MAP, true);
	
	if (document == null)
	{
		log.warn("The supplied org.w3c.dom.Document object is null.");
	}

	parseQuery();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:25,代码来源:JaxenXPathQueryExecuter.java


示例4: XalanXPathQueryExecuter

import net.sf.jasperreports.engine.JRDataset; //导入依赖的package包/类
/**
 * 
 */
public XalanXPathQueryExecuter(
	JasperReportsContext jasperReportsContext, 
	JRDataset dataset, 
	Map<String,? extends JRValueParameter> parametersMap
	)
{
	super(jasperReportsContext, dataset, parametersMap);
			
	document = (Document) getParameterValue(XalanXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT);
	documentBuilderFactory = (DocumentBuilderFactory) getParameterValue(
			XalanXPathQueryExecuterFactory.PARAMETER_DOCUMENT_BUILDER_FACTORY, true);
	namespacesMap = (Map<String, String>) getParameterValue(
			XalanXPathQueryExecuterFactory.PARAMETER_XML_NAMESPACE_MAP, true);

	if (document == null)
	{
		log.warn("The supplied org.w3c.dom.Document object is null.");
	}

	parseQuery();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:25,代码来源:XalanXPathQueryExecuter.java


示例5: JRHibernateQueryExecuter

import net.sf.jasperreports.engine.JRDataset; //导入依赖的package包/类
/**
 * 
 */
public JRHibernateQueryExecuter(
	JasperReportsContext jasperReportsContext, 
	JRDataset dataset, Map<String, ? extends JRValueParameter> parameters
	)
{
	super(jasperReportsContext, dataset, parameters);
	
	session = (Session) getParameterValue(JRHibernateQueryExecuterFactory.PARAMETER_HIBERNATE_SESSION);
	reportMaxCount = (Integer) getParameterValue(JRParameter.REPORT_MAX_COUNT);
	isClearCache = getPropertiesUtil().getBooleanProperty(dataset, 
			JRHibernateQueryExecuterFactory.PROPERTY_HIBERNATE_CLEAR_CACHE,
			false);

	if (session == null)
	{
		log.warn("The supplied org.hibernate.Session object is null.");
	}
	
	parseQuery();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:24,代码来源:JRHibernateQueryExecuter.java


示例6: writeDataset

import net.sf.jasperreports.engine.JRDataset; //导入依赖的package包/类
public void writeDataset(JRDataset dataset) throws IOException
{
	writer.startElement(JRXmlConstants.ELEMENT_subDataset, getNamespace());
	writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_name, dataset.getName());
	writer.addAttribute(JRXmlConstants.ATTRIBUTE_scriptletClass, dataset.getScriptletClass());
	writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_resourceBundle, dataset.getResourceBundle());
	writer.addAttribute(JRXmlConstants.ATTRIBUTE_whenResourceMissingType, dataset.getWhenResourceMissingTypeValue(), WhenResourceMissingTypeEnum.NULL);
	if (
		isNewerVersionOrEqual(JRConstants.VERSION_4_6_0)
		&& !isExcludeUuids() 
		)
	{
		writer.addAttribute(JRXmlConstants.ATTRIBUTE_uuid, dataset.getUUID().toString());
	}

	writeProperties(dataset);

	if (isNewerVersionOrEqual(JRConstants.VERSION_6_3_1))
	{
		writePropertyExpressions(dataset.getPropertyExpressions());
	}

	writeDatasetContents(dataset);

	writer.closeElement();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:27,代码来源:JRXmlWriter.java


示例7: writeDataset

import net.sf.jasperreports.engine.JRDataset; //导入依赖的package包/类
/**
 * 
 */
public void writeDataset( JRDataset dataset, String datasetName)
{
	if(dataset != null)
	{
		write( "JRDesignDataset " + datasetName + " = new JRDesignDataset(" + dataset.isMainDataset() + ");\n");	
		
		write( datasetName + ".setName(\"{0}\");\n", JRStringUtil.escapeJavaStringLiteral(dataset.getName()));
		write( datasetName + ".setScriptletClass(\"{0}\");\n", JRStringUtil.escapeJavaStringLiteral(dataset.getScriptletClass()));
		write( datasetName + ".setResourceBundle(\"{0}\");\n", JRStringUtil.escapeJavaStringLiteral(dataset.getResourceBundle()));
		write( datasetName + ".setWhenResourceMissingType({0});\n", dataset.getWhenResourceMissingTypeValue(), WhenResourceMissingTypeEnum.NULL);

		writeProperties( dataset, datasetName);
		writePropertyExpressions( dataset.getPropertyExpressions(), datasetName);

		writeDatasetContents( dataset, datasetName);
		flush();
	}
	
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:23,代码来源:JRApiWriter.java


示例8: verifyDatasets

import net.sf.jasperreports.engine.JRDataset; //导入依赖的package包/类
private void verifyDatasets()
{
	JRDataset[] datasets = jasperDesign.getDatasets();
	if (datasets != null && datasets.length > 0)
	{
		for (int i = 0; i < datasets.length; ++i)
		{
			JRDesignDataset dataset = (JRDesignDataset) datasets[i];

			if (dataset.getName() == null || dataset.getName().trim().length() == 0)
			{
				addBrokenRule("Dataset name is missing.", dataset);
			}

			verifyDataset(dataset);
		}
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:19,代码来源:JRVerifier.java


示例9: getDatasetCompileData

import net.sf.jasperreports.engine.JRDataset; //导入依赖的package包/类
/**
 * Returns the compile data for a dataset.
 * 
 * @param dataset the dataset
 * @return the compile data
 * @throws JRException
 */
public Serializable getDatasetCompileData(JRDataset dataset) throws JRException
{
	Serializable compileData;
	if (dataset.isMainDataset())
	{
		compileData = getMainDatasetCompileData();
	}
	else
	{
		compileData = datasetCompileData.get(dataset.getName());
		if (compileData == null)
		{
			throw 
				new JRException(
					EXCEPTION_MESSAGE_KEY_COMPILE_DATA_FOR_DATASET_NOT_FOUND,
					new Object[]{dataset.getName()});
		}
	}
	
	return compileData;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:29,代码来源:JRReportCompileData.java


示例10: removeDataset

import net.sf.jasperreports.engine.JRDataset; //导入依赖的package包/类
/**
 * Removes a sub dataset from the report.
 *
 * @param dataset the dataset to be removed
 * @return the dataset
 */
public JRDataset removeDataset(JRDataset dataset)
{
	if (dataset != null)
	{
		int idx = datasetList.indexOf(dataset);
		if (idx >= 0)
		{
			datasetList.remove(idx);
			datasetMap.remove(dataset.getName());
			getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_DATASETS, dataset, idx);
		}
	}

	return dataset;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:22,代码来源:JasperDesign.java


示例11: getUnitName

import net.sf.jasperreports.engine.JRDataset; //导入依赖的package包/类
protected static String getUnitName(JRReport report, JRDataset dataset, String nameSuffix)
{
	String className;
	if (dataset.isMainDataset())
	{
		className = report.getName();
	}
	else
	{
		className = report.getName() + "_" + dataset.getName();
	}
	
	className = JRStringUtil.getJavaIdentifier(className) + nameSuffix;
	
	return className;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:17,代码来源:JRAbstractCompiler.java


示例12: setVariables

import net.sf.jasperreports.engine.JRDataset; //导入依赖的package包/类
private void setVariables(JRDataset dataset, JRFillObjectFactory factory)
{
	JRVariable[] jrVariables = dataset.getVariables();
	if (jrVariables != null && jrVariables.length > 0)
	{
		List<JRFillVariable> variableList = new ArrayList<JRFillVariable>(jrVariables.length * 3);

		variablesMap = new HashMap<String,JRFillVariable>();
		for (int i = 0; i < jrVariables.length; i++)
		{
			addVariable(jrVariables[i], variableList, factory);
		}

		setVariables(variableList);
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:17,代码来源:JRFillDataset.java


示例13: getElementDatasets

import net.sf.jasperreports.engine.JRDataset; //导入依赖的package包/类
protected JRFillElementDataset[] getElementDatasets(JRDataset dataset)
{
	JRFillElementDataset[] elementDatasetsArray;
	List<JRFillElementDataset> elementDatasetsList;
	if (dataset.isMainDataset())
	{
		elementDatasetsList = elementDatasets;
	}
	else
	{
		elementDatasetsList = elementDatasetMap.get(dataset.getName());
	}

	if (elementDatasetsList == null || elementDatasetsList.size() == 0)
	{
		elementDatasetsArray = new JRFillElementDataset[0];
	}
	else
	{
		elementDatasetsArray = new JRFillElementDataset[elementDatasetsList.size()];
		elementDatasetsList.toArray(elementDatasetsArray);
	}

	return elementDatasetsArray;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:26,代码来源:JRFillObjectFactory.java


示例14: createDatasets

import net.sf.jasperreports.engine.JRDataset; //导入依赖的package包/类
private void createDatasets() throws JRException
{
	datasetMap = new HashMap<String,JRFillDataset>();

	JRDataset[] datasets = jasperReport.getDatasets();
	if (datasets != null && datasets.length > 0)
	{
		for (int i = 0; i < datasets.length; i++)
		{
			JRFillDataset fillDataset = factory.getDataset(datasets[i]);
			fillDataset.createCalculator(jasperReport);

			datasetMap.put(datasets[i].getName(), fillDataset);
		}
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:17,代码来源:BaseReportFiller.java


示例15: JRMondrianQueryExecuter

import net.sf.jasperreports.engine.JRDataset; //导入依赖的package包/类
/**
 * 
 */
public JRMondrianQueryExecuter(
	JasperReportsContext jasperReportsContext, 
	JRDataset dataset, 
	Map<String,? extends JRValueParameter> parametersMap
	)
{
	super(jasperReportsContext, dataset, parametersMap);
	
	connection = (Connection) getParameterValue(JRMondrianQueryExecuterFactory.PARAMETER_MONDRIAN_CONNECTION);

	if (connection == null)
	{
		log.warn("The supplied mondrian.olap.Connection object is null.");
	}
	
	parseQuery();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:21,代码来源:JRMondrianQueryExecuter.java


示例16: getFields

import net.sf.jasperreports.engine.JRDataset; //导入依赖的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


示例17: getFields

import net.sf.jasperreports.engine.JRDataset; //导入依赖的package包/类
@Override
public List<JRDesignField> getFields(DataAdapterService con, JasperReportsConfiguration jConfig, JRDataset jDataset) throws JRException, UnsupportedOperationException {
	
	Map<String, Object> parameters = new HashMap<String, Object>();
	parameters.put("REPORT_PARAMETERS_MAP", new HashMap<String, Object>());
	try {
		//Here there is the password of the connection
		con.contributeParameters(parameters);
	} catch (JRException e) {
		e.printStackTrace();
	}
	ParameterUtil.setParameters(jConfig, jDataset, parameters);
	parameters.put(JRParameter.REPORT_MAX_COUNT, 2);
	Map<String,? extends JRValueParameter> tmpMap  = ParameterUtil.convertMap(parameters, jDataset);

	JRXmlaQueryExecuter qe = new JRXmlaQueryExecuter(jConfig, jDataset, tmpMap);
	JROlapResult result = qe.getResult();
	return OlapFieldsProviderSupport.getFieldsFromResult(result);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:20,代码来源:XmlaFieldsProvider.java


示例18: getFieldsFromDocument

import net.sf.jasperreports.engine.JRDataset; //导入依赖的package包/类
/**
 * Returns the list of fields provided by an XML document and the related
 * query.
 * 
 * @param doc
 *          the W3C XML document
 * @param jConfig
 *          the JasperReports configuration instance
 * @param jDataset
 *          the current dataset
 * @return the list of fields
 * @throws JRException
 */
protected List<JRDesignField> getFieldsFromDocument(Document doc, JasperReportsConfiguration jConfig, JRDataset jDataset) throws JRException {
	JRXPathExecuterFactory xPathExecuterFactory = JRXPathExecuterUtils.getXPathExecuterFactory(jConfig);
	JRXPathExecuter xPathExecuter = xPathExecuterFactory.getXPathExecuter();
	NodeList nodes = xPathExecuter.selectNodeList(doc, jDataset.getQuery().getText());
	LinkedHashMap<String, JRDesignField> fieldsMap = new LinkedHashMap<String, JRDesignField>();
	for (int nIdx = 0; nIdx < nodes.getLength(); nIdx++) {
		Node currNode = nodes.item(nIdx);
		findDirectChildrenAttributes(currNode,fieldsMap,"");
		if(currNode.getNodeType() == Node.ELEMENT_NODE) {
			NodeList childNodes = currNode.getChildNodes();
			findChildFields(childNodes, fieldsMap,"");
		}
	}
	return new ArrayList<JRDesignField>(fieldsMap.values());
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:29,代码来源:XMLDataAdapterDescriptor.java


示例19: getFields

import net.sf.jasperreports.engine.JRDataset; //导入依赖的package包/类
@Override
public List<JRDesignField> getFields(DataAdapterService con, JasperReportsConfiguration jConfig, JRDataset jDataset) throws JRException, UnsupportedOperationException {
	Map<String, Object> parameters = new HashMap<String, Object>();
	con.contributeParameters(parameters);

	ParameterUtil.setParameters(jConfig, jDataset, parameters);
	parameters.put(JRParameter.REPORT_MAX_COUNT, 0);

	// JasperReports query executer instances require
	// REPORT_PARAMETERS_MAP parameter to be defined and not null
	Map<String, JRValueParameter> tmpMap = ParameterUtil.convertMap(parameters, jDataset);
	tmpMap.put(JRParameter.REPORT_PARAMETERS_MAP, new SimpleValueParameter(new HashMap<String, JRValueParameter>()));

	JRMondrianQueryExecuter qe = new JRMondrianQueryExecuter(jConfig, jDataset, tmpMap);
	qe.createDatasource();

	JRMondrianResult result = new JRMondrianResult(qe.getResult());
	return OlapFieldsProviderSupport.getFieldsFromResult(result);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:20,代码来源:MondrianFieldsProvider.java


示例20: setValue

import net.sf.jasperreports.engine.JRDataset; //导入依赖的package包/类
/**
 * Set the valued edited by this dialog
 * 
 * @param value a ParametersDTO (not null) of the parameters list that the user manipulate  
 * @param datasetRun the (not null) dataset run from where the value is extracted
 */
public void setValue(ParameterDTO value, MDatasetRun datasetRun) {
	this.value = value;
	if (value == null) {
		value = new ParameterDTO();
	}
	//get the dataset referenced by the dataset run
	JRDataset dataset = datasetRun.getJasperDesign().getDatasetMap().get(datasetRun.getPropertyValue(JRDesignDatasetRun.PROPERTY_DATASET_NAME));
	if (dataset != null) {
		List<JRParameter> userParameters = new ArrayList<JRParameter>();
		//flag to add or not the system parameters
		boolean addSystemParameters = true;
		for(JRParameter param : dataset.getParameters()){
			if (!param.isSystemDefined() || addSystemParameters) userParameters.add(param);
		}
		//the original dataset parameters are cached
		datasetParameters = userParameters.toArray(new JRParameter[userParameters.size()]);
	}
	else datasetParameters = new JRDesignParameter[0];
	if (table != null)
		fillTable(table);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:28,代码来源:ComboParametersPage.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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