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

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


    public ActionForward export(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
            throws IOException {
        RegisteredDegreeCandidaciesSelectionBean registeredDegreeCandidaciesSelectionBean =
                getRegisteredDegreeCandidaciesSelectionBean();
        Spreadsheet export = registeredDegreeCandidaciesSelectionBean.export(getDegreesToSearch());

        response.setContentType("application/vnd.ms-excel");
        response.setHeader("Content-disposition",
                "attachment; filename=" + registeredDegreeCandidaciesSelectionBean.getFilename());
        export.exportToXLSSheet(response.getOutputStream());

        return null;
    }
View Full Code Here


            response.setContentType("text/plain");
            response.setHeader("Content-disposition", "attachment; filename=" + filename + methodInvoker.getExtension());

            ServletOutputStream writer = response.getOutputStream();

            final Spreadsheet spreadsheet = new Spreadsheet("ControloMetodosAvaliacao");
            for (final ExecutionCourse executionCourse : (Set<ExecutionCourse>) executionCourseWithNoEvaluationMethodSearchBean
                    .getSearchResult()) {
                final Row row = spreadsheet.addRow();
                row.setCell(executionCourse.getNome());
                final StringBuilder degrees = new StringBuilder();
                for (final Degree degree : executionCourse.getDegreesSortedByDegreeName()) {
                    if (degrees.length() > 0) {
                        degrees.append(", ");
View Full Code Here

    }

    public ActionForward exportXLS(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws IOException {
        ExternalSupervisorViewsBean bean = getRenderedObject("sessionBean");
        final Spreadsheet spreadsheet = generateSpreadsheet(bean);

        response.setContentType("application/vnd.ms-excel");
        response.setHeader("Content-disposition", "attachment; filename=" + getFilename(bean) + ".xls");
        spreadsheet.exportToXLSSheet(response.getOutputStream());
        response.getOutputStream().flush();
        response.flushBuffer();
        return null;
    }
View Full Code Here

        strBuilder.append(bean.getExecutionYear().getName());
        return strBuilder.toString();
    }

    private Spreadsheet generateSpreadsheet(ExternalSupervisorViewsBean bean) {
        final Spreadsheet spreadsheet = createSpreadSheet();
        for (final StudentCurricularPlan studentCurricularPlan : bean.generateAllStudentCurricularPlans()) {
            final Row row = spreadsheet.addRow();

            row.setCell(studentCurricularPlan.getPerson().getUsername());
            row.setCell(studentCurricularPlan.getRegistration().getNumber());
            row.setCell(studentCurricularPlan.getPerson().getName());
            row.setCell(studentCurricularPlan.getPerson().getInstitutionalOrDefaultEmailAddressValue());
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.username"),

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

        response.flushBuffer();
        return null;
    }

    private void exportDissertations(final ServletOutputStream writer, final ExecutionYear executionYear) throws IOException {
        final Spreadsheet spreadsheet = new Spreadsheet("Dissertacoes " + executionYear.getYear().replace("/", ""));
        spreadsheet.setHeader("Numero aluno");
        spreadsheet.setHeader("Nome aluno");
        spreadsheet.setHeader("Tipo Curso");
        spreadsheet.setHeader("Curso");
        spreadsheet.setHeader("Sigla Curso");
        spreadsheet.setHeader("Tese");
        spreadsheet.setHeader("Estado da tese");

        spreadsheet.setHeader("Data da Discussão");
        spreadsheet.setHeader("Resumo");
        spreadsheet.setHeader("Abstract");

        spreadsheet.setHeader("Numero Orientador");
        spreadsheet.setHeader("Nome Orientador");
        spreadsheet.setHeader("Affiliacao Orientador");
        spreadsheet.setHeader("Distribuicao Creditos Orientador");
        spreadsheet.setHeader("Numero Corientador");
        spreadsheet.setHeader("Nome Corientador");
        spreadsheet.setHeader("Affiliacao Corientador");
        spreadsheet.setHeader("Distribuicao Creditos Corientador");
        spreadsheet.setHeader("Numero Presidente");
        spreadsheet.setHeader("Nome Presidente");
        spreadsheet.setHeader("Afiliação Presidente");
        spreadsheet.setHeader("Nota Dissertação");

        for (final Thesis thesis : rootDomainObject.getThesesSet()) {
            final Enrolment enrolment = thesis.getEnrolment();
            final ExecutionSemester executionSemester = enrolment.getExecutionPeriod();
            if (executionSemester.getExecutionYear() == executionYear) {
                final ThesisPresentationState thesisPresentationState =
                        ThesisPresentationState.getThesisPresentationState(thesis);

                final Degree degree = enrolment.getStudentCurricularPlan().getDegree();
                final DegreeType degreeType = degree.getDegreeType();

                final Row row = spreadsheet.addRow();
                row.setCell(thesis.getStudent().getNumber().toString());
                row.setCell(thesis.getStudent().getPerson().getName());
                row.setCell(degreeType.getLocalizedName());
                row.setCell(degree.getPresentationName(executionYear));
                row.setCell(degree.getSigla());
                row.setCell(thesis.getTitle().getContent());
                row.setCell(thesisPresentationState.getName());

                if (thesis.getDiscussed() != null) {
                    row.setCell(thesis.getDiscussed().toDate().toString());
                }

                row.setCell(thesis.getThesisAbstractPt());
                row.setCell(thesis.getThesisAbstractEn());

                addTeacherRows(thesis, row, ThesisParticipationType.ORIENTATOR);
                addTeacherRows(thesis, row, ThesisParticipationType.COORIENTATOR);
                addTeacherRows(thesis, row, ThesisParticipationType.PRESIDENT);

                row.setCell(thesis.getMark());
            }
        }
        spreadsheet.exportToXLSSheet(writer);
    }
View Full Code Here

    }

    public ActionForward exportXLS(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws IOException {
        ExternalSupervisorViewsBean bean = getRenderedObject("sessionBean");
        final Spreadsheet spreadsheet = generateSpreadsheet(bean);

        response.setContentType("application/vnd.ms-excel");
        response.setHeader("Content-disposition", "attachment; filename=" + getFilename(bean) + ".xls");
        spreadsheet.exportToXLSSheet(response.getOutputStream());
        response.getOutputStream().flush();
        response.flushBuffer();
        return null;
    }
View Full Code Here

        strBuilder.append(bean.getExecutionYear().getName());
        return strBuilder.toString();
    }

    private Spreadsheet generateSpreadsheet(ExternalSupervisorViewsBean bean) {
        final Spreadsheet spreadsheet = createSpreadSheet();
        for (final StudentCurricularPlan studentCurricularPlan : bean.generateAllStudentCurricularPlans()) {
            final Row row = spreadsheet.addRow();

            row.setCell(studentCurricularPlan.getPerson().getUsername());
            row.setCell(studentCurricularPlan.getRegistration().getNumber());
            row.setCell(studentCurricularPlan.getPerson().getName());
            row.setCell(studentCurricularPlan.getPerson().getInstitutionalOrDefaultEmailAddressValue());
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.username"),

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

        response.setHeader("Content-disposition", "attachment; filename=" + filename + ".xls");
        response.setContentType("application/vnd.ms-excel");

        final ServletOutputStream outputStream = response.getOutputStream();
        final Spreadsheet spreadsheet = mobilityGroup.getCandidatesInformationSpreadSheet(period);
        spreadsheet.exportToXLSSheet(outputStream);
        outputStream.close();

        return null;
    }
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.