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


Java JRDesignExpression.setText方法代码示例

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


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

示例1: createDetailCells

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
private void createDetailCells(JRDesignCrosstab jdc) {
	List<JRCrosstabCell> cells = jdc.getCellsList();
	JRCrosstabMeasure[] measures = jdc.getMeasures();
	if (measures != null && cells != null)
		for (JRCrosstabCell c : cells) {
			int y = 0;
			if (c.getHeight() != null && measures.length > 0) {
				int h = c.getHeight() / measures.length;
				for (int i = 0; i < measures.length; i++) {
					JRDesignExpression exp = new JRDesignExpression();
					exp.setText("$V{" + measures[i].getName() + "}"); //$NON-NLS-1$ //$NON-NLS-2$

					JRDesignTextField tf = (JRDesignTextField) new MTextField()
							.createJRElement(getConfig().getJasperDesign());
					tf.setX(0);
					tf.setY(y);
					tf.setWidth(c.getWidth());
					tf.setHeight(h);
					tf.setExpression(exp);
					((JRDesignCellContents) c.getContents()).addElement(tf);
					y += h;
				}
			}
		}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:26,代码来源:CrosstabWizard.java

示例2: createJRElement

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public JRDesignComponentElement createJRElement(JasperDesign jasperDesign) {
	JRDesignComponentElement designMap = new JRDesignComponentElement();
	StandardMapComponent component = new StandardMapComponent();
	JRDesignExpression exp1 = new JRDesignExpression();
	exp1.setText(MapDesignConverter.DEFAULT_LATITUDE.toString() + "f"); //$NON-NLS-1$
	JRDesignExpression exp2 = new JRDesignExpression();
	exp2.setText(MapDesignConverter.DEFAULT_LONGITUDE.toString() + "f"); //$NON-NLS-1$
	component.setLatitudeExpression(exp1);
	component.setLongitudeExpression(exp2);
	JRDesignExpression exp3 = new JRDesignExpression();
	exp3.setText(String.valueOf(MapComponent.DEFAULT_ZOOM));
	component.setZoomExpression(exp3);
	designMap.setComponent(component);
	designMap.setComponentKey(new ComponentKey("http://jasperreports.sourceforge.net/jasperreports/components", "c", //$NON-NLS-1$ //$NON-NLS-2$
			"map")); //$NON-NLS-1$
	StandardItemData markerData = safeGetMarkerData(component, null);
	markerData.setDataset(new JRDesignElementDataset());
	
	DefaultManager.INSTANCE.applyDefault(this.getClass(), designMap);
	
	return designMap;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:24,代码来源:MMap.java

示例3: createExpression

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
/**
 * Create a JRDesignExpression by specifying the expression text. An optional value class name can be used as
 * expression class. Value class name should be specified only if strictly required, since it is deprecated by
 * JasperReports.
 * 
 * @param text
 *          - The text of the expression, or null for empty expressions
 * @param valueClassName
 *          - A string representing the class returned by the expression
 * 
 * @return a new JRDesignExpression
 */
@SuppressWarnings("deprecation")
public static JRDesignExpression createExpression(String text, String valueClassName) {
	JRDesignExpression exp = new JRDesignExpression();

	if (text != null) {
		exp.setText(text);
	}

	if (valueClassName != null) {
		exp.setValueClassName(valueClassName);
	}

	return exp;

}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:28,代码来源:ExprUtil.java

示例4: okPressed

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
protected void okPressed() {
	// Updates the expression that will be associated to the image element.
	// Covers all cases except the custom expression one because
	// it is already kept in synch.
	if (!btnCustomExpression.getSelection()) {
		if (imageExpressionText != null) {
			jrImgExpression = new JRDesignExpression();
			if (imageExpressionText.endsWith(".svg")) //$NON-NLS-1$
				jrImgExpression
						.setText("net.sf.jasperreports.renderers.BatikRenderer.getInstanceFromLocation($P{JASPER_REPORTS_CONTEXT}, \"" + imageExpressionText + "\")");//$NON-NLS-1$ //$NON-NLS-2$
			else
				jrImgExpression.setText("\"" + imageExpressionText + "\"");//$NON-NLS-1$ //$NON-NLS-2$
		} else {
			jrImgExpression = null;
		}
	}

	super.okPressed();
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:21,代码来源:ImageSelectionDialog.java

示例5: execute

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public void execute() {
	cexpr.clear();
	JRExpressionCollector reportCollector = JRExpressionCollector.collector(jContext, jd);
	JRExpressionCollector datasetCollector = reportCollector.getCollector(dataset);
	List<JRExpression> datasetExpressions = datasetCollector.getExpressions();
	// update expressions
	boolean modelAlreadyInitialized = false;
	for (JRExpression expr : datasetExpressions) {
		String s = expr.getText();
		if (s != null && s.length() > 4 && s.contains(type1 + oldvalue + "}")) {
			//If there are changes this will assure that the model of all the elements
			//is initialized, so the elements inside containers can be refreshed
			if (!modelAlreadyInitialized) {
				setModelRefresh(node.getRoot().getChildren());
				modelAlreadyInitialized = true;
			}
			
			s = s.replaceAll(type + oldvalue + "}", type + newvalue + "}");
			JRDesignExpression dexpr = (JRDesignExpression) expr;
			dexpr.setText(s);
			cexpr.add((JRDesignExpression) expr);
		}
	}
	doSetQuery(oldvalue, newvalue);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:27,代码来源:RenameDatasetObjectNameCommand.java

示例6: execute

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public void execute() {
	if (column.getPrintWhenExpression() != null) {
		oldPrintWhenExpressionText = column.getPrintWhenExpression().getText();
		((JRDesignExpression)column.getPrintWhenExpression()).setText(expressionText);
	} else {
		newPrintWhenExpression = new JRDesignExpression();
		newPrintWhenExpression.setText(expressionText);
		column.setPrintWhenExpression(newPrintWhenExpression);
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:12,代码来源:HideUnhideColumnCommand.java

示例7: createJRElement

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public JRDesignElement createJRElement(JasperDesign jasperDesign) {
	JRDesignComponentElement el = new JRDesignComponentElement();
	HtmlComponent component = new HtmlComponent();
	JRDesignExpression exp = new JRDesignExpression();
	exp.setValueClassName("java.lang.String"); //$NON-NLS-1$
	exp.setText("\"<p style='background-color:yellow;'>HTML paragraph</p>\""); //$NON-NLS-1$
	component.setHtmlContentExpression(exp);
	el.setComponent(component);
	el.setComponentKey(new ComponentKey(
			"http://jasperreports.sourceforge.net/htmlcomponent", "hc", "html")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
	return el;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:14,代码来源:MHtml.java

示例8: createJRElement

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public JRDesignTextField createJRElement(JasperDesign jasperDesign) {
	JRDesignTextField jrDesignTextField = new JRDesignTextField();
	JRDesignExpression expression = new JRDesignExpression();
	expression.setText("$V{PAGE_NUMBER}"); //$NON-NLS-1$
	jrDesignTextField.setExpression(expression);
	jrDesignTextField.setEvaluationTime(EvaluationTimeEnum.REPORT);
	return jrDesignTextField;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:10,代码来源:MTotalPages.java

示例9: createJRElement

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public JRDesignComponentElement createJRElement(JasperDesign jasperDesign) {
	JRDesignComponentElement el = new JRDesignComponentElement();
	POSTNETComponent component = new POSTNETComponent();
	JRDesignExpression exp = new JRDesignExpression();
	exp.setText("\"123456789\""); //$NON-NLS-1$
	component.setCodeExpression(exp);
	el.setComponent(component);
	el.setComponentKey(new ComponentKey("http://jasperreports.sourceforge.net/jasperreports/components", "jr", "POSTNET")); //$NON-NLS-1$
	
	DefaultManager.INSTANCE.applyDefault(this.getClass(), el);
	
	return el;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:15,代码来源:MPOSTNET.java

示例10: createJRElement

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public JRDesignComponentElement createJRElement(JasperDesign jasperDesign) {
	JRDesignComponentElement el = new JRDesignComponentElement();
	UPCAComponent component = new UPCAComponent();
	JRDesignExpression exp = new JRDesignExpression();
	exp.setText("\"12345678901\""); //$NON-NLS-1$
	component.setCodeExpression(exp);
	el.setComponent(component);
	el.setComponentKey(new ComponentKey("http://jasperreports.sourceforge.net/jasperreports/components", "jr", "UPCA")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
	
	DefaultManager.INSTANCE.applyDefault(this.getClass(), el);
	
	return el;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:15,代码来源:MUPCA.java

示例11: createJRElement

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public JRDesignComponentElement createJRElement(JasperDesign jasperDesign) {
	JRDesignComponentElement el = new JRDesignComponentElement();
	PDF417Component component = new PDF417Component();
	JRDesignExpression exp = new JRDesignExpression();
	exp.setText("\"123456789\""); //$NON-NLS-1$
	component.setCodeExpression(exp);
	el.setComponent(component);
	el.setComponentKey(new ComponentKey("http://jasperreports.sourceforge.net/jasperreports/components", "jr", "PDF417")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
	
	DefaultManager.INSTANCE.applyDefault(this.getClass(), el);
	
	return el;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:15,代码来源:MPDF417.java

示例12: createJRElement

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public JRDesignComponentElement createJRElement(JasperDesign jasperDesign) {
	JRDesignComponentElement el = new JRDesignComponentElement();
	DataMatrixComponent component = new DataMatrixComponent();
	JRDesignExpression exp = new JRDesignExpression();
	exp.setText("\"123456789\""); //$NON-NLS-1$
	component.setCodeExpression(exp);
	el.setComponent(component);
	el.setComponentKey(new ComponentKey("http://jasperreports.sourceforge.net/jasperreports/components", "jr", "DataMatrix")); //$NON-NLS-1$
	
	DefaultManager.INSTANCE.applyDefault(this.getClass(), el);
	
	return el;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:15,代码来源:MDataMatrix.java

示例13: createJRElement

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public JRDesignComponentElement createJRElement(JasperDesign jasperDesign) {
	JRDesignComponentElement el = new JRDesignComponentElement();
	EAN8Component component = new EAN8Component();
	JRDesignExpression exp = new JRDesignExpression();
	exp.setText("\"1234567\""); //$NON-NLS-1$
	component.setCodeExpression(exp);
	el.setComponent(component);
	el.setComponentKey(new ComponentKey("http://jasperreports.sourceforge.net/jasperreports/components", "jr", "EAN8")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
	
	DefaultManager.INSTANCE.applyDefault(this.getClass(), el);
	
	return el;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:15,代码来源:MEAN8.java

示例14: createJRElement

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public JRDesignComponentElement createJRElement(JasperDesign jasperDesign) {
	JRDesignComponentElement el = new JRDesignComponentElement();
	USPSIntelligentMailComponent component = new USPSIntelligentMailComponent();
	JRDesignExpression exp = new JRDesignExpression();
	exp.setText("\"12345678901234567890\""); //$NON-NLS-1$
	component.setCodeExpression(exp);
	el.setComponent(component);
	el.setComponentKey(new ComponentKey("http://jasperreports.sourceforge.net/jasperreports/components", "jr", "USPSIntelligentMail")); //$NON-NLS-1$
	
	DefaultManager.INSTANCE.applyDefault(this.getClass(), el);
	
	return el;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:15,代码来源:MUSPSIntelligent.java

示例15: createJRElement

import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public JRDesignComponentElement createJRElement(JasperDesign jasperDesign) {
	JRDesignComponentElement el = new JRDesignComponentElement();
	EAN13Component component = new EAN13Component();
	JRDesignExpression exp = new JRDesignExpression();
	exp.setText("\"123456789012\""); //$NON-NLS-1$
	component.setCodeExpression(exp);
	el.setComponent(component);
	el.setComponentKey(new ComponentKey("http://jasperreports.sourceforge.net/jasperreports/components", "jr", "EAN13")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
	
	DefaultManager.INSTANCE.applyDefault(this.getClass(), el);
	
	return el;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:15,代码来源:MEAN13.java


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