Package reportgen.utils

Examples of reportgen.utils.ReportException


            while (res instanceof UserInputChunk) {
                UserInputChunk chunk = (UserInputChunk) res;
                dlg.addPanel(new UserInputPanel(chunk));
                dlg.setVisible(true);
                if (!dlg.isOK()) {
                    throw new ReportException("Генерация отчета отменена");
                }
                res = report.continueReport(chunk);
            }
            results = (QueryResults) res;
            System.out.println("Generation DONE");
View Full Code Here


        }
        if(range instanceof ColRowRangeCrossReport) {
            return new CrossReportProcessor(parent, (ColRowRangeCrossReport)range, originalPosition);
        }

        throw new ReportException("Неизвестый формат диапазона");
    }
View Full Code Here

        if(cls != null) {
            if (cls.equals(Long.class) || cls.equals(Double.class)) {
                return Double.class;
            }
        }
        throw new ReportException("Некорректный аргумент оператора '" + title + "'");
    }
View Full Code Here

                } else if(iVal instanceof Double) {
                    sum += (Double)iVal;

                } else {
                    throw new ReportException("Аргумент функции AVG имеет некоректный тип");
                }
                count++;
            }

            @Override
View Full Code Here

        if(cls != null) {
            if (cls.equals(Long.class) || cls.equals(Double.class)) {
                return cls;
            }
        }
        throw new ReportException("Некорректный аргумент оператора '" + title + "'");
    }
View Full Code Here

               if(extremum != null) {
                    if(!iVal.getClass().equals(extremum.getClass())
                            || (!iVal.getClass().equals(Long.class)
                                && !iVal.getClass().equals(Double.class))) {
                        throw new ReportException("Функция MIN или MAX в задана неправильно");
                    }
                } else {
                    extremum = iVal;
                    return;
                }
View Full Code Here

        if(cls != null) {
            if (cls.equals(Long.class) || cls.equals(Double.class)) {
                return cls;
            }
        }
        throw new ReportException("Некорректный аргумент оператора '" + title + "'");
    }
View Full Code Here

                    } else {
                        sum = (Double)iVal + (Long)sum;
                    }

                } else {
                    throw new ReportException("Аргумент функции SUM имеет некоректный тип");
                }
            }

            @Override
            public Object calculate() {
View Full Code Here

     */
    @Override
    public void appendToQuery(SQLStream sql) throws ReportException {
        String results = getValues();
        if(results.length() == 0) {
            throw new ReportException("Не выбрано ни одного объекта или свойства объекта");
        }
        String entities = builder.getSQLEntities();
        String links = builder.getSQLEntityLinks();
        sql.append("SELECT " + (distinct ? "DISTINCT ":"") + results
                + " FROM " + entities + (links.length() > 0 ? " WHERE "+links:""));
View Full Code Here

        if(loadedEntity == null) {
            return loadedValue;
        }
        String ident = property.getIdentification();
        if(ident == null || ident.length() == 0) {
            throw new ReportException("Incorrect ident for property:" + property.getAlias());
        }
        try {
            StringTokenizer identTokenizer = new StringTokenizer(ident);
            do {
                String identchunk = identTokenizer.nextToken(".");
                if(property instanceof QueryEntityMethod) {
                    loadedEntity = loadedEntity.getClass().getMethod(identchunk).invoke(loadedEntity);
                } else if(property instanceof QueryEntityField) {
                    try {//try method
                        String prefix;
                        if(property.getCls().equals(Boolean.class)) {
                            prefix = "is";
                        } else {
                            prefix = "get";
                        }
                        String methodName = prefix + identchunk.substring(0, 1).toUpperCase()
                                + identchunk.substring(1);
                        loadedEntity = loadedEntity.getClass().getMethod(methodName).invoke(loadedEntity);
                    } catch(MethodNotFoundException ex) {
                        loadedEntity = loadedEntity.getClass().getField(identchunk).get(loadedEntity);
                    }
                } else {
                    throw new ReportException("Unknown property reference class:" + property.getClass());
                }
            } while(loadedEntity != null && identTokenizer.hasMoreTokens());
            loadedValue = TypeConverter.getGenericValue(loadedEntity);

        } catch (Exception ex) {
            ex.printStackTrace();
            throw new ReportException("Неизвестное свойство: '" + ident
                    + "' в сущности " + loadedEntity.getClass().getSimpleName(), ex);
        }
        return loadedValue;
    }
View Full Code Here

TOP

Related Classes of reportgen.utils.ReportException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.