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


Java TextFieldBuilder类代码示例

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


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

示例1: test

import net.sf.dynamicreports.report.builder.component.TextFieldBuilder; //导入依赖的package包/类
@Test
public void test() {
	Integer width = 150;
	Integer height = 200;		
	
	TextFieldBuilder<String> textField = cmp.text("").setDimension(width, height);
	Assert.assertEquals("Component width", width, textField.getComponent().getWidth());
	Assert.assertEquals("Component height", height, textField.getComponent().getHeight());
	
	textField = cmp.text("").setFixedDimension(width, height);
	Assert.assertEquals("Component fixed width", width, textField.getComponent().getWidth());
	Assert.assertEquals("Component fixed height", height, textField.getComponent().getHeight());
	
	textField = cmp.text("").setMinDimension(width, height);
	Assert.assertEquals("Component min width", width, textField.getComponent().getWidth());
	Assert.assertEquals("Component min height", height, textField.getComponent().getHeight());
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:18,代码来源:Bug_2997586_Test.java

示例2: createSubreport1

import net.sf.dynamicreports.report.builder.component.TextFieldBuilder; //导入依赖的package包/类
private JasperReportBuilder createSubreport1() {
	TextFieldBuilder<String> textField2 = cmp.text("text2");
	labelExpression2 = textField2.getComponent().getValueExpression();
	TextFieldBuilder<String> textField4 = cmp.text("text4");
	labelExpression4 = textField4.getComponent().getValueExpression();

	JasperReportBuilder report = report();
	report.title(textField2.setTableOfContentsHeading(tableOfContentsHeading()));
	report.title(cmp.subreport(createSubreport2()));
	report.title(textField4.setTableOfContentsHeading(tableOfContentsHeading()));
	report.detailHeader(cmp.verticalGap(10));
	report.setDataSource(new JREmptyDataSource(50));
	return report;
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:15,代码来源:TableOfContents3Test.java

示例3: configureReport

import net.sf.dynamicreports.report.builder.component.TextFieldBuilder; //导入依赖的package包/类
@Override
protected void configureReport(JasperReportBuilder rb) {
	labelExpression1 = exp.text("title");
	labelExpression2 = exp.text("summary");
	TextFieldBuilder<String> textField = cmp.text("text2");
	labelExpression3 = textField.getComponent().getValueExpression();
	TextFieldBuilder<String> textField3 = cmp.text("text3");
	labelExpression6 = textField3.getComponent().getValueExpression();

	rb.tableOfContents()
		.title(
  		cmp.text("text").setTableOfContentsHeading(tableOfContentsHeading().setLabel(labelExpression1)))
  	.columns(
  		column1 = col.column("Column1", "field1", type.stringType()))
  	.summary(
  		cmp.text("text").setTableOfContentsHeading(tableOfContentsHeading().setLabel(labelExpression2)),
  		textField.setTableOfContentsHeading(tableOfContentsHeading()),
  		cmp.line().setTableOfContentsHeading(tableOfContentsHeading()),
  		cmp.subreport(createSubreport1()),
  		textField3.setTableOfContentsHeading(tableOfContentsHeading()).setAnchorName("Custom anchor text"));
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:22,代码来源:TableOfContents2Test.java

示例4: countryHeadingComponent

import net.sf.dynamicreports.report.builder.component.TextFieldBuilder; //导入依赖的package包/类
private ComponentBuilder<?, ?> countryHeadingComponent() {
	HorizontalListBuilder headingComponent = cmp.horizontalList();

	HyperLinkBuilder countryReferenceHyperLink = hyperLink();
	countryReferenceHyperLink.setAnchor(new CountryExpression(referenceField));
	countryReferenceHyperLink.setType(HyperLinkType.LOCAL_ANCHOR);

	StyleBuilder style = stl.style(Templates.rootStyle)
		.setFontSize(12)
		.bold()
		.setBackgroundColor(Color.LIGHT_GRAY);

	TextFieldBuilder<String> textComponent = cmp.text(textField)
			.setHyperLink(countryReferenceHyperLink)
			.setStyle(style);
	headingComponent.add(textComponent);

	TextFieldBuilder<String> pageIndexComponent = cmp.text(new CountryHeadingExpression())
		.setHyperLink(countryReferenceHyperLink)
		.setStyle(style)
		.setHorizontalAlignment(HorizontalAlignment.RIGHT);
	headingComponent.add(pageIndexComponent);

	return headingComponent;
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:26,代码来源:SalesTableOfContentsDesign.java

示例5: createSubreport

import net.sf.dynamicreports.report.builder.component.TextFieldBuilder; //导入依赖的package包/类
private JasperReportBuilder createSubreport(int index) {
	TextFieldBuilder<String> title = cmp.text("Subreport" + index)
		.setStyle(Templates.bold12CenteredStyle)
		.setTableOfContentsHeading(tableOfContentsHeading());

	JasperReportBuilder report = report();
	report
	  .setTemplate(Templates.reportTemplate)
	  .title(title)
	  .columns(
	  	col.column("Item", "item", type.stringType()),
	  	col.column("Quantity", "quantity", type.integerType()),
	  	col.column("Unit price", "unitprice", type.bigDecimalType()))
	  .setDataSource(createSubreportDataSource());

	return report;
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:18,代码来源:TableOfContentsReport2.java

示例6: build

import net.sf.dynamicreports.report.builder.component.TextFieldBuilder; //导入依赖的package包/类
private void build() {
	StyleBuilder style = stl.style(stl.pen1Point())
		.setAlignment(HorizontalAlignment.CENTER, VerticalAlignment.MIDDLE);

	MultiPageListBuilder multiPageList = cmp.multiPageList();
	for (int i = 0; i < 10; i++) {
		TextFieldBuilder<String> textField = cmp.text("Title component " + (i + 1))
			.setFixedHeight(100)
			.setStyle(style);
		multiPageList.add(textField);
	}

	try {
		report()
			.setTemplate(Templates.reportTemplate)
			.title(Templates.createTitleComponent("MultiPageList"))
			.summary(multiPageList)
			.pageFooter(Templates.footerComponent)
			.show();
	} catch (DRException e) {
		e.printStackTrace();
	}
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:24,代码来源:MultiPageListReport.java

示例7: buildCommentBlock

import net.sf.dynamicreports.report.builder.component.TextFieldBuilder; //导入依赖的package包/类
private ComponentBuilder buildCommentBlock(SimpleComment comment) {
    TextFieldBuilder<String> authorField = cmp.text(StringUtils.trimHtmlTags(UserUIContext.getMessage(GenericI18Enum.EXT_ADDED_COMMENT, comment.getOwnerFullName(),
            UserUIContext.formatPrettyTime(comment.getCreatedtime())), Integer.MAX_VALUE)).setStyle(getReportStyles().getMetaInfoStyle());
    HorizontalListBuilder infoHeader = cmp.horizontalFlowList().add(authorField);
    return cmp.verticalList(infoHeader, cmp.text(StringUtils.trimHtmlTags(comment.getComment(), Integer.MAX_VALUE)))
            .setStyle(getReportStyles().getBorderStyle());
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:8,代码来源:PageReportTemplateExecutor.java

示例8: configureReport

import net.sf.dynamicreports.report.builder.component.TextFieldBuilder; //导入依赖的package包/类
@Override
protected void configureReport(JasperReportBuilder rb) {
	TextFieldBuilder<String> textField1 = cmp.text("text1");
	labelExpression1 = textField1.getComponent().getValueExpression();
	TextFieldBuilder<String> textField6 = cmp.text("text6");
	labelExpression6 = textField6.getComponent().getValueExpression();

	rb.tableOfContents()
		.title(
			textField1.setTableOfContentsHeading(tableOfContentsHeading()),
  		cmp.subreport(createSubreport1()))
  	.summary(
  		cmp.subreport(createSubreport3()),
  		textField6.setTableOfContentsHeading(tableOfContentsHeading()));
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:16,代码来源:TableOfContents3Test.java

示例9: createSubreport2

import net.sf.dynamicreports.report.builder.component.TextFieldBuilder; //导入依赖的package包/类
private JasperReportBuilder createSubreport2() {
	TextFieldBuilder<String> textField3 = cmp.text("text3");
	labelExpression3 = textField3.getComponent().getValueExpression();

	JasperReportBuilder report = report();
	report.title(textField3.setTableOfContentsHeading(tableOfContentsHeading()));
	report.detailHeader(cmp.verticalGap(10));
	report.setDataSource(new JREmptyDataSource(80));
	return report;
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:11,代码来源:TableOfContents3Test.java

示例10: createSubreport3

import net.sf.dynamicreports.report.builder.component.TextFieldBuilder; //导入依赖的package包/类
private JasperReportBuilder createSubreport3() {
	TextFieldBuilder<String> textField5 = cmp.text("text5");
	labelExpression5 = textField5.getComponent().getValueExpression();

	JasperReportBuilder report = report();
	report.title(textField5.setTableOfContentsHeading(tableOfContentsHeading()));
	report.detailHeader(cmp.verticalGap(10));
	report.setDataSource(new JREmptyDataSource(50));
	return report;
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:11,代码来源:TableOfContents3Test.java

示例11: createSubreport1

import net.sf.dynamicreports.report.builder.component.TextFieldBuilder; //导入依赖的package包/类
private JasperReportBuilder createSubreport1() {
	TextFieldBuilder<String> textField = cmp.text("text3");
	labelExpression4 = textField.getComponent().getValueExpression();

	JasperReportBuilder report = report();
	report.title(textField.setTableOfContentsHeading(tableOfContentsHeading()));
	report.title(cmp.subreport(createSubreport2()));
	return report;
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:10,代码来源:TableOfContents2Test.java

示例12: createSubreport2

import net.sf.dynamicreports.report.builder.component.TextFieldBuilder; //导入依赖的package包/类
private JasperReportBuilder createSubreport2() {
	TextFieldBuilder<String> textField = cmp.text("text4");
	labelExpression5 = textField.getComponent().getValueExpression();

	JasperReportBuilder report = report();
	report.title(textField.setTableOfContentsHeading(tableOfContentsHeading()));
	return report;
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:9,代码来源:TableOfContents2Test.java

示例13: configureReport

import net.sf.dynamicreports.report.builder.component.TextFieldBuilder; //导入依赖的package包/类
@Override
protected void configureReport(JasperReportBuilder rb) {
	CustomGroupBuilder group = grp.group("group1", exp.text(""));

	TextFieldBuilder<String> textField = cmp.text("")
		.setPositionType(ComponentPositionType.FIX_RELATIVE_TO_TOP)
		.setStretchType(StretchType.NO_STRETCH)
		.setPrintInFirstWholeBand(true)
		.setPrintWhenDetailOverflows(true)
		.setPrintWhenGroupChanges(group);
	rb.title(textField)
		.columns(col.column("column1", type.stringType()).setPrintWhenDetailOverflows(true))
		.groupBy(group);
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:15,代码来源:Component3Test.java

示例14: build

import net.sf.dynamicreports.report.builder.component.TextFieldBuilder; //导入依赖的package包/类
public JasperReportBuilder build() throws DRException {
	JasperReportBuilder report = report();

	TextColumnBuilder<String> countryColumn = col.column("Country", "country", type.stringType());
	TextColumnBuilder<String> itemColumn = col.column("Item", "item", type.stringType());

	StyleBuilder headingToc1Style = stl.style(Templates.rootStyle)
		.italic();

	CustomTableOfContentsCustomizer tableOfContentsCustomizer = new CustomTableOfContentsCustomizer();
	tableOfContentsCustomizer.setHeadingStyle(1, headingToc1Style);
	tableOfContentsCustomizer.setTextFixedWidth(100);
	tableOfContentsCustomizer.setPageIndexFixedWidth(30);

	TextFieldBuilder<String> pageHeader = cmp.text(new PageHeaderExpression())
		.setStyle(Templates.bold12CenteredStyle)
		.setEvaluationTime(Evaluation.PAGE);

	report
		.setPageFormat(PageType.A5, PageOrientation.LANDSCAPE)
		.setTemplate(Templates.reportTemplate)
		.setTableOfContents(tableOfContentsCustomizer)
		.columns(
			countryColumn,
			itemColumn,
			col.column("Order date", "orderdate", type.dateType()),
			col.column("Quantity",   "quantity",  type.integerType()),
			col.column("Unit price", "unitprice", type.bigDecimalType()))
		.groupBy(countryColumn, itemColumn)
		.pageHeader(pageHeader)
		.title(
			Templates.createTitleComponent("SalesTableOfContents"))
		.pageFooter(
			Templates.footerComponent)
		.setDataSource(data.createDataSource());

	return report;
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:39,代码来源:SalesTableOfContentsDesign.java

示例15: textCell

import net.sf.dynamicreports.report.builder.component.TextFieldBuilder; //导入依赖的package包/类
private HorizontalListBuilder textCell(String text, int size) {
	HorizontalListBuilder list = cmp.horizontalList();
	String cellText = StringUtils.rightPad(text, size);
	cellText = StringUtils.left(cellText, size);
	for (char character : cellText.toCharArray()) {
		TextFieldBuilder<String> cell = cmp.text(String.valueOf(character))
			.setStyle(cellStyle)
			.setFixedDimension(cellWidth, cellHeight);
		list.add(cell);
	}
	return list;
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:13,代码来源:ApplicationFormDesign.java


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