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

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


        response.flushBuffer();
        return null;
    }

    private void writeReport(final StandaloneCandidacyProcess process, final ServletOutputStream writer) throws IOException {
        final Spreadsheet spreadsheet = createSpreadSheet();
        for (final StandaloneIndividualCandidacyProcess candidacy : process
                .getSortedStandaloneIndividualCandidaciesThatCanBeSendToJury()) {
            if (candidacy.canExecuteActivity(Authenticate.getUser())) {
                addRow(spreadsheet, candidacy);
            }
        }
        spreadsheet.exportToXLSSheet(writer);
    }
View Full Code Here


        }
        row.setCell(names.toString());
    }

    private Spreadsheet createSpreadSheet() {
        final Spreadsheet spreadsheet = new Spreadsheet("Candidacies");

        spreadsheet.setHeaders(new String[] {

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

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

    }

    private Spreadsheet buildReport(final Degree degree,
            final SortedSet<DegreeCandidacyForGraduatedPersonIndividualProcess> candidacyProcesses) {

        final Spreadsheet spreadsheet = new Spreadsheet(degree.getSigla(), getHeader());
        for (final DegreeCandidacyForGraduatedPersonIndividualProcess process : candidacyProcesses) {
            final Row row = spreadsheet.addRow();
            row.setCell(process.getPersonalDetails().getName());
            row.setCell(process.getPrecedentDegreeInformation().getDegreeAndInstitutionName());
            row.setCell(process.getCandidacyAffinity());
            row.setCell(process.getCandidacyDegreeNature());
            row.setCell(process.getPrecedentDegreeInformation().getConclusionGrade());
View Full Code Here

        this.getResponse().setHeader("Content-disposition", "attachment; filename=" + filename + ".xls");
        ServletOutputStream outputStream = this.getResponse().getOutputStream();

        String spreadSheetName = BundleUtil.getString(Bundle.APPLICATION, "title.enrolments");
        List<Object> headers = getStudentsEnroledListHeaders();
        Spreadsheet spreadsheet = new Spreadsheet(spreadSheetName, headers);

        reportInfo(spreadsheet);

        spreadsheet.exportToXLSSheet(outputStream);
        outputStream.flush();
        this.getResponse().flushBuffer();
        FacesContext.getCurrentInstance().responseComplete();
    }
View Full Code Here

    @Override
    public QueueJobResult execute() throws Exception {
        ByteArrayOutputStream byteArrayOS = new ByteArrayOutputStream();

        Spreadsheet spreadsheet = createSpreadsheet();

        for (Student student : getStudentsSet()) {
            addInformation(spreadsheet, student);
        }

        spreadsheet.exportToXLSSheet(byteArrayOS);

        final QueueJobResult queueJobResult = new QueueJobResult();
        queueJobResult.setContentType("application/txt");
        queueJobResult.setContent(byteArrayOS.toByteArray());
View Full Code Here

        return studentCurricularPlan;
    }

    private Spreadsheet createSpreadsheet() {
        final Spreadsheet spreadsheet = new Spreadsheet("students");

        spreadsheet.setHeaders(new String[] { "Num Aluno", "Nome", "Tipo Curso", "Curso", "Ciclo", "Ects Aprovados",
                "Ects Total", "Soma classificacoes", "Num Aprovadas * 20", "A", "B", "100 * (A + B)" });

        return spreadsheet;
    }
View Full Code Here

        this.getResponse().setHeader("Content-disposition", "attachment; filename=" + filename + ".xls");
        ServletOutputStream outputStream = this.getResponse().getOutputStream();

        List<Object> headers = null;
        String spreadSheetName = null;
        Spreadsheet spreadsheet = null;
        if (infoToExport.equals(InfoToExport.CURRICULAR_STRUCTURE)) {
            spreadSheetName = "Estrutura Curricular do Grupo";
            headers = getCurricularStructureHeader();
            spreadsheet = new Spreadsheet(spreadSheetName, headers);
            reportInfo(spreadsheet);
        } else {
            spreadSheetName = "Plano de Estudos do Grupo";
            headers = getStudiesPlanHeaders();
            spreadsheet = new Spreadsheet(spreadSheetName, headers);
            reportInfo(spreadsheet);
        }

        spreadsheet.exportToXLSSheet(outputStream);
        outputStream.flush();
        this.getResponse().flushBuffer();
    }
View Full Code Here

                "alumni.partial.reports.name", getRequestDate().toString());
    }

    private List<Spreadsheet> buildReport() {

        final Spreadsheet curriculumData = new Spreadsheet("ALUMNI_CURRICULUM_DATA");
        curriculumData.setHeaders(new String[] { "NOME", "NUMERO_ALUNO", "CURSO", "INICIO", "CONCLUSAO", "DESCRICAO",
                "EMPREGADO ACTUALMENTE" });

        final Spreadsheet personalData = new Spreadsheet("ALUMNI_PERSONAL_DATA");
        personalData.setHeaders(new String[] { "NOME", "NUMERO_ALUNO", "DATA_NASCIMENTO", "MORADA", "COD_POSTAL", "LOCALIDADE",
                "PAIS", "EMAIL_PESSOAL", "EMAIL_ENVIAR", "TELEFONE", "REGISTADO EM" });

        final Spreadsheet jobData = new Spreadsheet("ALUMNI_JOB_DATA");
        jobData.setHeaders(new String[] { "IDENTIFICADOR", "NOME", "NUMERO_ALUNO", "EMPREGADOR", "CIDADE", "PAIS",
                "COD_AREA_NEGOCIO", "AREA_NEGOCIO", "POSICAO", "DATA_INICIO", "DATA_FIM", "TIPO_CONTRATO", "FORMA_COLOCACAO",
                "REMUN_MENSAL_BRUTA", "TIPO_SALARIO", "DATA_ALTERACAO", "DATA_REGISTO" });

        final Spreadsheet formationData = new Spreadsheet("ALUMNI_FORMATION_DATA");
        formationData.setHeaders(new String[] { "IDENTIFICADOR", "NOME", "NUMERO_ALUNO", "TIPO", "GRAU", "INSTITUICAO",
                "COD_AREA_EDUCATIVA", "AREA_EDUCATIVA", "INICIO", "CONCLUSAO", "CREDITOS_ECTS", "NUMERO_HORAS", "DATA_ALTERACAO",
                "DATA_REGISTO" });

        int count = 0;
View Full Code Here

    public Spreadsheet getSelectedCandidateSpreadSheet(final OutboundMobilityCandidacyPeriod period) {
        final String filename =
                BundleUtil.getString(Bundle.ACADEMIC, "label.mobility.outbound.period.export.selected.candiadates.filename");

        final Spreadsheet spreadsheetCandidates = new Spreadsheet(filename);
        final Spreadsheet spreadsheetOtherCurricularInfo =
                spreadsheetCandidates.addSpreadsheet(BundleUtil.getString(Bundle.ACADEMIC, "label.other.curricular.info"));
        for (final OutboundMobilityCandidacySubmission submission : getOutboundMobilityCandidacySubmissionSet()) {
            final OutboundMobilityCandidacy candidacy = submission.getSelectedCandidacy();
            if (candidacy != null) {
                final Registration registration = submission.getRegistration();
                final Person person = registration.getPerson();
                final ICurriculum curriculum = registration.getCurriculum();
                final OutboundMobilityCandidacyContest contest = candidacy.getOutboundMobilityCandidacyContest();
                final OutboundMobilityCandidacyContestGroup group = contest.getOutboundMobilityCandidacyContestGroup();
                final MobilityAgreement mobilityAgreement = contest.getMobilityAgreement();
                final MobilityProgram mobilityProgram = mobilityAgreement.getMobilityProgram();
                final RegistrationProtocol registrationProtocol = mobilityProgram.getRegistrationProtocol();
                final UniversityUnit universityUnit = mobilityAgreement.getUniversityUnit();
                final Country country = universityUnit.getCountry();

                final Row candidacyRow = spreadsheetCandidates.addRow();
                candidacyRow.setCell(getString("label.mobility.program"), registrationProtocol.getDescription().getContent());
                candidacyRow.setCell(getString("label.country"), country == null ? "" : country.getLocalizedName().toString());
                candidacyRow.setCell(getString("label.university"), universityUnit.getPresentationName());
                candidacyRow.setCell(getString("label.degrees"), group.getDescription());
                candidacyRow.setCell(getString("label.vacancies"), contest.getVacancies());
                candidacyRow.setCell(getString("label.username"), person.getUsername());
                candidacyRow.setCell(getString("label.name"), person.getName());
                candidacyRow.setCell(getString("label.degree"), registration.getDegree().getSigla());
                candidacyRow.setCell(getString("label.candidate.classification"), getGrades(submission));
                candidacyRow.setCell(getString("label.preference.order"), candidacy.getPreferenceOrder());
                candidacyRow.setCell(getString("label.curricular.year"), curriculum.getCurricularYear());
                candidacyRow.setCell(getString("label.ects.completed.degree"), curriculum.getSumEctsCredits().toString());
                candidacyRow.setCell(getString("label.average.degree"), curriculum.getAverage().toString());
                group.fillCycleDetails(candidacyRow, CycleType.FIRST_CYCLE, registration,
                        getString("label.ects.completed.cycle.first"), getString("label.average.cycle.first"));
                group.fillCycleDetails(candidacyRow, CycleType.SECOND_CYCLE, registration,
                        getString("label.ects.completed.cycle.second"), getString("label.average.cycle.second"));
                candidacyRow.setCell(getString("label.email"), person.getEmailForSendingEmails());
                candidacyRow.setCell(getString("label.phone"), person.getDefaultPhoneNumber());
                candidacyRow.setCell(getString("label.mobile"), person.getDefaultMobilePhoneNumber());

                for (final Registration otherRegistration : registration.getStudent().getRegistrationsSet()) {
                    if (otherRegistration != registration) {
                        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 void setShowPhoto(Boolean showPhoto) {
        this.showPhoto = showPhoto;
    }

    public void exportStudentsToExcel() throws IOException {
        final Spreadsheet spreadsheet = generateSpreadsheet();

        getResponse().setContentType("application/vnd.ms-excel");
        getResponse().setHeader("Content-disposition", "attachment; filename=" + getFilename() + ".xls");
        spreadsheet.exportToXLSSheet(getResponse().getOutputStream());
        getResponse().getOutputStream().flush();
        getResponse().flushBuffer();
        FacesContext.getCurrentInstance().responseComplete();
    }
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.