CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Export Grid to Excel or Word

Print topic Send  topic

Author Message
Andrea Grub
Posted: 12/15/2002, 3:27 AM

Hi

does anyone has an idea how to realize this?

Thanks for any ideas.

Andrea


Chip Cotton
Posted: 12/15/2002, 10:08 AM

Just arrange the data labels in between commas and quote marks to
create a CSV file.

example:

"{label1}",{label2},"{label3}"

where labels 1 and 3 are strings and label2 is a number.

If you omit the headers and other html stuff, you could directly
import the output file into one of those applications. Yahoo does
this with their stock data.


On Sun, 15 Dec 2002 12:28:08 +0100, "Andrea Grub" <a.grub@qwirt.ch>
wrote:

>Hi
>
>does anyone has an idea how to realize this?
>
>Thanks for any ideas.
>
>Andrea
>
>
michael weaver
Posted: 12/15/2002, 12:50 PM

For php can put this at the very top of your code for the page:

Header("Content-type: application/vnd.ms-excel");

There's a way to do it for any language. Of course, this solution will only
work for people using Internet Explorer, though.

m

"Andrea Grub" <a.grub@qwirt.ch> wrote in message
news:athov6$6h4$1@news.codecharge.com...
> Hi
>
> does anyone has an idea how to realize this?
>
> Thanks for any ideas.
>
> Andrea
>
>
>

Tobias Weik
Posted: 12/15/2002, 2:47 PM

michael weaver schrieb:
> For php can put this at the very top of your code for the page:
>
> Header("Content-type: application/vnd.ms-excel");
>
> There's a way to do it for any language. Of course, this solution will only
> work for people using Internet Explorer, though.

It also works fine for Mozilla. Since I also donīt use M$-Office (OpenOffice
instead), I always get a download-interface, when pages created this way are
shown... if M$-Office is installed with Excel, the "Excel-Sheet" may be shown
inline (inside the browser).

Just a small add: if you put "Header("Content-Disposition: inline;
filename=\"your_name_here.xls\"");" into the next row at top of your code, you
can give a name to the "excel"-file that should be downloaded (define this
always as "inline", else it may get scrammbled!). Your code-page should look
like this:

<?php
Header("Content-type: application/vnd.ms-excel");
Header("Content-Disposition: inline; filename=\"your_name_here.xls\"");
....
?>

Anyway, donīt forget to reduce your (html-)code as good as possible - just a
grid: no sorter, navigation, "no-record-row", grid-header or -footer or anything
else and no theme... :)

Tobias
michael weaver
Posted: 12/16/2002, 11:03 AM

Aha! Thanks for the tip Tobias - I always forget about the Disposition line.
You can also use "attachment" rather than "inline" to make the file download
instead of display in the browser. For instance :
Header("Content-Disposition: attachment; filename=\"your_name_here.xls\"");

michael

"Tobias Weik" <tw@ccug.de> wrote in message
news:atj0q5$emc$1@news.codecharge.com...
> michael weaver schrieb:
> > For php can put this at the very top of your code for the page:
> >
> > Header("Content-type: application/vnd.ms-excel");
> >
> > There's a way to do it for any language. Of course, this solution will
only
> > work for people using Internet Explorer, though.
>
> It also works fine for Mozilla. Since I also donīt use M$-Office
(OpenOffice
> instead), I always get a download-interface, when pages created this way
are
> shown... if M$-Office is installed with Excel, the "Excel-Sheet" may be
shown
> inline (inside the browser).
>
> Just a small add: if you put "Header("Content-Disposition: inline;
> filename=\"your_name_here.xls\"");" into the next row at top of your code,
you
> can give a name to the "excel"-file that should be downloaded (define this
> always as "inline", else it may get scrammbled!). Your code-page should
look
> like this:
>
> <?php
> Header("Content-type: application/vnd.ms-excel");
> Header("Content-Disposition: inline; filename=\"your_name_here.xls\"");
> ...
> ?>
>
> Anyway, donīt forget to reduce your (html-)code as good as possible - just
a
> grid: no sorter, navigation, "no-record-row", grid-header or -footer or
anything
> else and no theme... :)
>
> Tobias
>

Tobias Weik
Posted: 12/16/2002, 12:27 PM

michael weaver schrieb:
> Aha! Thanks for the tip Tobias - I always forget about the Disposition line.
> You can also use "attachment" rather than "inline" to make the file download
> instead of display in the browser. For instance :
> Header("Content-Disposition: attachment; filename=\"your_name_here.xls\"");
>
> michael

Well Michael, thanx for your tip, I was searching for this :)

Tobias
Kasper Pedersen
Posted: 02/05/2003, 12:20 AM

This works fine i ASP, except for the fact that session variables are no
longer available (and thus the security settings doesnt work):

INSERT RIGHT BELOW INCLUDE STATEMENTS
-----------------------------------------------------------------
response.contentType = "application/x-msexcel"
response.addHeader "Content-Disposition","inline; filename=stuff.xls"
response.flush()
-----------------------------------------------------------------

Kasper


"Tobias Weik" <tw@ccug.de> wrote in message
news:atj0q5$emc$1@news.codecharge.com...
> michael weaver schrieb:
> > For php can put this at the very top of your code for the page:
> >
> > Header("Content-type: application/vnd.ms-excel");
> >
> > There's a way to do it for any language. Of course, this solution will
only
> > work for people using Internet Explorer, though.
>
> It also works fine for Mozilla. Since I also donīt use M$-Office
(OpenOffice
> instead), I always get a download-interface, when pages created this way
are
> shown... if M$-Office is installed with Excel, the "Excel-Sheet" may be
shown
> inline (inside the browser).
>
> Just a small add: if you put "Header("Content-Disposition: inline;
> filename=\"your_name_here.xls\"");" into the next row at top of your code,
you
> can give a name to the "excel"-file that should be downloaded (define this
> always as "inline", else it may get scrammbled!). Your code-page should
look
> like this:
>
> <?php
> Header("Content-type: application/vnd.ms-excel");
> Header("Content-Disposition: inline; filename=\"your_name_here.xls\"");
> ...
> ?>
>
> Anyway, donīt forget to reduce your (html-)code as good as possible - just
a
> grid: no sorter, navigation, "no-record-row", grid-header or -footer or
anything
> else and no theme... :)
>
> Tobias
>

Raxip
Posted: 02/10/2003, 7:03 PM

Anyone know how i would do this in c#?



"Kasper Pedersen" <kasper@bentbyg.dk> wrote in message
news:b1qhgu$g88$1@news.codecharge.com...
> This works fine i ASP, except for the fact that session variables are no
> longer available (and thus the security settings doesnt work):
>
> INSERT RIGHT BELOW INCLUDE STATEMENTS
> -----------------------------------------------------------------
> response.contentType = "application/x-msexcel"
> response.addHeader "Content-Disposition","inline; filename=stuff.xls"
> response.flush()
> -----------------------------------------------------------------
>
> Kasper
>
>
> "Tobias Weik" <tw@ccug.de> wrote in message
>news:atj0q5$emc$1@news.codecharge.com...
> > michael weaver schrieb:
> > > For php can put this at the very top of your code for the page:
> > >
> > > Header("Content-type: application/vnd.ms-excel");
> > >
> > > There's a way to do it for any language. Of course, this solution will
> only
> > > work for people using Internet Explorer, though.
> >
> > It also works fine for Mozilla. Since I also donīt use M$-Office
> (OpenOffice
> > instead), I always get a download-interface, when pages created this way
> are
> > shown... if M$-Office is installed with Excel, the "Excel-Sheet" may be
> shown
> > inline (inside the browser).
> >
> > Just a small add: if you put "Header("Content-Disposition: inline;
> > filename=\"your_name_here.xls\"");" into the next row at top of your
code,
> you
> > can give a name to the "excel"-file that should be downloaded (define
this
> > always as "inline", else it may get scrammbled!). Your code-page should
> look
> > like this:
> >
> > <?php
> > Header("Content-type: application/vnd.ms-excel");
> > Header("Content-Disposition: inline; filename=\"your_name_here.xls\"");
> > ...
> > ?>
> >
> > Anyway, donīt forget to reduce your (html-)code as good as possible -
just
> a
> > grid: no sorter, navigation, "no-record-row", grid-header or -footer or
> anything
> > else and no theme... :)
> >
> > Tobias
> >
>
>


   


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

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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