MyFaces Tomahawk
  1. MyFaces Tomahawk
  2. TOMAHAWK-979

ExcelExport - correct name for the downloaded file

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1.5
    • Fix Version/s: 1.1.7
    • Component/s: None
    • Labels:
      None
    • Environment:
      Suse Linux 10.0 - with Firefox 1.5.0.10

      Description

      I started from the example presented in the public site.

      I click on the button, a new page is poped, then that page is blank.
      Without knowing what happened, the file is saved in the background where it usualy saves the downloaded files.

      I come with a correction for the class ExcelExportPhaseListener

      private void writeExcelOutput(
      HSSFWorkbook workBook,
      HttpServletResponse response,
      HtmlDataTable dataTable) throws IOException

      { response.setContentType("application/vnd.ms-excel"); response.setHeader("Expires", "0"); response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0"); response.setHeader("Pragma", "public"); response.setHeader("Content-disposition", "attachment;filename=" + dataTable.getId() + ".xls"); workBook.write(response.getOutputStream()); }

      Changes in behavior:

      • the downloaded file is named using the id of the component prefixed with .xls
      • a popup is presented to allow us between the options "run / save as"

      Changes in code:

      • the headers, very important being the "Content-disposition"
      • the number of the arguments is changed.

      I have previous experience with downloading excel file but using servlets.
      I am using JSF but writing JSF exceeds my knowledge.

        Activity

        Emil Cazacu created issue -
        Cagatay Civici made changes -
        Field Original Value New Value
        Assignee Cagatay Civici [ cagatay_civici ]
        Cagatay Civici made changes -
        Fix Version/s 1.1.5 [ 12312397 ]
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.1.6-SNAPSHOT [ 12312361 ]
        Leonardo Uribe made changes -
        Fix Version/s 1.1.7-SNAPSHOT [ 12312361 ]
        Fix Version/s 1.1.7 [ 12313398 ]
        Leonardo Uribe made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Cagatay Civici
            Reporter:
            Emil Cazacu
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development