本文整理汇总了Java中ro.nextreports.engine.queryexec.QueryException类的典型用法代码示例。如果您正苦于以下问题:Java QueryException类的具体用法?Java QueryException怎么用?Java QueryException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QueryException类属于ro.nextreports.engine.queryexec包,在下文中一共展示了QueryException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initHiddenParameterValues
import ro.nextreports.engine.queryexec.QueryException; //导入依赖的package包/类
private void initHiddenParameterValues(QueryParameter qp) {
if ((qp.getDefaultValues() != null) && (qp.getDefaultValues().size() > 0)) {
if (qp.getDefaultValues().size() == 1) {
parametersValues.put(qp.getName(),qp.getDefaultValues().get(0));
} else {
parametersValues.put(qp.getName(), qp.getDefaultValues().toArray());
}
} else if ((qp.getDefaultSource() != null) && !qp.getDefaultSource().trim().equals("")) {
try {
ParameterUtil.initDefaultParameterValues(con, qp, parametersValues);
} catch (QueryException e) {
LOG.error(e.getMessage(), e);
e.printStackTrace();
}
}
}
示例2: initCache
import ro.nextreports.engine.queryexec.QueryException; //导入依赖的package包/类
private void initCache(QueryResult result) throws QueryException {
if (result == null) {
return;
}
/*
* place all data in an array list of Object[] arrays
* I don't use an Object[][] because we don't know
* how many rows are in the result set
*/
while (result.hasNext()) {
if (stop) {
break;
}
Object[] row = new Object[result.getColumnCount()];
for (int i = 0; i < row.length; i++) {
row[i] = result.nextValue(i);
}
cache.add(row);
}
}
示例3: createPieChart
import ro.nextreports.engine.queryexec.QueryException; //导入依赖的package包/类
private Element[] createPieChart(boolean showXLabel, boolean showYLabel) throws QueryException {
Element[] charts = new Element[1];
PieChart pieChart = new PieChart();
pieChart.setAnimate(true);
pieChart.setStartAngle(35);
pieChart.setBorder(2);
List<AnimationPie> animations = new ArrayList<AnimationPie>();
animations.add(new AnimationPie.Fade());
animations.add(new AnimationPie.Bounce(10));
pieChart.addAnimations(animations);
pieChart.setGradientFill(true);
pieChart.setAlpha(getAlpha(chart.getTransparency()));
List<String> colors = new ArrayList<String>();
for (Color color : chart.getForegrounds()) {
colors.add(getHexColor(color));
}
pieChart.setColours(colors.toArray(new String[10]));
pieChart.setTooltip("#val# of #total#<br>#percent# of 100%");
pieChart.setFontSize(chart.getFont().getSize());
charts[0] = pieChart;
createChart(null, null, showXLabel, showYLabel, new Element[]{pieChart});
return charts;
}
示例4: setElements
import ro.nextreports.engine.queryexec.QueryException; //导入依赖的package包/类
private void setElements(ro.nextreports.jofc2.model.Chart flashChart, XAxis xAxis, YAxis yAxis,
boolean showXLabel, boolean showYLabel) throws QueryException {
byte type = chart.getType().getType();
Element[] charts = new Element[0];
if ((ChartType.BAR == type) || (ChartType.NEGATIVE_BAR == type)) {
charts = createBarChart(xAxis, yAxis, showXLabel, showYLabel);
} else if (ChartType.HORIZONTAL_BAR == type) {
charts = createHorizontalBarChart(xAxis, yAxis, showXLabel, showYLabel);
} else if (ChartType.STACKED_BAR == type) {
charts = createStackedBarChart(xAxis, yAxis, showXLabel, showYLabel);
} else if (ChartType.PIE == type) {
charts = createPieChart(showXLabel, showYLabel);
} else if (ChartType.LINE == type) {
charts = createLineChart(xAxis, yAxis, showXLabel, showYLabel);
} else if (ChartType.AREA == type) {
charts = createAreaChart(xAxis, yAxis, showXLabel, showYLabel);
}
for (Element element : charts) {
flashChart.addElements(element);
}
}
示例5: initExport
import ro.nextreports.engine.queryexec.QueryException; //导入依赖的package包/类
protected void initExport() throws QueryException {
if (hasTemplate()) {
try {
if (bean.getReportLayout().getTemplateName().endsWith(".xlsm")) {
wb = new XSSFWorkbook(OPCPackage.open(getTemplateInputStream()));
} else {
wb = new XSSFWorkbook(getTemplateInputStream());
}
} catch (Exception e) {
e.printStackTrace();
LOG.error(e.getMessage(), e);
wb = new XSSFWorkbook();
}
} else {
wb = new XSSFWorkbook();
}
}
示例6: initExport
import ro.nextreports.engine.queryexec.QueryException; //导入依赖的package包/类
protected void initExport() throws QueryException {
stream = createPrintStream();
if (!bean.isSubreport()) {
String style = buildHtmlStyle(getReportLayout());
stream.print("<html><head>\n");
stream.print("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n");
stream.print(getMetaData());
stream.print("<title>");
stream.print(getDocumentTitle());
stream.print("</title>\n" + style + " \n</head> ");
if (bean.getReportLayout().getBackgroundImage() != null) {
stream.print("<body style=\"background-image:url(");
stream.print(bean.getReportLayout().getBackgroundImage());
stream.print(")\">\n");
} else {
stream.print("<body>\n");
}
}
if (bean.getReportLayout().isUseSize()) {
stream.print("<table>");
} else {
stream.print("<table style='width:100%'>");
}
}
示例7: computeFooterHeight
import ro.nextreports.engine.queryexec.QueryException; //导入依赖的package包/类
private float computeFooterHeight() throws QueryException {
footer = buildPdfTable(PRINT_PAGE_FOOTER);
if (footer == null) {
return 0;
}
printPageFooterBand();
float height = 0;
ArrayList<PdfPRow> rows = footer.getRows();
for (int k = 0; k < rows.size(); k++) {
PdfPRow row = rows.get(k);
PdfPCell[] cells = row.getCells();
float rowHeight = 0;
for (PdfPCell cell : cells) {
if (cell == null) {
rowHeight = Math.max(rowHeight, MINIMUM_HEIGHT);
} else {
rowHeight = Math.max(rowHeight, cell.getMaxHeight());
}
}
height += rowHeight;
}
return height;
}
示例8: printRawRecord
import ro.nextreports.engine.queryexec.QueryException; //导入依赖的package包/类
protected void printRawRecord() throws QueryException {
QueryResult qr = getResult();
int columns = qr.getColumnCount();
stream.print("\t<" + RECORD_TAG + ">");
stream.print(lineSeparator);
for (int i = 0; i < columns; i++) {
String name = qr.getColumnName(i);
Object value = qr.nextValue(name);
// xml tags do not allow space characters
name = name.replaceAll(" ", space);
stream.print("\t\t<");
stream.print(name);
stream.print(">");
stream.print(value);
stream.print("</");
stream.print(name);
stream.print(">");
stream.print(lineSeparator);
}
stream.print("\t</" + RECORD_TAG + ">");
stream.print(lineSeparator);
}
示例9: initExport
import ro.nextreports.engine.queryexec.QueryException; //导入依赖的package包/类
@Override
protected void initExport() throws QueryException {
try {
factory = Context.getWmlObjectFactory();
for (int i=0; i<bean.getReportLayout().getColumnCount(); i++) {
rowSpanForColumn.put(i, 1);
}
if (!bean.isSubreport()) {
boolean landscape = (bean.getReportLayout().getOrientation() == LANDSCAPE);
wordMLPackage = WordprocessingMLPackage.createPackage(PageSizePaper.A4, landscape);
setPageMargins();
addMetadata();
}
table = createTable(PRINT_DOCUMENT);
} catch (InvalidFormatException e) {
e.printStackTrace();
throw new QueryException(e);
}
}
示例10: newPage
import ro.nextreports.engine.queryexec.QueryException; //导入依赖的package包/类
@Override
protected void newPage() {
flushNow();
Br objBr = new Br();
objBr.setType(STBrType.PAGE);
P para = createParagraph();
para.getContent().add(objBr);
wordMLPackage.getMainDocumentPart().getContent().add(para);
if (bean.getReportLayout().isHeaderOnEveryPage()) {
try {
printHeaderBand();
newRow = true;
} catch (QueryException e) {
e.printStackTrace();
}
}
}
示例11: getBandElementValueAsString
import ro.nextreports.engine.queryexec.QueryException; //导入依赖的package包/类
protected String getBandElementValueAsString(BandElement bandElement) {
String pattern = getPattern(bandElement);
if (bandElement instanceof ExpressionBandElement) {
Object value = null;
try {
value = evaluateExpression((ExpressionBandElement)bandElement, currentBandName, null);
} catch (QueryException e) {
LOG.error(e.getMessage(), e);
}
I18nLanguage lang = I18nUtil.getLanguageByName(bean.getReportLayout(), bean.getLanguage());
return StringUtil.getValueAsString(value, pattern, lang);
} else if (bandElement instanceof VariableBandElement) {
return getStringValue((VariableBandElement)bandElement, currentBandName);
} else {
return getStringValue(bandElement, pattern);
}
}
示例12: init
import ro.nextreports.engine.queryexec.QueryException; //导入依赖的package包/类
public void init() {
try {
initCache(result);
} catch (QueryException e) {
LOG.error(e.getMessage(), e);
// TODO
throw new RuntimeException(e);
}
}
示例13: createPieChart
import ro.nextreports.engine.queryexec.QueryException; //导入依赖的package包/类
private JFreeChart createPieChart() throws QueryException {
pieDataset = new DefaultPieDataset();
String chartTitle = replaceParameters(chart.getTitle().getTitle());
chartTitle = StringUtil.getI18nString(chartTitle, I18nUtil.getLanguageByName(chart, language));
JFreeChart jfreechart = ChartFactory.createPieChart(
chartTitle,
pieDataset,
true,
true,
false);
// hide border
jfreechart.setBorderVisible(false);
// title
setTitle(jfreechart);
PiePlot plot = (PiePlot)jfreechart.getPlot();
plot.setForegroundAlpha(transparency);
// a start angle used to create similarities between flash chart and this jfreechart
plot.setStartAngle(330);
// legend label will contain the text and the value
plot.setLegendLabelGenerator(new StandardPieSectionLabelGenerator("{0} = {1}"));
// no shadow
plot.setShadowXOffset(0);
plot.setShadowYOffset(0);
DecimalFormat decimalformat;
DecimalFormat percentageFormat;
if (chart.getYTooltipPattern() == null) {
decimalformat = new DecimalFormat("#");
percentageFormat = new DecimalFormat("0.00%");
} else {
decimalformat = new DecimalFormat(chart.getYTooltipPattern());
percentageFormat = decimalformat;
}
boolean showValues = (chart.getShowYValuesOnChart() == null) ? false : chart.getShowYValuesOnChart();
if (showValues) {
// label will contain also the percentage formatted with two decimals
plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} ({2})", decimalformat, percentageFormat));
}
// chart background
plot.setBackgroundPaint(chart.getBackground());
createChart(null, new Object[1]);
// after chart creation we can set slices colors
List <Comparable> keys = pieDataset.getKeys();
List<Color> colors = chart.getForegrounds();
for (int i = 0, size = colors.size(); i < keys.size(); i++) {
plot.setSectionPaint(keys.get(i), colors.get(i % size));
plot.setLabelFont(chart.getFont());
}
return jfreechart;
}
示例14: testForData
import ro.nextreports.engine.queryexec.QueryException; //导入依赖的package包/类
private void testForData() throws QueryException, NoDataFoundException {
// for procedure call we do not know the row count (is -1)
if (this.out == null || result == null
|| result.getColumnCount() <= 0
|| result.getRowCount() == 0) {
throw new NoDataFoundException();
}
}
示例15: createPrintStream
import ro.nextreports.engine.queryexec.QueryException; //导入依赖的package包/类
protected PrintStream createPrintStream() throws QueryException {
try {
return new PrintStream(out, false, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new QueryException(e);
}
}