[prev in list] [next in list] [prev in thread] [next in thread] 

List:       odtug-webdev-l
Subject:    Re: How to assign filename to an Excel page?
From:       Peter Goldthorp <pgoldtho () yahoo ! com>
Date:       2003-11-17 21:34:20
[Download RAW message or body]

I have used it before and it's worked fine.  It sounds like your browser is
setup  to display files with an mime type of application/vnd.ms-excel;  It
could be that it's working.  What file name does the browser suggest if you try
a save-as?  It should default to: pallepop.xls.

If it doesn't, you could try swaping htp.prn for htp.p.  I haven't tried using
htp.prn.  The <CR> that htp.p adds may be important.  It was with earlier
versions of the oracle webserver.  They needed an extra <CR> to separate the
http header from the file content.

Another test would be to set the content-type and filename to something that
your browser does not understand.  e.g use an mime of application/octet-stream
and an unregistered file extension 

Peter

--- Peter Lorenzen <oracle@theHeat.dk> wrote:
> Hi  Peter,
> 
> Are you positive this works? With your http header I get the Excel document
> displayed fine in the browser, but the filename is nowhere to be found?
> 
> htp.prn
>  (
>    'Content-type: application/vnd.ms-excel; Content-Disposition: attachment;
> filename=pallepop.xls; Content-Transfer-Encoding: base64'||owa_util.NL_CHAR
>  );
> htp.prn(owa_util.NL_CHAR);
> 
> I have also tried using the title tag, as suggested by others, but this has
> no effect either.
> 
> Regards,
> Pete
> ----- Original Message -----
> To: "Multiple recipients of list ODTUG-WEBDEV-L"
> <ODTUG-WEBDEV-L@fatcity.com>
> Sent: Monday, November 17, 2003 3:44 PM
> 
> 
> > You can use htp.print to send an http header:
> >
> > c_filename        varchar2(64);
> >
> > begin
> >   htp.p(
> > '     Content-type: application/x-msexcel
> >       Content-Disposition: attachment; filename='||c_filename||'
> >       Content-Transfer-Encoding: base64');
> >
> >
> > This needs to the first statement in your http reply i.e. before
> > htp.p('<HTML xmlns:x="urn:schemas-microsoft-com:office:excel">');
> >
> > Also, the NLS_LANG parameter used to start your iAS listener must be the
> same
> > as the value used to start the database. For example, if your database is
> using
> > the AMERICAN_AMERICA.WE8ISO8859P1 character set, you must have
> > NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1 in your environment when you start
> your
> > iAS listener. If you don't do this, binary files gets corrupted during
> > download.
> >
> > Peter
> >
> >
> >
> > --- Sten Vesterli <sten@vesterli.dk> wrote:
> > > The <title> won't affect the file name.
> > >
> > > As far as I remember, the only solution is put your Excel-generation
> code in
> > > a package with the desired name and call the generating procedure "xls".
> In
> > > that way, the URL becomes http://yourserver/pls/dad/report.xls. Excel
> > > recognizes this because it looks like a file name ;-)
> > >
> > > As for letting your users select the name - there is no way I know of,
> short
> > > of dynamic PL/SQL (execute immediate 'create package ...')
> > >
> > > Cheers
> > >
> > > Sten Vesterli
> > > scott/tiger
> > >
> > > > -----Original Message-----
> > > > From: ml-errors@fatcity.com [mailto:ml-errors@fatcity.com] On
> > > > Behalf Of Finn Ellebaek Nielsen
> > > > Sent: 17. november 2003 00:04
> > > > To: Multiple recipients of list ODTUG-WEBDEV-L
> > > > Subject: RE: How to assign filename to an Excel page?
> > > >
> > > >
> > > > Hi Peter.
> > > >
> > > > Try and include <title>My Title</title> before the closing </HEAD>.
> > > >
> > > > HTH.
> > > >
> > > > Cheers,
> > > >
> > > > Finn
> > > >
> > > > --------------------------------------------------------------
> > > > -------------
> > > >  Finn Ellebaek Nielsen                           ChangeGroup ApS
> > > >  Product Manager, Principal Consultant, Partner
> > > > Kronprinsessegade 54, 4.
> > > >  E-mail: finn.ellebaek.nielsen@changegroup.dk    DK-1306  Koebenhavn K
> > > >  Mobile: +45 20 32 49 25                         Denmark
> > > >  Phone:  +45 33 32 77 78
> > > > http://www.changegroup.dk
> > > > --------------------------------------------------------------
> > > > -------------
> > > >                       "Where do you want to GPF today?"
> > > >
> > > > -----Original Message-----
> > > > Peter Lorenzen
> > > > Sent: Sunday, 16 November, 2003 23:29
> > > > To: Multiple recipients of list ODTUG-WEBDEV-L
> > > >
> > > >
> > > > Hi Finn,
> > > >
> > > > I use:
> > > >
> > > > owa_util.mime_header('application/vnd.ms-excel');
> > > >
> > > > And this, for setting up the Excel workbook:
> > > >
> > > >    htp.p('<HTML xmlns:x="urn:schemas-microsoft-com:office:excel">');
> > > >     htp.p('<HEAD> '||
> > > >           '<style> '||
> > > >           '  <!--table '||
> > > >           '  tr '||
> > > >           '     { '||
> > > >           '      mso-height-source: userset; '||
> > > >           '      mso-height-alt: 22px; '||
> > > >           '      height: 22px; '||
> > > >           '     } '||
> > > >           '  col '||
> > > >           '     { '||
> > > >           '      mso-width-source:auto; ' ||
> > > >           '     } '||
> > > >           '  th '||
> > > >           '     { '||
> > > >           '      background-color: Lightgrey; '||
> > > >           '     } ' ||
> > > >           '  th.red '||
> > > >           '     { '||
> > > >           '      background-color: red; '||
> > > >           '     } ' ||
> > > >           ' '||
> > > >           '  --> '||
> > > >           '</style> '||
> > > >           '  <!--[if gte mso 9]><xml> '||
> > > >           '   <x:ExcelWorkbook> '||
> > > >           '    <x:ExcelWorksheets> '||
> > > >           '     <x:ExcelWorksheet> '||
> > > >           '      <x:Name>VELUX Workbook</x:Name> '||
> > > >           '      <x:WorksheetOptions> '||
> > > >           '       <x:Print> '||
> > > >           '        <x:ValidPrinterInfo/> '||
> > > >           '       </x:Print> '||
> > > >           '      </x:WorksheetOptions> '||
> > > >           '     </x:ExcelWorksheet> '||
> > > >           '    </x:ExcelWorksheets> '||
> > > >           '   </x:ExcelWorkbook> '||
> > > >           '  </xml><![endif]-->  '||
> > > >           '</HEAD>'
> > > >          );
> > > >
> > > > Regards,
> > > > Pete
> > > >
> > > > ----- Original Message -----
> > > > To: "Multiple recipients of list ODTUG-WEBDEV-L"
> > > > <ODTUG-WEBDEV-L@fatcity.com>
> > > > Sent: Sunday, November 16, 2003 11:09 PM
> > > >
> > > >
> > > > > Hi Peter.
> > > > >
> > > > > Which MIME type are you generating?
> > > > >
> > > > > Cheers,
> > > > >
> > > > > Finn
> > > > >
> > > > >
> > > > ----------------------------------------------------------------------
> > > > > ----
> > > > -
> > > > >  Finn Ellebaek Nielsen                           ChangeGroup ApS
> > > > >  Product Manager, Principal Consultant, Partner
> > > > Kronprinsessegade 54, 4.
> > > > >  E-mail: finn.ellebaek.nielsen@changegroup.dk    DK-1306
> > > > Koebenhavn K
> > > > >  Mobile: +45 20 32 49 25                         Denmark
> > > > >  Phone:  +45 33 32 77 78
> > > > http://www.changegroup.dk
> > > > >
> > > > ----------------------------------------------------------------------
> > > > > ----
> > > > -
> > > > >                       "Where do you want to GPF today?"
> > > > -----Original
> > > > > Message----- Lorenzen
> > > > > Sent: Sunday, 16 November, 2003 22:04
> > > > > To: Multiple recipients of list ODTUG-WEBDEV-L
> > > > >
> > > > >
> > > > > Hi,
> > > > >
> > > > > I use the PL/SQL Web toolkit to create Excel pages. It
> > > > works fine. The
> 
=== message truncated ===


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree
-- 
Thanks to everyone for making ODTUG 2003 a great success!  See you in 2004!
If you want to volunteer for a committee, visit http://www.odtug.com
-- 
Author: Peter Goldthorp
  INET: pgoldtho@yahoo.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ODTUG-WEBDEV-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic