Examples of ExcelWriter


Examples of com.compomics.util.io.export.writers.ExcelWriter

            PTMScoringPreferences ptmcoringPreferences, SpectrumCountingPreferences spectrumCountingPreferences, WaitingHandler waitingHandler)
            throws IOException, IllegalArgumentException, SQLException, ClassNotFoundException, InterruptedException, MzMLUnmarshallerException, MathException {

        ExportWriter exportWriter = ExportWriter.getExportWriter(exportFormat, destinationFile, exportScheme.getSeparator(), exportScheme.getSeparationLines());
        if (exportWriter instanceof ExcelWriter) {
            ExcelWriter excelWriter = (ExcelWriter) exportWriter;
            PsExportStyle exportStyle = PsExportStyle.getReportStyle(excelWriter);
            excelWriter.setWorkbookStyle(exportStyle);
        }

        exportWriter.writeMainTitle(exportScheme.getMainTitle());

        for (String sectionName : exportScheme.getSections()) {
View Full Code Here

Examples of com.compomics.util.io.export.writers.ExcelWriter

     */
    public static void writeDocumentation(ExportScheme exportScheme, ExportFormat exportFormat, File destinationFile) throws IOException {

        ExportWriter exportWriter = ExportWriter.getExportWriter(exportFormat, destinationFile, exportScheme.getSeparator(), exportScheme.getSeparationLines());
        if (exportWriter instanceof ExcelWriter) {
            ExcelWriter excelWriter = (ExcelWriter) exportWriter;
            PsExportStyle exportStyle = PsExportStyle.getReportStyle(excelWriter); //@TODO use another style?
            excelWriter.setWorkbookStyle(exportStyle);
        }

        String mainTitle = exportScheme.getMainTitle();
        if (mainTitle != null) {
            exportWriter.writeMainTitle(mainTitle);
View Full Code Here

Examples of com.trulytech.mantis.util.ExcelWriter

  {
    response.setContentType("application/msexcel");
      response.setHeader("Content-Disposition", " filename=report.xls");
     
      ServletOutputStream ouputStream = response.getOutputStream();
      ExcelWriter writer = new ExcelWriter(ouputStream);
      writer.createSheet("信息表", 0);
     
      writer.mergeCells(0, 0, 0, 14, 0);
     
      WritableFont font = new WritableFont(WritableFont.ARIAL, 16,
                WritableFont.BOLD, false,
                UnderlineStyle.NO_UNDERLINE,
                jxl.format.Colour.BLACK);
      writer.writeStyleString(0, 0, 0, "会员信息表", font,
                jxl.format.Alignment.CENTRE);
      //表头
      writer.writeString(0, 0, 1, "登陆名");
      writer.writeString(0, 1, 1, "密码");
      writer.writeString(0, 2, 1, "真实姓名");
      writer.writeString(0, 3, 1, "性别");
      writer.writeString(0, 4, 1, "电话");
      writer.writeString(0, 5, 1, "手机");
      writer.writeString(0, 6, 1, "电子邮件");
      writer.writeString(0, 7, 1, "国家和地区");
      writer.writeString(0, 8, 1, "城市");
      writer.writeString(0, 9, 1, "邮编");
      writer.writeString(0, 10, 1, "地址");
      writer.writeString(0, 11, 1, "公司");
      writer.writeString(0, 12, 1, "刊物名称");
      writer.writeString(0, 13, 1, "用户类型");
   
      writer.flush();
      writer.close();
   
      ouputStream.flush();
      ouputStream.close();

    return "";
View Full Code Here

Examples of loxia.support.excel.ExcelWriter

   * @param showAll
   */
  public static void outputExcel(OutputStream os, InputStream is, TableModel tableModel, boolean showAll){
    assert is != null : "Input template is not found";
    ExcelManipulatorDefinition definition = generateDefinition(tableModel);
    ExcelWriter excelWriter = new DefaultExcelWriter();
    excelWriter.setDefinition(definition);
   
    Map<String,Object> beans = new HashMap<String, Object>();
    beans.put("title", tableModel.getModelName());
    for(int i=0; i< tableModel.getColumnNames().length; i++){
      beans.put("__column" + (i+1), tableModel.getColumnNames()[i]);   
    }
    beans.put("__columns", tableModel.getItems());
    excelWriter.write(is, os, beans);
  }
View Full Code Here

Examples of org.molgenis.io.excel.ExcelWriter

  }

  @Override
  public void export(OutputStream os) throws TableException
  {
    ExcelWriter excelWriter = new ExcelWriter(os);
    try
    {
      // save table state
      int colOffset = tupleTable.getColOffset();
      int colLimit = tupleTable.getColLimit();
      int rowOffset = tupleTable.getOffset();
      int rowLimit = tupleTable.getLimit();

      // update table state
      tupleTable.setColOffset(0);
      tupleTable.setColLimit(0);
      tupleTable.setOffset(0);
      tupleTable.setLimit(0);

      TupleWriter tupleWriter = excelWriter.createTupleWriter("Sheet1");
      try
      {
        // write header row
        tupleWriter.writeColNames(Iterables.transform(tupleTable.getColumns(), new Function<Field, String>()
        {
View Full Code Here

Examples of org.molgenis.io.excel.ExcelWriter

    FormController<?> controller = ((FormController<?>) this.getController());

    List<String> fieldsToExport = controller.getVisibleColumnNames();

    QueryRule[] rules = model.getRulesExclLimitOffset();
    ExcelWriter excelWriter = new ExcelWriter(xlsDownload);
    try
    {
      Class<? extends Entity> entityClass = model.getController().getEntityClass();
      db.find(entityClass, excelWriter.createTupleWriter(entityClass.getSimpleName()), fieldsToExport, rules);
    }
    finally
    {
      excelWriter.close();
    }

    return ScreenModel.Show.SHOW_MAIN;
  }
View Full Code Here

Examples of org.molgenis.io.excel.ExcelWriter

  public ScreenModel.Show handleRequest(Database db, MolgenisRequest request, OutputStream xlsDownload)
      throws ParseException, DatabaseException, Exception
  {
    FormModel<?> view = this.getFormScreen();
    List<String> fieldsToExport = ((FormController<?>) this.getController()).getVisibleColumnNames();
    ExcelWriter excelWriter = new ExcelWriter(xlsDownload);
    TupleWriter sheetWriter = excelWriter.createTupleWriter("Entity");

    try
    {
      sheetWriter.writeColNames(fieldsToExport);

      for (Entity e : view.getRecords())
        sheetWriter.write(new EntityTuple(e));
    }
    finally
    {
      excelWriter.close();
    }

    return ScreenModel.Show.SHOW_MAIN;
  }
View Full Code Here

Examples of org.molgenis.io.excel.ExcelWriter

      return ScreenModel.Show.SHOW_MAIN;
    }

    List<String> fieldsToExport = ((FormController<?>) this.getController()).getVisibleColumnNames();

    ExcelWriter excelWriter = new ExcelWriter(xlsDownload);
    try
    {
      Class<? extends Entity> entityClass = model.getController().getEntityClass();
      db.find(model.getController().getEntityClass(), excelWriter.createTupleWriter(entityClass.getSimpleName()),
          fieldsToExport, new QueryRule("id", Operator.IN, records));
    }
    finally
    {
      excelWriter.close();
    }
    return ScreenModel.Show.SHOW_MAIN;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.