CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 PHP to Excel

Print topic Send  topic

Author Message
PJ
Posted: 01/02/2003, 9:35 AM

I have seen somewhere a strip of code to insert into a page that will
convert php data to display an excel spreadsheet in the browser but lost
track of it.

Can any help me?

Many thanks

RonB
Posted: 01/02/2003, 3:34 PM

Put this at the top of the php page ( or even better in an event):
Header("Content-type: application/vnd.ms-excel");
Now if you link to that page it will be opened in excel.

That's all

RonB


"PJ" <apis@globalnet.co.uk> schreef in bericht
news:av1t9j$mkd$1@news.codecharge.com...
> I have seen somewhere a strip of code to insert into a page that will
> convert php data to display an excel spreadsheet in the browser but lost
> track of it.
>
> Can any help me?
>
> Many thanks
>
>

michael weaver
Posted: 01/06/2003, 12:17 PM

If you add the second line you can set the downloaded filename (for an
attachment), or set the file to be viewed "inline"

Header("Content-type: application/vnd.ms-excel");
Header("Content-Disposition: attachment;
filename=\"your_datasheet_name.xls\"");

michael


"RonB" <r.borkent@123chello123.nl> wrote in message
news:av2iae$vg1$1@news.codecharge.com...
> Put this at the top of the php page ( or even better in an event):
> Header("Content-type: application/vnd.ms-excel");
> Now if you link to that page it will be opened in excel.
>
> That's all
>
> RonB
>
>
> "PJ" <apis@globalnet.co.uk> schreef in bericht
>news:av1t9j$mkd$1@news.codecharge.com...
> > I have seen somewhere a strip of code to insert into a page that will
> > convert php data to display an excel spreadsheet in the browser but lost
> > track of it.
> >
> > Can any help me?
> >
> > Many thanks
> >
> >
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.