当前位置: 首页>>代码示例>>Java>>正文


Java JRDataset类代码示例

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


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


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