本文整理汇总了Java中net.sf.dynamicreports.report.exception.DRException类的典型用法代码示例。如果您正苦于以下问题:Java DRException类的具体用法?Java DRException怎么用?Java DRException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DRException类属于net.sf.dynamicreports.report.exception包,在下文中一共展示了DRException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: exportDoc
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
public void exportDoc(JasperReportBuilder report) throws FileNotFoundException {
try {
// 生成PDF文件
report.toDocx(new FileOutputStream("d:/test/report.docx"));
report.toImage(new FileOutputStream("d:/test/report.png"), ImageType.PNG);
report.toPdf(new FileOutputStream("d:/test/report.pdf"));
report.toXlsx(new FileOutputStream("d:/test/report.xlsx"));
// report.toHtml(new FileOutputStream("d:/test/report.html"))
;
JasperHtmlExporterBuilder htmlExporter = export.htmlExporter(new FileOutputStream("d:/test/report.html"))
.setImagesURI("image?image=");
report.toHtml(htmlExporter);
// 显示报表
report.show();
} catch (DRException e) {
e.printStackTrace();
}
}
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:22,代码来源:SimpleReport_Step12.java
示例2: generate
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
@VisibleForTesting
@NotNull
static JasperReportBuilder generate(@NotNull final SequencedPatientReport report) throws IOException, DRException {
final EvidenceReportData evidenceReportData = ImmutableEvidenceReportData.of(report.civicAlterations());
// @formatter:off
final VerticalListBuilder totalReport = cmp.verticalList(
MainPageTopSection.build("HMF Civic Evidence Supplement", report.sampleReport()),
cmp.verticalGap(SECTION_VERTICAL_GAP),
cmp.text("Knowledgebase drug association of reported genomic alterations").setStyle(sectionHeaderStyle().setFontSize(15)),
cmp.verticalGap(SECTION_VERTICAL_GAP),
conciseEvidenceSection(),
cmp.verticalGap(SECTION_VERTICAL_GAP),
cmp.text("Civic matching variants").setStyle(sectionHeaderStyle()),
cmp.verticalGap(SECTION_VERTICAL_GAP),
civicMatchingVariantsTable(),
cmp.verticalGap(SECTION_VERTICAL_GAP));
// @formatter:on
return report().addDetail(totalReport).setDataSource(evidenceReportData.toDataSource());
}
开发者ID:hartwigmedical,项目名称:hmftools,代码行数:23,代码来源:EvidenceReport.java
示例3: getOS
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
/**
* Preparing an output stream of the generated PDF invoice.
*
* @return
*/
public OutputStream getOS(ServletContext context, OutputStream outputStream) {
parameters.put("IMAGE_PATH", context.getRealPath("/jasper/invoices"));
InputStream is = context.getResourceAsStream("/jasper/invoices/" + invoiceName);
try {
report().setTemplateDesign(is)
.setDataSource(beanCollectionDataSource)
.setParameters(parameters).toPdf(outputStream);
} catch (DRException e) {
e.printStackTrace();
}
return outputStream;
}
开发者ID:belalgalal,项目名称:Blogging,代码行数:22,代码来源:DynamicReportsManagedBean.java
示例4: concatenatedExportTest
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Test
public void concatenatedExportTest() {
try {
concatenatedReport.toPng(new ByteArrayOutputStream());
concatenatedReport.toCsv(new ByteArrayOutputStream());
concatenatedReport.toDocx(new ByteArrayOutputStream());
concatenatedReport.toHtml(new ByteArrayOutputStream());
concatenatedReport.toOds(new ByteArrayOutputStream());
concatenatedReport.toOdt(new ByteArrayOutputStream());
concatenatedReport.toPdf(new ByteArrayOutputStream());
concatenatedReport.toRtf(new ByteArrayOutputStream());
concatenatedReport.toText(new ByteArrayOutputStream());
concatenatedReport.toXhtml(new ByteArrayOutputStream());
concatenatedReport.toExcelApiXls(new ByteArrayOutputStream());
concatenatedReport.toXls(new ByteArrayOutputStream());
concatenatedReport.toXlsx(new ByteArrayOutputStream());
concatenatedReport.toXml(new ByteArrayOutputStream());
concatenatedReport.toPptx(new ByteArrayOutputStream());
} catch (DRException e) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:25,代码来源:ExportTest.java
示例5: build
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
private void build() {
TextColumnBuilder<String> itemColumn = col.column("Item", "item", type.stringType());
TextColumnBuilder<Integer> quantityColumn = col.column("Quantity", "quantity", type.integerType());
TextColumnBuilder<BigDecimal> priceColumn = col.column("Unit price", "unitprice", type.bigDecimalType());
try {
report()
.setTemplate(Templates.reportTemplate)
.columns(
itemColumn, quantityColumn, priceColumn)
.noData(Templates.createTitleComponent("NoData"), cmp.text("There is no data"))
.setDataSource(createDataSource())
.show();
} catch (DRException e) {
e.printStackTrace();
}
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:18,代码来源:NoDataReport.java
示例6: getPrintList
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
@Override
public List<JasperPrint> getPrintList() throws DRException {
List<JasperPrint> printList = new ArrayList<JasperPrint>();
int pageNumber = 1;
for (JasperReportBuilder jasperReportBuilder : jasperReportBuilders) {
if (continuousPageNumbering) {
jasperReportBuilder.setStartPageNumber(pageNumber);
}
else {
jasperReportBuilder.setStartPageNumber(null);
}
JasperPrint jasperPrint = jasperReportBuilder.toJasperPrint();
printList.add(jasperPrint);
pageNumber += jasperPrint.getPages().size();
}
return printList;
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:18,代码来源:JasperReportBuilderHandler.java
示例7: test
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
@Test
public void test() {
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
bos = new ByteArrayOutputStream();
concatenatedReport.toCsv(bos);
Assert.assertEquals("concatenated report ", "text1\n1\ntext2\n2\ntext3\n3\n", new String(bos.toByteArray()));
concatenatedReport.setContinuousPageNumbering(false);
bos = new ByteArrayOutputStream();
concatenatedReport.toCsv(bos);
Assert.assertEquals("concatenated report ", "text1\n1\ntext2\n2\ntext3\n3\n", new String(bos.toByteArray()));
} catch (DRException e) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:18,代码来源:ConcatenatedReport3Test.java
示例8: rebuild
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
public JasperReportBuilder rebuild() throws DRException {
builded = false;
reportDesign = null;
jasperDesign = null;
jasperReport = null;
parameters = null;
jasperPrint = null;
if (dataSource != null && dataSource instanceof JRRewindableDataSource) {
try {
((JRRewindableDataSource) dataSource).moveFirst();
} catch (JRException e) {
throw new DRException(e);
}
}
return this;
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:17,代码来源:JasperReportBuilder.java
示例9: build
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
private void build() {
CustomGroupBuilder yearGroup = grp.group(new YearExpression());
try {
report()
.setTemplate(Templates.reportTemplate)
.columns(
col.column("Order date", "orderdate", type.stringType()),
col.column("Item", "item", type.stringType()),
col.column("Quantity", "quantity", type.integerType()),
col.column("Unit price", "unitprice", type.bigDecimalType()))
.groupBy(yearGroup)
.title(Templates.createTitleComponent("CustomGroup"))
.pageFooter(Templates.footerComponent)
.setDataSource(createDataSource())
.show();
} catch (DRException e) {
e.printStackTrace();
}
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:21,代码来源:CustomGroupReport.java
示例10: build
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
private void build() {
TextColumnBuilder<String> countryColumn = col.column("Country", "country", type.stringType());
TextColumnBuilder<String> itemColumn = col.column("Item", "item", type.stringType());
try {
report()
.setTemplate(Templates.reportTemplate)
.tableOfContents()
.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)
.title(Templates.createTitleComponent("TableOfContents1"))
.pageFooter(Templates.footerComponent)
.setDataSource(createDataSource())
.show();
} catch (DRException e) {
e.printStackTrace();
}
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:24,代码来源:TableOfContentsReport1.java
示例11: transformSort
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
private void transformSort(DRISort sort) throws DRException {
DRIDesignExpression expression = transformExpression(sort.getExpression());
DRIDesignExpression sortExpression;
if (expression instanceof DRIDesignField || expression instanceof DRIDesignVariable) {
sortExpression = expression;
}
else {
@SuppressWarnings({ "rawtypes", "unchecked" })
DRVariable variable = new DRVariable(sort.getExpression(), Calculation.NOTHING);
variable.setResetType(Evaluation.NONE);
sortExpression = transformExpression(variable);
}
DRDesignSort designSort = new DRDesignSort();
designSort.setExpression(sortExpression);
designSort.setOrderType(sort.getOrderType());
sorts.add(designSort);
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:20,代码来源:AbstractExpressionTransform.java
示例12: build
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
private void build() {
TextColumnBuilder<String> itemColumn = col.column("Item", "item", type.stringType())
.setStyle(stl.templateStyle("style1"));
TextColumnBuilder<Date> orderDateColumn = col.column("Order date", "orderdate", type.dateType())
.setStyle(stl.templateStyle("style2"));
TextColumnBuilder<Integer> quantityColumn = col.column("Quantity", "quantity", type.integerType());
TextColumnBuilder<BigDecimal> unitPriceColumn = col.column("Unit price", "unitprice", type.bigDecimalType());
try {
report()
.templateStyles(stl.loadStyles(TemplateStyleFileReport.class.getResource("TemplateStyles.jrtx")))
.setColumnStyle(stl.templateStyle("columnStyle"))
.setColumnTitleStyle(stl.templateStyle("columnTitleStyle"))
.columns(
itemColumn, orderDateColumn, quantityColumn, unitPriceColumn)
.title(Templates.createTitleComponent("TemplateStyleFile"))
.pageFooter(Templates.footerComponent)
.setDataSource(createDataSource())
.show();
} catch (DRException e) {
e.printStackTrace();
}
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:24,代码来源:TemplateStyleFileReport.java
示例13: transform
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
private DRDesignChart transform(DRIChart chart, DRIDataset subDataset, ResetType resetType, DRDesignGroup resetGroup) throws DRException {
DRDesignChart designChart = new DRDesignChart();
designChart.setWidth(accessor.getTemplateTransform().getChartWidth(chart));
designChart.setHeight(accessor.getTemplateTransform().getChartHeight(chart));
designChart.setChartType(chart.getChartType());
designChart.setTheme(accessor.getTemplateTransform().getChartTheme(chart));
if (!(chart.getPlot() instanceof DRIMultiAxisPlot)) {
designChart.setDataset(dataset(chart.getDataset(), subDataset, resetType, resetGroup));
}
designChart.setPlot(plot(chart.getPlot(), designChart.getCustomizers(), chart.getDataset().getSubDataset(), resetType, resetGroup));
designChart.setTitle(title(chart.getTitle()));
designChart.setSubtitle(subtitle(chart.getSubtitle()));
designChart.setLegend(legend(chart.getLegend()));
if (!chart.getCustomizers().isEmpty()) {
designChart.getCustomizers().addAll(chart.getCustomizers());
}
return designChart;
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:21,代码来源:ChartTransform.java
示例14: test
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
@Test
public void test() {
ReportBuilder<?> rb = new DesignReportBuilder();
configureReport(rb);
try {
DRDesignReport report = new DRDesignReport(rb.getReport());
titleBandTest(report.getTitleBand());
pageHeaderBandTest(report.getPageHeaderBand());
pageFooterBandTest(report.getPageFooterBand());
columnHeaderBandTest(report.getColumnHeaderBand());
columnFooterBandTest(report.getColumnFooterBand());
for (DRDesignBand designBand : report.getDetailBands()) {
detailBandTest(designBand);
}
lastPageFooterBandTest(report.getLastPageFooterBand());
summaryBandTest(report.getSummaryBand());
noDataBandTest(report.getNoDataBand());
backgroundBandTest(report.getBackgroundBand());
} catch (DRException e) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:24,代码来源:AbstractBandTest.java
示例15: build
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
private void build() {
TextColumnBuilder<String> itemColumn = col.column("Item", "item", type.stringType());
TextColumnBuilder<Integer> quantityColumn = col.column("Quantity", "quantity", type.integerType());
TextColumnBuilder<BigDecimal> priceColumn = col.column("Unit price", "unitprice", type.bigDecimalType());
try {
report()
.setTemplate(Templates.reportTemplate)
.columns(
itemColumn, quantityColumn, priceColumn)
.title(Templates.createTitleComponent("Virtualizer"))
.pageFooter(Templates.footerComponent)
.setDataSource(createDataSource())
.setVirtualizer(new JRFileVirtualizer(2))
.show();
} catch (DRException e) {
e.printStackTrace();
}
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:20,代码来源:VirtualizerReport.java
示例16: build
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
private void build() {
try {
JasperReportBuilder report = DynamicReports.report();
report.addColumn(Columns.column("Item", "item", DataTypes.stringType()));
report.addColumn(Columns.column("Quantity", "quantity", DataTypes.integerType()));
report.addColumn(Columns.column("Unit price", "unitprice", DataTypes.bigDecimalType()));
report.addTitle(Components.text("Getting started"));
report.addPageFooter(Components.pageXofY());
report.setDataSource(createDataSource());
report.show();
} catch (DRException e) {
e.printStackTrace();
}
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:15,代码来源:SimpleReport_ClassicSyntax.java
示例17: build
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
private void build() {
FontBuilder boldFont = stl.fontArialBold().setFontSize(12);
try {
report()
.setTemplate(Templates.reportTemplate)
.title(Templates.createTitleComponent("DifferenceChart"))
.summary(
cht.differenceChart()
.setTitle("Difference chart")
.setTitleFont(boldFont)
.setTimePeriod(field("date", type.dateType()))
.setTimePeriodType(TimePeriod.DAY)
.series(
cht.serie(field("value1", type.doubleType())).setLabel("Value1"),
cht.serie(field("value2", type.doubleType())).setLabel("Value2"))
.setTimeAxisFormat(
cht.axisFormat().setLabel("Date")))
.pageFooter(Templates.footerComponent)
.setDataSource(createDataSource())
.show();
} catch (DRException e) {
e.printStackTrace();
}
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:26,代码来源:DifferenceChartReport.java
示例18: build
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
private void build() {
SubreportBuilder subreport = cmp.subreport(new SubreportDesign())
.setDataSource(new SubreportData());
try {
report()
.setTemplate(Templates.reportTemplate)
.fields(field("comments", List.class))
.columns(
col.column("Item", "item", type.stringType()),
col.column("Quantity", "quantity", type.integerType()),
col.componentColumn("Comments", subreport))
.title(Templates.createTitleComponent("ColumnSubreportData"))
.pageFooter(Templates.footerComponent)
.setDataSource(createDataSource())
.show();
} catch (DRException e) {
e.printStackTrace();
}
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:20,代码来源:ColumnSubreportDataReport.java
示例19: init
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
private void init(JasperDesign jasperDesign) throws DRException {
Validate.notNull(jasperDesign, "jasperDesign must not be null");
this.jasperDesign = jasperDesign;
this.fields = new ArrayList<DRIField<?>>();
for (JRField jrField : jasperDesign.getFields()) {
@SuppressWarnings({ "unchecked", "rawtypes" })
DRField<?> field = new DRField(jrField.getName(), jrField.getValueClass());
fields.add(field);
}
this.margin = new DRMargin();
margin.setTop(jasperDesign.getTopMargin());
margin.setLeft(jasperDesign.getLeftMargin());
margin.setBottom(jasperDesign.getBottomMargin());
margin.setRight(jasperDesign.getRightMargin());
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:18,代码来源:JasperTemplateDesign.java
示例20: build
import net.sf.dynamicreports.report.exception.DRException; //导入依赖的package包/类
private void build() {
FontBuilder boldFont = stl.fontArialBold().setFontSize(12);
TextColumnBuilder<String> itemColumn = col.column("Item", "item", type.stringType());
TextColumnBuilder<Integer> quantityColumn = col.column("Quantity", "quantity", type.integerType());
TextColumnBuilder<BigDecimal> unitPriceColumn = col.column("Unit price", "unitprice", type.bigDecimalType());
try {
report()
.setTemplate(Templates.reportTemplate)
.columns(itemColumn, quantityColumn, unitPriceColumn)
.title(Templates.createTitleComponent("PieChart"))
.summary(
cht.pieChart()
.setTitle("Pie chart")
.setTitleFont(boldFont)
.setKey(itemColumn)
.series(
cht.serie(unitPriceColumn)))
.pageFooter(Templates.footerComponent)
.setDataSource(createDataSource())
.show();
} catch (DRException e) {
e.printStackTrace();
}
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:27,代码来源:PieChartReport.java
注:本文中的net.sf.dynamicreports.report.exception.DRException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论