CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> Archive -> GotoCode Archive

 Report formats

Print topic Send  topic

Author Message
Desiree
Posted: 02/10/2002, 12:11 PM

I need my users to be able to have reports available to them via the database. When you work with data access pages you can just display the report as a graphic resulting from a query. How do I allow them to have reporting options that look nice and not webpage printout like.
Damian Small
Posted: 02/10/2002, 2:58 PM

Im interesred too. Has anyone looked at a new feature in IE5.5/6 called Print Templates? Could a query be paginated using this feature and a Header and Footer placed on the page?


Regards Damian Small
Dale Ryan
Posted: 02/10/2002, 4:32 PM

I just finished exporting the contents of a CC grid as a pdf file using the php-pdf routines available at:

http://www.ros.co.nz/pdf/

It is my understanding that php already has pdf routines in it but it's a LOT easier to use something like what this guy has developed. It worked very well for me and I think I will use this route for a number of different reports. I'm using php + templates + mysql but I think this should work with any php setup. It's not as simple as adding a few lines to a CC event but it wasn't that difficult either. I started with a CC php file that contained only one grid (turn off header, turn off sorting, page navigation, etc --keep it as simple as possible ). Then I replaced any code which displays anything to screen with a few lines to create a pdf file instead. It worked on my first try and I'm no expert on this kind of stuff. To the best of my recollection the changes I made are:

1) Installed the code from www.ros.co.nz on my site. Made sure I could get his sample code for a table to run correctly before I tried to convert a CC grid page to produce a pdf file.

2) Removed anything from the CC code that results in printing to screen.

3) add

include ("./class.ezpdf.php");

to CustomIncludes Event

2) create an array in which to put all the table data. I put these lines just after the initialize page counter in CC code

//-------------------------------
// Initialize page counter and records per page
//-------------------------------
$pdf = new Cezpdf('letter', 'portrait');
$pdf->ezText("Address List\n",16,array('justification'=>'centre'));
$data = array();

3) In the while($next_record) loop you fill the $data array with variables ($fld_field_names) something like this:

$data[] = array('idno'=>"$fldidno",'lastname'=>"$fldlast",'address'=>"$address");
$next_record = $db->next_record();


4) AFTER the while($next_record) loop put this one line:

$pdf->ezTable($data,'','',array('fontSize'=>10));

5) Finally put this one line just before the end of the file

$pdf->ezStream();

Running the page should automatically initiate a download of a pdf file containing whatever data would have been in the CC grid. Adding page numbers, headings, changing font sizes etc is quite easy and fairly well explained in the documentation which comes with the php-pdf code.

If someone can figure out how to do this entirely within CC (rather than editing the CC generated file , I would love to hear about it.

Hope this helps somebody. Thank God for people like this guy committed to open source code!!!!!!
Desiree
Posted: 02/11/2002, 6:03 AM

The problem with that is I am using ASP with templates.. Will that work with this? Thanks

Desiree
Ron Borkent
Posted: 02/11/2002, 7:22 AM

Looks like you could do a custom show and add the code there.

Ron
Nicole
Posted: 02/12/2002, 1:20 AM

Desiree,
have you seen VoteResults page on this site? Such graphic report is easy to create within CC. Use custom sql as report base and them put the code like below to BeforeShow event:
fldfield_name="<img src=images/bar.gif width="&Int(percent_filed)&" height=10> "& fldfiedl_name

You may download gotocode site and see it on VoteResults page-> VoteResults form: http://www.codecharge.com/download/files/examples/gotocodev2.zip

   


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.