Package pt.utl.ist.fenix.tools.util.excel

Examples of pt.utl.ist.fenix.tools.util.excel.Spreadsheet


        getResponse().flushBuffer();
        FacesContext.getCurrentInstance().responseComplete();
    }

    private Spreadsheet generateSpreadsheet() {
        final Spreadsheet spreadsheet = createSpreadSheet();
        for (final StudentCurricularPlan studentCurricularPlan : filterAllStudentCurricularPlans().keySet()) {
            final Row row = spreadsheet.addRow();

            row.setCell(studentCurricularPlan.getRegistration().getNumber());
            row.setCell(studentCurricularPlan.getPerson().getName());
            row.setCell(studentCurricularPlan.getPerson().getInstitutionalOrDefaultEmailAddressValue());
            row.setCell(studentCurricularPlan.getRegistration().getLastRegistrationState(getExecutionYear()).getStateType()
View Full Code Here


            return registration.getAverage().setScale(2, RoundingMode.HALF_EVEN).toPlainString();
        }
    }

    private Spreadsheet createSpreadSheet() {
        final Spreadsheet spreadsheet = new Spreadsheet(BundleUtil.getString(Bundle.APPLICATION, "list.students"));

        spreadsheet.setHeaders(new String[] {

        BundleUtil.getString(Bundle.APPLICATION, "label.number"),

        BundleUtil.getString(Bundle.APPLICATION, "label.name"),
View Full Code Here

    }

    public Spreadsheet getCandidatesInformationSpreadSheet(final OutboundMobilityCandidacyPeriod period) {
        final String filename = BundleUtil.getString(Bundle.ACADEMIC, "label.mobility.candidates.information.filename");

        final Spreadsheet spreadsheetCurricularInfo = new Spreadsheet(filename);
        final Spreadsheet spreadsheetOptions =
                spreadsheetCurricularInfo.addSpreadsheet(BundleUtil.getString(Bundle.ACADEMIC,
                        "label.mobility.candidates.options"));
        final Spreadsheet spreadsheetContactInformation =
                spreadsheetOptions.addSpreadsheet(BundleUtil.getString(Bundle.ACADEMIC, "label.contact.information"));
        final Spreadsheet spreadsheetOtherCurricularInfo =
                spreadsheetOptions.addSpreadsheet(BundleUtil.getString(Bundle.ACADEMIC, "label.other.curricular.info"));

        final Set<Registration> processed = new HashSet<Registration>();
        for (final OutboundMobilityCandidacyContest contest : getOutboundMobilityCandidacyContestSet()) {
            for (final OutboundMobilityCandidacy candidacy : contest.getOutboundMobilityCandidacySet()) {
                final OutboundMobilityCandidacySubmission submission = candidacy.getOutboundMobilityCandidacySubmission();
                final Registration registration = submission.getRegistration();
                final Calculator calculator = new Calculator(registration.getStudent());

                if (!processed.contains(registration)) {
                    final Person person = registration.getPerson();

                    final Row row = spreadsheetCurricularInfo.addRow();
                    final BigDecimal candidacyGrade = submission.getGrade(this);
//                    final ICurriculum curriculum = registration.getCurriculum();
                    row.setCell(getString("label.username"), person.getUsername());
                    row.setCell(getString("label.name"), person.getName());
                    row.setCell(getString("label.degree"), registration.getDegree().getSigla());
                    row.setCell(getString("label.candidate.classification"),
                            candidacyGrade == null ? "" : candidacyGrade.toString());

                    row.setCell(getString("label.ects.first.cycle"), calculator.completedECTSCycle1.toString());
                    row.setCell(getString("label.ects.average"), calculator.getEctsAverage().toString());
                    row.setCell(getString("label.ects.average.first.and.second.cycle"), calculator
                            .getEctsEverateFirstAndSecondCycle().toString());
                    row.setCell(getString("label.ects.completed"), calculator.completedECTS.toString());
                    //row.setCell(getString("label.ects.pending"), calculator.getPendingEcts().toString());
                    row.setCell(getString("label.ects.enrolled"), calculator.enrolledECTS.toString());

                    for (final Registration otherRegistration : registration.getStudent().getRegistrationsSet()) {
                        final Row rowOCI = spreadsheetOtherCurricularInfo.addRow();
                        final ICurriculum curriculumOther = otherRegistration.getCurriculum();
                        rowOCI.setCell(getString("label.username"), person.getUsername());
                        rowOCI.setCell(getString("label.name"), person.getName());
                        rowOCI.setCell(getString("label.degree"), otherRegistration.getDegree().getSigla());
                        rowOCI.setCell(getString("label.curricular.year"), curriculumOther.getCurricularYear());
View Full Code Here

        }

    }

    public static Spreadsheet generateReport(final StudentReportPredicate studentReportPredicate) {
        final Spreadsheet spreadsheet = new Spreadsheet("StudentDataAuthorizations");
        addHeaders(spreadsheet);
        final ExecutionYear executionYear = ExecutionYear.readCurrentExecutionYear();
        for (final Degree degree : Degree.readNotEmptyDegrees()) {
            final DegreeType degreeType = degree.getDegreeType();
            if (studentReportPredicate.applyFor(degreeType)) {
View Full Code Here

        return result;
    }

    public Spreadsheet buildSpreadsheet() {
        Spreadsheet spreadsheet = new Spreadsheet("resultado da bolsa de accao social");

        setHeaders(spreadsheet);

        Row row = spreadsheet.addRow();

        row.setCell(getInstitutionCode());
        row.setCell(getInstitutionName());
        row.setCell(getApplicationNumber());
        row.setCell(getStudentNumber());
View Full Code Here

        studentReportPredicate.setExecutionYear(executionYear);
        studentReportPredicate.setDegreeType(degreeType);
        studentReportPredicate.setConcluded(concluded);
        studentReportPredicate.setActive(active);

        final Spreadsheet spreadsheet = GenerateStudentReport.generateReport(studentReportPredicate);

        final QueueJobResult queueJobResult = new QueueJobResult();
        queueJobResult.setContentType("application/vnd.ms-excel");
        final ByteArrayOutputStream byteArrayOS = new ByteArrayOutputStream();
        spreadsheet.exportToXLSSheet(byteArrayOS);
        queueJobResult.setContent(byteArrayOS.toByteArray());
        return queueJobResult;
    }
View Full Code Here

        return queueJobResult;
    }

    private Spreadsheet buildReport() {
        final Spreadsheet spreadsheet = new Spreadsheet(getFilename());

        spreadsheet.setHeaders(new String[] { "Aluno", "Nome", "Nº Contribuinte", "Ano", "Curso", "Tipo de Curso",
                "Valor Em Dívida", "Valor Total", "Valor Pago", "Valor Reembolsável", "Tipo de Isenção", "Valor de Isenção",
                "Percentagem de Isenção", "Motivo", "Data de criação", "Data de entrada do pagamento", "Montante inicial",
                "Montante ajustado", "Modo de pagamento", "Data de entrada do ajuste", "Montante do ajuste", "Justificação" });

        int i = 0;
        for (final GratuityEvent gratuityEvent : getGratuityEvents()) {
            GratuityEventEntry entry = new GratuityEventEntry(gratuityEvent);

            for (TransactionEntryDetail transaction : entry.getNonAdjustingTransactions()) {
                if (GratuityReportQueueJobType.DATE_INTERVAL.equals(getType())) {
                    if (transaction.getWhenRegisteredDateTime().isBefore(getBeginDate())) {
                        continue;
                    }

                    if (transaction.getWhenRegisteredDateTime().isAfter(getEndDate())) {
                        continue;
                    }
                }

                Row row = spreadsheet.addRow();

                fillWithGratuityEventInformation(row, entry);
                fillWithTransactionsInformation(row, transaction);
            }
View Full Code Here

TOP

Related Classes of pt.utl.ist.fenix.tools.util.excel.Spreadsheet

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.