CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Excel export from a report in CCS

Print topic Send  topic

Author Message
dxmonger

Posts: 5
Posted: 02/16/2010, 6:45 PM

New to CCS and have a question regarding exporting to Excel.

I have a MS-Access database connection and have been using PHP w/CCS. I've managed to build a functional report with search in CCS that works fairly well. Now I'd like to add a link or button to the report for export to Excel.

To create my excel export function, I found a post on the forums that explained one method:

Quote :
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"");

That worked "ok". Could be better - for example, one of my fields is a "notes" field that has several lines of text. When that opens in Excel, it consumes several rows, wrecking the formatting. I would also need to find a way to create a link or button and pass all the URL variables from the search.

I did see the example from Codecharge:
http://examples.codecharge.com/ExamplePack/ExportToExcel/ExportToExcel.php

However, I could not get this working. Here is what I tried:
- I created a report to my data with search fields. It seemed to work ok.
- I added a Link and renamed it "ToExcelLink". I did the things requested in step 2 of the example.
- I wasn't exactly sure how to approach step 3. What is the "appropriate programming code" that I need to add? What is it I'm supposed to add there? the header calls?

Thanks


View profile  Send private message
jacem

Posts: 87
Posted: 02/17/2010, 9:11 PM

I think you need to strip out returns in the notes field that you are outputing on the report that is subsequently being exported to excel. If you use a php function to strip out returns (string replace effectively) for the notes field (i assume a label) it will also result in the excel row formatting not being confused by the line sin the notes. hope this helps.
View profile  Send private message

Add new topic Subscribe to topic   


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

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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