2 Replies Latest reply on Nov 13, 2009 2:51 PM by Daniele Canteri

    SEAM Excel Export question

    Michael Zohner Newbie

      Hi,


      ic generate an Excelsheet via passing data to an excel template (e:workbook ...).


      When the data has been collected a pop is shown where I can open or save the excel file.


      When I open the excel file, the file is displayed via the IE browser excel add-on directly within the browser.


      But I want it to open the MS Excel application and to show it there, not within the browser.


      Any ideas how to solve this problem ?


      regards
      Michael

        • 1. Re: SEAM Excel Export question
          Nicklas Karlsson Master

          It probably(?) has something to do with the value for the Content-Disposition header in DocumentData being inline as default.

          • 2. Re: SEAM Excel Export question
            Daniele Canteri Newbie

            I had the same problem and, as I did not find any other way to override the default inline in DocumentData, I solved this way:


            In components.xml specify your own DocumentStore:


            <document:document-store class="your.pkg.DocumentStore" />



            then add the new class:


            package your.pkg.document;
            
            import org.jboss.seam.document.DocumentData;
            
            public class DocumentStore extends org.jboss.seam.document.DocumentStore {
                 private static final long serialVersionUID = 1L;
            
                 @Override
                 public void saveData(String id, DocumentData documentData) {
                      documentData.setDisposition("attachment");
                      super.saveData(id, documentData);
                 }
            }