Serving a file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Serving a file

Thelliez
Hello,

I need to generate some file based reports (Excel). Some of these
reports are generated on the fly, some others (the long ones) will be
pre-generated.

For the reports generated on the fly (when users click a button), how
do I set a page type to be something like:  application/vnd.ms-excel
(extension xml or csv). ?

For the pre generated reports (static files), is that a good practice
to 'record' the files with a sub class of WAFileLibrary?


Thanks,
Thierry
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Serving a file

Philippe Marschall
2010/10/17 Thierry Thelliez <[hidden email]>:
> Hello,
>
> I need to generate some file based reports (Excel). Some of these
> reports are generated on the fly, some others (the long ones) will be
> pre-generated.
>
> For the reports generated on the fly (when users click a button), how
> do I set a page type to be something like:  application/vnd.ms-excel
> (extension xml or csv). ?

Which version of Seaside?

> For the pre generated reports (static files), is that a good practice
> to 'record' the files with a sub class of WAFileLibrary?

No, in general not.

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Serving a file

Sven Van Caekenberghe
In reply to this post by Thelliez
Thierry,

On 17 Oct 2010, at 18:11, Thierry Thelliez wrote:

> I need to generate some file based reports (Excel). Some of these
> reports are generated on the fly, some others (the long ones) will be
> pre-generated.
>
> For the reports generated on the fly (when users click a button), how
> do I set a page type to be something like:  application/vnd.ms-excel
> (extension xml or csv). ?


Some time ago I posed the same question on this list and Julian Fritzel helped me to this answer:

servePdf
        self requestContext respond: [ :response |
                response
                        document: self getPdfBytes mimeType: 'application/pdf' fileName: 'seaside-test.pdf';
      doNotCache ]

HTH,

Sven

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Serving a file

Thelliez
In reply to this post by Philippe Marschall
Philippe,

>
> Which version of Seaside?

I am on 2.8, but thinking of moving to 3.0 soon.


Thierry
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Serving a file

Thelliez
In reply to this post by Sven Van Caekenberghe
Sven,

This looks great.


Thanks,
Thierry


> Some time ago I posed the same question on this list and Julian Fritzel helped me to this answer:
>
> servePdf
>        self requestContext respond: [ :response |
>                response
>                        document: self getPdfBytes mimeType: 'application/pdf' fileName: 'seaside-test.pdf';
>                doNotCache ]
>
> HTH,
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside