本文整理汇总了Java中net.sf.dynamicreports.report.constant.HorizontalAlignment类的典型用法代码示例。如果您正苦于以下问题:Java HorizontalAlignment类的具体用法?Java HorizontalAlignment怎么用?Java HorizontalAlignment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HorizontalAlignment类属于net.sf.dynamicreports.report.constant包,在下文中一共展示了HorizontalAlignment类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createSubreport
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的package包/类
private JasperReportBuilder createSubreport(String title) {
StyleBuilder style = stl.style()
.setHorizontalAlignment(HorizontalAlignment.CENTER)
.setVerticalAlignment(VerticalAlignment.MIDDLE)
.setBorder(stl.pen1Point());
JasperReportBuilder report = report();
report
.setTemplate(Templates.reportTemplate)
.title(
cmp.horizontalList(
cmp.gap(30, 47),
cmp.text(title).setStyle(style),
cmp.gap(30, 47)));
return report;
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:18,代码来源:JasperTemplateDesignReport2.java
示例2: bind
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的package包/类
private static void bind(DRDataType<?, ?> dataType, XmlDataType xmlDataType) {
if (xmlDataType == null) {
return;
}
if (xmlDataType.getPattern() != null) {
dataType.setPattern(xmlDataType.getPattern());
}
if (xmlDataType.getHorizontalAlignment() != null) {
HorizontalAlignment alignment = HorizontalAlignment.valueOf(xmlDataType.getHorizontalAlignment().name());
if (alignment == null) {
throw new DRReportException("Horizontal alignment " + xmlDataType.getHorizontalAlignment().name() + " not supported");
}
dataType.setHorizontalAlignment(alignment);
}
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:17,代码来源:DefaultBinder.java
示例3: getDynamicReport
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的package包/类
public DynamicReport getDynamicReport() {
DynamicReport report = new DynamicReport();
report.setTitle("Sales");
report.addColumn(new DynamicColumn("State", "state", "string"));
report.addColumn(new DynamicColumn("Item", "item", "string"));
DynamicColumn column = new DynamicColumn("Order date", "orderdate", "date");
column.setHorizontalAlignment(HorizontalAlignment.CENTER);
report.addColumn(column);
report.addColumn(new DynamicColumn("Quantity", "quantity", "integer"));
column = new DynamicColumn("Unit price", "unitprice", "bigDecimal");
column.setPattern("#,###.0");
report.addColumn(column);
report.addGroup("state");
report.addSubtotal("quantity");
report.addSubtotal("unitprice");
report.setShowPageNumber(true);
return report;
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:25,代码来源:DynamicReportData.java
示例4: build
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的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
示例5: countryHeadingComponent
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的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
示例6: init
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的package包/类
protected void init() {
levelField = field("level", type.integerType());
textField = field("text", type.stringType());
referenceField = field("reference", type.stringType());
pageIndexField = field("pageIndex", type.integerType());
referenceHyperLink = hyperLink();
referenceHyperLink.setAnchor(new ReferenceExpression());
referenceHyperLink.setType(HyperLinkType.LOCAL_ANCHOR);
pageIndexDigits = String.valueOf(headings).length();
if (titleStyle == null) {
titleStyle = stl.style()
.bold()
.setFontSize(16)
.setHorizontalAlignment(HorizontalAlignment.CENTER);
}
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:20,代码来源:TableOfContentsCustomizer.java
示例7: configureReport
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的package包/类
@Override
protected void configureReport(JasperReportBuilder rb) {
StyleBuilder groupStyle = stl.style()
.bold()
.setHorizontalAlignment(HorizontalAlignment.LEFT);
column1 = col.column("field1", type.dateYearType());
group1 = grp.group(column1)
.setHideColumn(false)
.groupByDataType()
.setStyle(groupStyle);
rb.columns(column1)
.groupBy(group1);
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:17,代码来源:Style4Test.java
示例8: configureReport
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的package包/类
@Override
protected void configureReport(JasperReportBuilder rb) {
SubreportBuilder subreport = cmp.subreport(titleSubreport())
.setDataSource(new SubreportDataSourceExpression());
rb.detail(subreport)
.pageFooter(
cmp.pageNumber(),
cmp.totalPages(),
cmp.pageXslashY(),
cmp.pageXofY(),
cmp.pageXofY().setFormatExpression("Page {0} of {1}"),
cmp.pageXofY().setHorizontalAlignment(HorizontalAlignment.LEFT),
cmp.pageXofY().setHorizontalAlignment(HorizontalAlignment.RIGHT),
cmp.pageXofY().setHorizontalAlignment(HorizontalAlignment.JUSTIFIED),
cmp.pageXofY().setHorizontalAlignment(HorizontalAlignment.CENTER));
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:18,代码来源:PageNumber3Test.java
示例9: configureReport
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的package包/类
@Override
protected void configureReport(JasperReportBuilder rb) {
StyleBuilder style = stl.style().setHorizontalAlignment(HorizontalAlignment.LEFT);
PageXofYBuilder pageXofYLeft = cmp.pageXofY().setStyle(stl.style(style));
PageXofYBuilder pageXofYRight = cmp.pageXofY().setStyle(stl.style(style).setHorizontalAlignment(HorizontalAlignment.RIGHT));
rb.setWhenNoDataType(WhenNoDataType.ALL_SECTIONS_NO_DETAIL)
.pageFooter(
cmp.pageXofY(),
cmp.pageXofY().setHorizontalAlignment(HorizontalAlignment.LEFT),
cmp.pageXofY().setHorizontalAlignment(HorizontalAlignment.RIGHT),
cmp.pageXofY().setHorizontalAlignment(HorizontalAlignment.JUSTIFIED),
cmp.pageXofY().setHorizontalAlignment(HorizontalAlignment.CENTER),
cmp.horizontalList(pageXofYLeft, pageXofYRight, pageXofYLeft, pageXofYRight),
cmp.pageXofY().setPageXFixedWidth(20),
cmp.pageXofY().setPageYFixedWidth(25),
cmp.pageXslashY().setPageXFixedWidth(30),
cmp.pageXslashY().setPageYFixedWidth(35),
cmp.pageXofY().setPageXFixedWidth(18).setPageYFixedWidth(22));
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:21,代码来源:PageNumberPositionTest.java
示例10: build
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的package包/类
private void build() {
StyleBuilder boldStyle = stl.style().bold();
StyleBuilder boldCenteredStyle = stl.style(boldStyle).setHorizontalAlignment(HorizontalAlignment.CENTER);
StyleBuilder columnTitleStyle = stl.style(boldCenteredStyle)
.setBorder(stl.pen1Point())
.setBackgroundColor(Color.LIGHT_GRAY);
try {
report()//create new report design
.setColumnTitleStyle(columnTitleStyle)
.highlightDetailEvenRows()
.columns(//add columns
// title, field name data type
col.column("Item", "item", type.stringType()),
col.column("Quantity", "quantity", type.integerType()),
col.column("Unit price", "unitprice", type.bigDecimalType()))
.title(cmp.text("Getting started").setStyle(boldCenteredStyle))//shows report title
.pageFooter(cmp.pageXofY().setStyle(boldCenteredStyle))//shows number of page at page footer
.setDataSource(createDataSource())//set datasource
.show();//create and show report
} catch (DRException e) {
e.printStackTrace();
}
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:24,代码来源:SimpleReport_Step02.java
示例11: createTitle
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的package包/类
private static ComponentBuilder<?, ?> createTitle(String lastName, String firstName)
{
final VerticalListBuilder list = cmp.verticalList();
list.add(cmp.text("Statement of Giving").setStyle(stl.style().bold()).setHorizontalAlignment(HorizontalAlignment.CENTER));
list.add(cmp.horizontalList()
.setStyle(stl.style(10).setHorizontalAlignment(HorizontalAlignment.LEFT))
.setGap(50)
.add(cmp.hListCell(createNameComponent(lastName, firstName)).heightFixedOnTop())
.add(cmp.hListCell(createChurchAddressComponent()).heightFixedOnTop()),
cmp.verticalGap(10));
return list;
}
开发者ID:jefflward,项目名称:First-Fruits,代码行数:14,代码来源:GivingStatementWriter.java
示例12: createTitleComponent
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的package包/类
/**
* Creates custom component which is possible to add to any report band component
*/
public static ComponentBuilder<?, ?> createTitleComponent(String label) {
return cmp
.horizontalList()
.add(dynamicReportsComponent,
cmp.text(label).setStyle(bold18CenteredStyle).setHorizontalAlignment(HorizontalAlignment.RIGHT))
.newRow().add(cmp.line()).newRow().add(cmp.verticalGap(10));
}
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:11,代码来源:Templates.java
示例13: buildOneColumn
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void buildOneColumn(Map<String, ValueColumnBuilder> columnMap, FieldPojo field) {
try {
TextColumnBuilder t_column = col.column(field.getDisplayName(), field.getField(),
(DRIDataType) type.detectType(field.getDataType()));
t_column.setFieldName(field.getField());
if (StringUtils.isNotBlank(field.getPattern())) {
t_column.setPattern(field.getPattern());
}
if (field.getWidth() > 0) {
t_column.setFixedWidth(field.getWidth());
}
if (!Strings.isNullOrEmpty(field.getHeadGroup())) {
// TODO TEST
// t_column.setFixedHeight(20);
// t_column.setFixedWidth(0);
}
if (StringUtils.isNotBlank(field.getAlignment())) {
t_column.setHorizontalAlignment(HorizontalAlignment.valueOf(field.getAlignment()));
}
if (StringUtils.isNotBlank(field.getUrl())) {
HyperLinkBuilder hyperLink = DynamicReports.hyperLink(field.getUrl());
t_column.setHyperLink(hyperLink);
}
columnMap.put(field.getField(), t_column);
if (1 == field.getIsPercentage()) {
PercentageColumnBuilder t_percentageColumn = col.percentageColumn(field.getDisplayName() + "[%]",
t_column);
t_percentageColumn.setFieldName(field.getField());
columnMap.put(field.getField4Percentage(), t_percentageColumn);
}
} catch (DRException e) {
logger.error(e.getMessage(), e);
}
}
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:40,代码来源:ColumnBuilder.java
示例14: addGroups
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes" })
protected static void addGroups(JasperReportBuilder report, Map<String, ValueColumnBuilder> columns,
Map<String, FieldPojo> fields) {
for (ValueColumnBuilder t_column : columns.values()) {
if (!(t_column instanceof TextColumnBuilder)) {
continue;
}
FieldPojo t_fieldPojo = fields.get(t_column.getColumn().getName());
if (null != t_fieldPojo && 1 == t_fieldPojo.getIsGroup()) {
StyleBuilder t_groupStyle = stl.style().bold();
// group没有格
// t_groupStyle.setBorder(stl.pen(0.2f, LineStyle.SOLID));
if (StringUtils.isNotBlank(t_fieldPojo.getGroupAlignment())) {
t_groupStyle.setAlignment(HorizontalAlignment.valueOf(t_fieldPojo.getGroupAlignment()),
VerticalAlignment.MIDDLE);
t_column.setHorizontalAlignment(HorizontalAlignment.valueOf(t_fieldPojo.getGroupAlignment()));
}
ColumnGroupBuilder t_columnGroup = grp.group(t_column).setStyle(t_groupStyle)
.setTitleStyle(t_groupStyle);
// 显示key:value形式
t_columnGroup.setHeaderLayout(GroupHeaderLayout.VALUE);// GroupHeaderLayout.TITLE_AND_VALUE
report.groupBy(t_columnGroup);
// 分组汇总
addSubtotal(report, columns, fields, t_columnGroup);
}
}
}
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:28,代码来源:ReportBuilder.java
示例15: createTitleComponent
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的package包/类
/**
* Creates custom component which is possible to add to any report band component
*/
public static ComponentBuilder<?, ?> createTitleComponent(String label) {
return cmp.horizontalList()
.add(
dynamicReportsComponent,
cmp.text(label).setStyle(bold18CenteredStyle).setHorizontalAlignment(HorizontalAlignment.RIGHT))
.newRow()
.add(cmp.line())
.newRow()
.add(cmp.verticalGap(10));
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:14,代码来源:Templates.java
示例16: build
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的package包/类
private void build() {
StyleBuilder boldStyle = stl.style().bold();
StyleBuilder boldCenteredStyle = stl.style(boldStyle).setHorizontalAlignment(HorizontalAlignment.CENTER);
StyleBuilder columnTitleStyle = stl.style(boldCenteredStyle)
.setBorder(stl.pen1Point())
.setBackgroundColor(Color.LIGHT_GRAY);
// title, field name data type
TextColumnBuilder<String> itemColumn = col.column("Item", "item", type.stringType()).setStyle(boldStyle);
TextColumnBuilder<Integer> quantityColumn = col.column("Quantity", "quantity", type.integerType());
TextColumnBuilder<BigDecimal> unitPriceColumn = col.column("Unit price", "unitprice", type.bigDecimalType());
//price = unitPrice * quantity
TextColumnBuilder<BigDecimal> priceColumn = unitPriceColumn.multiply(quantityColumn).setTitle("Price");
PercentageColumnBuilder pricePercColumn = col.percentageColumn("Price %", priceColumn);
TextColumnBuilder<Integer> rowNumberColumn = col.reportRowNumberColumn("No.")
//sets the fixed width of a column, width = 2 * character width
.setFixedColumns(2)
.setHorizontalAlignment(HorizontalAlignment.CENTER);
try {
report()//create new report design
.setColumnTitleStyle(columnTitleStyle)
.setSubtotalStyle(boldStyle)
.highlightDetailEvenRows()
.columns(//add columns
rowNumberColumn, itemColumn, quantityColumn, unitPriceColumn, priceColumn, pricePercColumn)
.groupBy(itemColumn)
.subtotalsAtSummary(
sbt.sum(unitPriceColumn), sbt.sum(priceColumn))
.subtotalsAtFirstGroupFooter(
sbt.sum(unitPriceColumn), sbt.sum(priceColumn))
.title(cmp.text("Getting started").setStyle(boldCenteredStyle))//shows report title
.pageFooter(cmp.pageXofY().setStyle(boldCenteredStyle))//shows number of page at page footer
.setDataSource(createDataSource())//set datasource
.show();//create and show report
} catch (DRException e) {
e.printStackTrace();
}
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:39,代码来源:SimpleReport_Step05.java
示例17: getHorizontalAlignment
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的package包/类
public static HorizontalAlignment getHorizontalAlignment(DRDesignStyle style) {
if (style == null) {
return null;
}
if (style.getHorizontalAlignment() != null) {
return style.getHorizontalAlignment();
}
if (style.getParentStyle() != null) {
return getHorizontalAlignment(style.getParentStyle());
}
return null;
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:13,代码来源:StyleResolver.java
示例18: getTextFieldHorizontalAlignment
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的package包/类
protected HorizontalAlignment getTextFieldHorizontalAlignment(DRITextField<?> textField, DRDesignStyle style) {
if (textField.getHorizontalAlignment() != null) {
return textField.getHorizontalAlignment();
}
if (StyleResolver.getHorizontalAlignment(style) != null) {
return null;//StyleResolver.getHorizontalAlignment(style);
}
if (textField.getDataType() != null) {
return textField.getDataType().getHorizontalAlignment();
}
return null;
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:13,代码来源:TemplateTransform.java
示例19: getPageXofYHorizontalAlignment
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的package包/类
protected HorizontalAlignment getPageXofYHorizontalAlignment(DRIPageXofY pageXofY, DRDesignStyle style) {
if (pageXofY.getHorizontalAlignment() != null) {
return pageXofY.getHorizontalAlignment();
}
if (StyleResolver.getHorizontalAlignment(style) != null) {
return StyleResolver.getHorizontalAlignment(style);
}
return Defaults.getDefaults().getPageXofYHorizontalAlignment();
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:10,代码来源:TemplateTransform.java
示例20: getBooleanHorizontalAlignment
import net.sf.dynamicreports.report.constant.HorizontalAlignment; //导入依赖的package包/类
protected HorizontalAlignment getBooleanHorizontalAlignment(DRIBooleanField booleanField, DRDesignStyle style) {
if (booleanField.getHorizontalAlignment() != null) {
return booleanField.getHorizontalAlignment();
}
if (StyleResolver.getHorizontalAlignment(style) != null) {
return null;//StyleResolver.getHorizontalAlignment(style);
}
return Defaults.getDefaults().getBooleanType().getHorizontalAlignment();
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:10,代码来源:TemplateTransform.java
注:本文中的net.sf.dynamicreports.report.constant.HorizontalAlignment类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论