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


Java JasperDesign类代码示例

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


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

示例1: performAction

import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
@Override
public void performAction() throws ActionException {
	if (zoomValue != null && zoomValue.length() > 0) {
		CommandTarget target = getCommandTarget(getJasperReportsContext(), getReportContext());
		if (target != null) {
			// execute command
			try {
				getCommandStack().execute(
					new ResetInCacheCommand(
							new SaveZoomCommand((JasperDesign)target.getIdentifiable(), zoomValue),
							getJasperReportsContext(),
							getReportContext(),
							target.getUri()
					)
				);
			} catch (CommandException e) {
				throw new ActionException(e);
			}
		}
	} else {
		errors.addAndThrow("net.sf.jasperreports.web.actions.empty.zoom");
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:24,代码来源:SaveZoomAction.java

示例2: compileReport

import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
public JasperReport compileReport(String jrxmlFileName) throws JRException, IOException
{
	JasperReport jasperReport = null;
	
	InputStream jrxmlInput = JRLoader.getResourceInputStream(jrxmlFileName);

	if (jrxmlInput != null)
	{
		JasperDesign design;
		try
		{
			design = JRXmlLoader.load(jrxmlInput);
		}
		finally
		{
			jrxmlInput.close();
		}
		jasperReport = JasperCompileManager.compileReport(design);
	}
	
	return jasperReport;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:23,代码来源:AbstractTest.java

示例3: verifyEvaluation

import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
protected void verifyEvaluation(JRVerifier verifier,
		XYChartComponent chart)
{
	EvaluationTimeEnum evaluationTime = chart.getEvaluationTime();
	if (evaluationTime == EvaluationTimeEnum.AUTO)
	{
		verifier.addBrokenRule("Axis chart evaluation time cannot be Auto", chart);
	}
	else if (evaluationTime == EvaluationTimeEnum.GROUP)
	{
		String groupName = chart.getEvaluationGroup();
		if (groupName == null)
		{
			verifier.addBrokenRule("Evaluation group not set for axis chart", chart);
		}
		else
		{
			JasperDesign report = verifier.getReportDesign();
			if (!report.getGroupsMap().containsKey(groupName))
			{
				verifier.addBrokenRule("Axis chart evaluation group " + groupName 
						+ " not found in report", chart);
			}
		}
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:27,代码来源:XYChartCompiler.java

示例4: verifyEvaluation

import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
protected void verifyEvaluation(JRVerifier verifier,
		PieChartComponent chart)
{
	EvaluationTimeEnum evaluationTime = chart.getEvaluationTime();
	if (evaluationTime == EvaluationTimeEnum.AUTO)
	{
		verifier.addBrokenRule("Pie chart evaluation time cannot be Auto", chart);
	}
	else if (evaluationTime == EvaluationTimeEnum.GROUP)
	{
		String groupName = chart.getEvaluationGroup();
		if (groupName == null)
		{
			verifier.addBrokenRule("Evaluation group not set for pie chart", chart);
		}
		else
		{
			JasperDesign report = verifier.getReportDesign();
			if (!report.getGroupsMap().containsKey(groupName))
			{
				verifier.addBrokenRule("Pie chart evaluation group " + groupName 
						+ " not found in report", chart);
			}
		}
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:27,代码来源:PieChartCompiler.java

示例5: performAction

import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
@Override
	public void performAction() 
	{
//		JasperDesign jasperDesign = getJasperDesign();
		JasperDesignCache cache = JasperDesignCache.getInstance(getJasperReportsContext(), getReportContext());
		Map<String, JasperDesignReportResource> cachedResources = cache.getCachedResources();
		for (String uri : cachedResources.keySet())
		{
			JasperDesignReportResource resource = cachedResources.get(uri);
			JasperDesign jasperDesign = resource.getJasperDesign();
			if (jasperDesign != null)
			{
				JasperReport jasperReport = resource.getReport();
				String appRealPath = null;//FIXMECONTEXT WebFileRepositoryService.getApplicationRealPath();
				try
				{
					JRSaver.saveObject(jasperReport, new File(new File(new File(appRealPath), "WEB-INF/repository"), uri));//FIXMEJIVE harcoded
				}
				catch (JRException e)
				{
					throw new JRRuntimeException(e);
				}
			}
		}
	}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:26,代码来源:SaveAction.java

示例6: ReportConverter

import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
/**
 *
 */
public ReportConverter(JasperReportsContext jasperReportsContext, JRReport report, boolean ignoreContent)
{
	this.jasperReportsContext = jasperReportsContext;
	this.componentsEnvironment = ComponentsEnvironment.getInstance(jasperReportsContext);
	this.report = report;
	this.locale = readLocale();//allow to pass this explicitly?
	this.timezone = readTimeZone();
	
	if (report instanceof JasperDesign)
	{
		((JasperDesign)report).preprocess();
	}
	
	convert(ignoreContent);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:19,代码来源:ReportConverter.java

示例7: setParentStyle

import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
@Override
protected void setParentStyle(JRDesignStyle currentStyle, String parentStyleName)
{
	JasperDesign jasperDesign = (JasperDesign) digester.peek(digester.getCount() - 2);
	Map<String,JRStyle> stylesMap = jasperDesign.getStylesMap();

	if (stylesMap.containsKey(parentStyleName))
	{
		JRStyle parent = stylesMap.get(parentStyleName);
		currentStyle.setParentStyle(parent);
	}
	else
	{
		currentStyle.setParentStyleNameReference(parentStyleName);
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:17,代码来源:JRStyleFactory.java

示例8: createObject

import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
@Override
public Object createObject(Attributes attrs) throws Exception
{
	JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2);
	JRDesignGenericElement element = new JRDesignGenericElement(jasperDesign);
	
	EvaluationTimeEnum evaluationTime = EvaluationTimeEnum.getByName(attrs.getValue(JRXmlConstants.ATTRIBUTE_evaluationTime));
	if (evaluationTime != null)
	{
		element.setEvaluationTime(evaluationTime);
	}
	
	if (element.getEvaluationTimeValue() == EvaluationTimeEnum.GROUP)
	{
		String groupName = attrs.getValue(JRXmlConstants.ATTRIBUTE_evaluationGroup);
		if (groupName != null)
		{
			element.setEvaluationGroupName(groupName);
		}
	}
	
	return element;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:24,代码来源:JRGenericElementFactory.java

示例9: createObject

import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
@Override
public Object createObject(Attributes atts)
{
	JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2);

	JRDesignSubreport subreport = new JRDesignSubreport(jasperDesign);

	String isUsingCache = atts.getValue(JRXmlConstants.ATTRIBUTE_isUsingCache);
	if (isUsingCache != null && isUsingCache.length() > 0)
	{
		subreport.setUsingCache(Boolean.valueOf(isUsingCache));
	}
	
	String runToBottomAttr = atts.getValue(JRXmlConstants.ATTRIBUTE_runToBottom);
	if (runToBottomAttr != null)
	{
		subreport.setRunToBottom(Boolean.valueOf(runToBottomAttr));
	}

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

示例10: begin

import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
@Override
public void begin(String namespace, String name, Attributes attributes)
		throws Exception
{
	DesignStyleContainer styleContainer = (DesignStyleContainer) digester.peek();
	
	JasperDesign jasperDesign = (JasperDesign) digester.peek(digester.getCount() - 2);
	styleContainer.setDefaultStyleProvider(jasperDesign);
	
	String styleName = attributes.getValue(styleAttribute);
	if (styleName != null)
	{
		Map<String,JRStyle> stylesMap = jasperDesign.getStylesMap();
		if (stylesMap.containsKey(styleName))
		{
			JRStyle style = stylesMap.get(styleName);
			styleContainer.setStyle(style);
		}
		else
		{
			styleContainer.setStyleNameReference(styleName);
		}
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:25,代码来源:StyleContainerRule.java

示例11: compileReport

import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
protected void compileReport() throws JRException, IOException
{
	InputStream jrxmlInput = JRLoader.getResourceInputStream(jrxml);
	JasperDesign design;
	try
	{
		design = JRXmlLoader.load(jrxmlInput);
	}
	finally
	{
		jrxmlInput.close();
	}
	
	report = JasperCompileManager.compileReport(design);
	
	fillManager = JasperFillManager.getInstance(jasperReportsContext);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:18,代码来源:Report.java

示例12: verifyEvaluation

import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
protected void verifyEvaluation(JRVerifier verifier,
		SpiderChartComponent chart)
{
	EvaluationTimeEnum evaluationTime = chart.getEvaluationTime();
	if (evaluationTime == EvaluationTimeEnum.AUTO)
	{
		verifier.addBrokenRule("Spider chart evaluation time cannot be Auto", chart);
	}
	else if (evaluationTime == EvaluationTimeEnum.GROUP)
	{
		String groupName = chart.getEvaluationGroup();
		if (groupName == null)
		{
			verifier.addBrokenRule("Evaluation group not set for spider chart", chart);
		}
		else
		{
			JasperDesign report = verifier.getReportDesign();
			if (!report.getGroupsMap().containsKey(groupName))
			{
				verifier.addBrokenRule("Spider chart evaluation group " + groupName 
						+ " not found in report", chart);
			}
		}
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:27,代码来源:SpiderChartCompiler.java

示例13: performAction

import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
@Override
public void performAction() throws ActionException {
	JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)table.getDatasetRun();

	String datasetName = datasetRun.getDatasetName();
	
	JasperDesignCache cache = JasperDesignCache.getInstance(getJasperReportsContext(), getReportContext());
	
	JasperDesign jasperDesign = cache.getJasperDesign(targetUri);
	JRDesignDataset dataset = (JRDesignDataset)jasperDesign.getDatasetMap().get(datasetName);
	
	// execute command
	try {
		getCommandStack().execute(
			new ResetInCacheCommand(
				new FilterCommand(getJasperReportsContext(), dataset, getFilterData()),
				getJasperReportsContext(),
				getReportContext(), 
				targetUri
				)
			);
	} catch (CommandException e) {
		throw new ActionException(e);
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:26,代码来源:FilterAction.java

示例14: performAction

import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
@Override
public void performAction() throws ActionException {
	JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)table.getDatasetRun();
	
	String datasetName = datasetRun.getDatasetName();
	
	JasperDesignCache cache = JasperDesignCache.getInstance(getJasperReportsContext(), getReportContext());

	JasperDesign jasperDesign = cache.getJasperDesign(targetUri);
	JRDesignDataset dataset = (JRDesignDataset)jasperDesign.getDatasetMap().get(datasetName);
	
	// execute command
	try {
		getCommandStack().execute(
			new ResetInCacheCommand(
				new SortCommand(getJasperReportsContext(), dataset, getSortData()),
				getJasperReportsContext(),
				getReportContext(), 
				targetUri
				)
			);
	} catch (CommandException e) {
		throw new ActionException(e);
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:26,代码来源:SortAction.java

示例15: loadJasperDesign

import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
public static JasperDesign loadJasperDesign(byte[] template) throws SchemaException{
	    	try	 {
	    	byte[] reportTemplate = Base64.decodeBase64(template);
		 	
		 	InputStream inputStreamJRXML = new ByteArrayInputStream(reportTemplate);
		 	JasperDesign jasperDesign = JRXmlLoader.load(inputStreamJRXML);
//		 	LOGGER.trace("load jasper design : {}", jasperDesign);
		 	return jasperDesign;
	    	} catch (JRException ex){
	    		throw new SchemaException(ex.getMessage(), ex.getCause());
	    	}
	    }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:13,代码来源:ReportTypeUtil.java


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