Example usage for org.apache.poi.hpsf DocumentSummaryInformation setCompany

List of usage examples for org.apache.poi.hpsf DocumentSummaryInformation setCompany

Introduction

In this page you can find the example usage for org.apache.poi.hpsf DocumentSummaryInformation setCompany.

Prototype

public void setCompany(final String company) 

Source Link

Document

Sets the company.

Usage

From source file:edu.casetools.rcase.extensions.excel.control.Exporter.java

License:Open Source License

private void setDefaultProperties(String templateName) {
    HSSFWorkbook hworkbook = (HSSFWorkbook) this.workbook;
    hworkbook.createInformationProperties();
    SummaryInformation si = hworkbook.getSummaryInformation();
    DocumentSummaryInformation dsi = hworkbook.getDocumentSummaryInformation();
    si.setAuthor(I18nMessageService.getString("Excel.Author"));

    dsi.setCompany(I18nMessageService.getString("Excel.Company"));
    si.setApplicationName(I18nMessageService.getString("Excel.Application"));
    org.apache.poi.hpsf.CustomProperties cp = dsi.getCustomProperties();

    cp.put("Table Template", templateName);
    dsi.setCustomProperties(cp);/* w  w w .  j a  v a  2s  . com*/
}

From source file:org.alanwilliamson.openbd.plugin.spreadsheet.functions.SpreadsheetAddInfo.java

License:Open Source License

public cfData execute(cfSession _session, List<cfData> parameters) throws cfmRunTimeException {
    if (parameters.get(0).getDataType() != cfData.CFSTRUCTDATA)
        throwException(_session, "parameter must be of type structure");

    cfSpreadSheetData spreadsheet = (cfSpreadSheetData) parameters.get(1);
    cfStructData s = (cfStructData) parameters.get(0);

    Workbook workbook = spreadsheet.getWorkBook();

    /*/*www  .  j a va2  s .  c  om*/
     * XSSFWorkbook
     */
    if (workbook instanceof XSSFWorkbook) {
        XSSFWorkbook xSSFWorkbook = (XSSFWorkbook) workbook;

        CoreProperties cP = xSSFWorkbook.getProperties().getCoreProperties();

        if (s.containsKey("author"))
            cP.setCreator(s.getData("author").getString());
        if (s.containsKey("category"))
            cP.setCategory(s.getData("category").getString());
        if (s.containsKey("subject"))
            cP.setSubjectProperty(s.getData("subject").getString());
        if (s.containsKey("title"))
            cP.setTitle(s.getData("title").getString());
        if (s.containsKey("revision"))
            cP.setRevision(s.getData("revision").getString());
        if (s.containsKey("description"))
            cP.setDescription(s.getData("description").getString());

    } else {
        HSSFWorkbook hSSFWorkbook = (HSSFWorkbook) workbook;
        DocumentSummaryInformation dSummary = hSSFWorkbook.getDocumentSummaryInformation();

        if (dSummary == null) {
            hSSFWorkbook.createInformationProperties();
            dSummary = hSSFWorkbook.getDocumentSummaryInformation();
        }

        if (s.containsKey("category"))
            dSummary.setCategory(s.getData("category").getString());
        if (s.containsKey("manager"))
            dSummary.setManager(s.getData("manager").getString());
        if (s.containsKey("company"))
            dSummary.setCompany(s.getData("company").getString());

        SummaryInformation sInformation = hSSFWorkbook.getSummaryInformation();

        if (s.containsKey("title"))
            sInformation.setTitle(s.getData("title").getString());
        if (s.containsKey("subject"))
            sInformation.setSubject(s.getData("subject").getString());
        if (s.containsKey("author"))
            sInformation.setAuthor(s.getData("author").getString());
        if (s.containsKey("comments"))
            sInformation.setComments(s.getData("comments").getString());
        if (s.containsKey("keywords"))
            sInformation.setKeywords(s.getData("keywords").getString());
        if (s.containsKey("lastauthor"))
            sInformation.setLastAuthor(s.getData("lastauthor").getString());
    }

    return cfBooleanData.TRUE;
}

From source file:org.eclipse.scada.ae.ui.views.export.excel.impl.ExportEventsImpl.java

License:Open Source License

private void makeDocInfo(final HSSFWorkbook workbook) {
    workbook.createInformationProperties();

    final DocumentSummaryInformation dsi = workbook.getDocumentSummaryInformation();
    dsi.setCompany("Eclipse SCADA Project");

    final CustomProperties cp = new CustomProperties();
    cp.put("Eclipse SCADA Export Version", Activator.getDefault().getBundle().getVersion().toString());
    dsi.setCustomProperties(cp);/*from  ww w .j ava  2 s  .co m*/
}

From source file:org.openscada.ae.ui.views.export.excel.impl.ExportEventsImpl.java

License:Open Source License

private void makeDocInfo(final HSSFWorkbook workbook) {
    workbook.createInformationProperties();

    final DocumentSummaryInformation dsi = workbook.getDocumentSummaryInformation();
    dsi.setCompany("TH4 SYSTEMS GmbH");

    final CustomProperties cp = new CustomProperties();
    cp.put("openSCADA Export Version", Activator.getDefault().getBundle().getVersion().toString());
    dsi.setCustomProperties(cp);/*  w  ww  .j  a v  a2  s.co m*/
}

From source file:se.mithlond.services.content.impl.ejb.report.ExcelReportServiceBean.java

License:Apache License

/**
 * {@inheritDoc}// w w w .  j a  va2s.  c  o  m
 */
@Override
public Workbook createDocument(@NotNull final Membership activeMembership, @NotNull final String title) {

    // Check sanity
    Validate.notNull(activeMembership, "activeMembership");

    final HSSFWorkbook toReturn = new HSSFWorkbook();
    toReturn.createInformationProperties();

    // Add some comments.
    final SummaryInformation summaryInformation = toReturn.getSummaryInformation();
    summaryInformation.setCreateDateTime(new Date());
    summaryInformation.setTitle(title);
    summaryInformation.setAuthor("Nazgl Services Excel Report Generator");
    summaryInformation.setSubject("Requested by: " + activeMembership.getAlias());
    summaryInformation.setRevNumber("1");

    // Add some Document summary information as well.
    final DocumentSummaryInformation documentSummaryInformation = toReturn.getDocumentSummaryInformation();
    final String orgName = activeMembership.getOrganisation().getOrganisationName();
    documentSummaryInformation.setCompany(activeMembership.getOrganisation().getOrganisationName());
    documentSummaryInformation.setManager(orgName + " is Da Boss of you!");

    // All Done.
    return toReturn;
}