本文整理汇总了Java中ro.nextreports.engine.Report.getLayout方法的典型用法代码示例。如果您正苦于以下问题:Java Report.getLayout方法的具体用法?Java Report.getLayout怎么用?Java Report.getLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ro.nextreports.engine.Report
的用法示例。
在下文中一共展示了Report.getLayout方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: copyTemplate
import ro.nextreports.engine.Report; //导入方法依赖的package包/类
public static void copyTemplate(Report report, File directory) throws IOException {
ReportLayout layout = LayoutHelper.getReportLayout();
if (report != null) {
// run report from tree (without open)
layout = report.getLayout();
}
String templateName = layout.getTemplateName();
if ((templateName != null) && !"".equals(templateName.trim())) {
String fromPath = Globals.getCurrentReportAbsolutePath();
if (fromPath == null) {
fromPath = Globals.getTreeReportAbsolutePath();
}
FileUtil.copyToDir(new File(new File(fromPath).getParentFile().getAbsolutePath() + File.separator + templateName),
directory, true);
}
}
示例2: deleteImages
import ro.nextreports.engine.Report; //导入方法依赖的package包/类
public static void deleteImages(Report report) {
ReportLayout layout = LayoutHelper.getReportLayout();
if (report != null) {
// run report from tree (without open)
layout = report.getLayout();
}
List<Band> bands = layout.getBands();
for (Band band : bands) {
for (int i=0, rows = band.getRowCount(); i<rows; i++) {
List<BandElement> list = band.getRow(i);
for (BandElement be : list) {
if (be instanceof ImageBandElement) {
String image = ((ImageBandElement)be).getImage();
deleteImage(image);
}
}
}
}
if (layout.getBackgroundImage() != null) {
deleteImage(layout.getBackgroundImage());
}
}
示例3: getStaticImages
import ro.nextreports.engine.Report; //导入方法依赖的package包/类
/**
* Get static images used by report
*
* @param report
* report
* @return a list of static images used by report
*/
public static List<String> getStaticImages(Report report) {
List<String> images = new ArrayList<String>();
ReportLayout layout = report.getLayout();
List<Band> bands = layout.getBands();
for (Band band : bands) {
for (int i = 0, rows = band.getRowCount(); i < rows; i++) {
List<BandElement> list = band.getRow(i);
for (BandElement be : list) {
if ((be instanceof ImageBandElement) && !(be instanceof ChartBandElement)
&& !(be instanceof BarcodeBandElement)) {
images.add(((ImageBandElement) be).getImage());
}
}
}
}
if (layout.getBackgroundImage() != null) {
images.add(layout.getBackgroundImage());
}
return images;
}
示例4: getUsedColumns
import ro.nextreports.engine.Report; //导入方法依赖的package包/类
public static Set<String> getUsedColumns(Report report) {
Set<String> columns = new HashSet<String>();
ReportLayout layout;
if (report == null) {
layout = LayoutHelper.getReportLayout();
} else {
layout = report.getLayout();
}
List<Band> bands = layout.getBands();
for (Band band : bands) {
int rows = band.getRowCount();
int cols = band.getColumnCount();
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
BandElement bandElement = band.getElementAt(i, j);
if (bandElement instanceof ColumnBandElement) {
columns.add(((ColumnBandElement) bandElement).getColumn());
} else if (bandElement instanceof FunctionBandElement) {
columns.add(((FunctionBandElement) bandElement).getColumn());
} else if (bandElement instanceof ExpressionBandElement) {
columns.add(((ExpressionBandElement) bandElement).getExpressionName());
}
}
}
}
return columns;
}
示例5: getNotFoundColumns
import ro.nextreports.engine.Report; //导入方法依赖的package包/类
public static Set<String> getNotFoundColumns(Report report, DataSource ds) throws Exception {
List<String> columns = ReportLayoutUtil.getAllColumnNamesForReport(report, ds);
Set<String> usedColumns = BandUtil.getUsedColumns(report);
usedColumns.removeAll(columns);
ReportLayout layout;
if (report == null) {
layout = LayoutHelper.getReportLayout();
} else {
layout = report.getLayout();
}
usedColumns.removeAll(ReportUtil.getExpressionsNames(layout));
return usedColumns;
}
示例6: getNotFoundColumnsUsedByGroups
import ro.nextreports.engine.Report; //导入方法依赖的package包/类
public static Set<String> getNotFoundColumnsUsedByGroups(Report report, DataSource ds) throws Exception {
List<String> columns = ReportLayoutUtil.getAllColumnNamesForReport(report, ds);
ReportLayout layout;
if (report == null) {
layout = LayoutHelper.getReportLayout();
} else {
layout = report.getLayout();
}
Set<String> usedColumns = ReportLayoutUtil.getAllColumnNamesUsedByGroupes(layout);
usedColumns.removeAll(columns);
return usedColumns;
}