codebang
Posts: 74
|
| Posted: 11/23/2008, 11:31 PM |
|
Dear All....
I have this project, in which most of my screens are based on exporting the data into excel.
I am using the CCS example of exporting my data into excel but there is a small problem. I want to only export the data that is there on the screen and not the all the data from my DB table.
any solutions....
Thank u...
Salah Midhat
|
 |
 |
quasimidi
Posts: 151
|
| Posted: 11/24/2008, 11:49 AM |
|
I recommend to use the PHPExcel lib in CCS.
http://www.codeplex.com/PHPExcel
It is very easy to integrate into your PHP application, just check out the included sample.
Hope this helps.
_________________
RS |
 |
 |
codebang
Posts: 74
|
| Posted: 11/24/2008, 10:51 PM |
|
i would really love it if someone can help me a bit more.
i didnt understand the example very well.
I would really appreciate it.
Thank you..
Salah Midhat
|
 |
 |
Waspman
Posts: 948
|
| Posted: 11/28/2008, 1:53 AM |
|
Create a replica of the page that you show and pass the parameters that you use on the main page so it shows the same data.
Don't assign a style remove all unecessary rows, sort headers and navigators (you want all records).
In the page's before show event add the custom code...
Header("Content-type: application/vnd.ms-excel");
Header("Content-Disposition: inline; filename=\"export.xls"");
..or for a word doc
Header("Content-type: application/vnd.ms-word");
Header("Content-Disposition: inline; filename=\"export.doc\"");
I do it all the time with no problems (nice and simple)
T
_________________
http://www.waspmedia.co.uk |
 |
 |
codebang
Posts: 74
|
| Posted: 12/06/2008, 5:49 AM |
|
well, i thank u for the suggestion, but i dont think that u understood me.
Ok, this is the big picture.
I have this form, which works with panels, that hides and shows the data on the screen. i only want to export the data on the screen and not all the data in the table in my database.
Thank u,
Hoping i made it more clear......
|
 |
 |
Waspman
Posts: 948
|
| Posted: 12/09/2008, 12:16 PM |
|
Like I said, make a new page with a table etc and pass the parameters that you use to filter the data you want?
Use the before show code as above and it'll open in Excel!
T
_________________
http://www.waspmedia.co.uk |
 |
 |
jacem
Posts: 87
|
| Posted: 12/09/2008, 4:03 PM |
|
To expand on Waspman's answer a little for you, copy the existing report page to a new page then remove the fields / columns you don't want exported. On the original page you either call the page from an event trigger or if as a link that the client/user clicks on. The same parameters are passed to the 'export page' so it will retrive the same table data as it exports.
If the unwanted columns are dynamic in your application then I suspect your question is more focused on getting the export to excel function to take notice of switched off panels:- not sure if the export to excel can do that...
|
 |
 |