TonyE
|
| Posted: 01/29/2004, 7:03 AM |
|
I am in the process of creating pdf reports generated by php.
The pdf class I am using is from fpdf.org
I am hand coding the whole report with notepad, modifying examples supplied from fpdf.org. I belief I can get it to work but the page will be totally independant from CCS.
To make life easier I would like to implement into CCS generated pages.
Question 1. Is there a way were I can create a page with CCS then insert the pdf generating code into page.
Questions 2. Is there a way to create the MYSQL code with CCS
and only handcode the page layout of the pdf file.
What I had in mind is the following:
I create a grid but when the page is opened it will ignore the html page and generate the pdf.
This would save me the work from hand-coding the MYSQL statements.
I am using PHP, MYSQL, & fpdf class
Any hints would be appreciated.
Tony Elmiger
|
|
|
 |
DonB
|
| Posted: 01/29/2004, 10:03 AM |
|
Check www.rustyparts.com for the best unix/linux alternative I was able to
find. Works well, too.
--
DonB
http://www.gotodon.com/ccbth
"TonyE" <TonyE@forum.codecharge> wrote in message
news:5401920c8eaa15@news.codecharge.com...
> I am in the process of creating pdf reports generated by php.
>
> The pdf class I am using is from fpdf.org
>
> I am hand coding the whole report with notepad, modifying examples
supplied from fpdf.org. I belief I can get it to work but the page will be
totally independant from CCS.
>
> To make life easier I would like to implement into CCS generated pages.
>
> Question 1. Is there a way were I can create a page with CCS then insert
the pdf generating code into page.
>
> Questions 2. Is there a way to create the MYSQL code with CCS
> and only handcode the page layout of the pdf file.
>
> What I had in mind is the following:
> I create a grid but when the page is opened it will ignore the html page
and generate the pdf.
>
> This would save me the work from hand-coding the MYSQL statements.
>
> I am using PHP, MYSQL, & fpdf class
>
> Any hints would be appreciated.
>
> Tony Elmiger
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 01/29/2004, 5:20 PM |
|
Tony,
Re: 1
Yes, you can call or place such code almost in any CCS Event.
The simplest variant would be to create a blank page and use the After Initialize event, then redirect the page to another URL.
Re: 2
It rather would be less trouble to utilize your own MySQL statements.
Here is a sample code of reading database values within an Event: http://docs.codecharge.com/studio/html/ProgrammingTechn...leDBValues.html
Generating PDFs externally should be a better option, although it depends on the case. For example we create PDF Invoices in the "After Update" event of our Order Confirmation page.
Regarding the topic of creating PDF in PHP, here is an article describing similar method to what we do: http://www.sitepoint.com/article/1225/3
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
feha
Posts: 712
|
| Posted: 01/30/2004, 1:52 PM |
|
I'm using FPDF in my projects ..
www.fpdf.org
free for use even commercial
www.vision.to
_________________
Regards
feha
www.vision.to
feedpixel.com |
 |
 |
DataDoIt
|
| Posted: 02/18/2004, 6:27 PM |
|
Any insight on this post? I too would like to know more details. Thanks.
-MR
"TonyE" <TonyE@forum.codecharge> wrote in message
news:5401920c8eaa15@news.codecharge.com...
> I am in the process of creating pdf reports generated by php.
>
> The pdf class I am using is from fpdf.org
>
> I am hand coding the whole report with notepad, modifying examples
supplied from fpdf.org. I belief I can get it to work but the page will be
totally independant from CCS.
>
> To make life easier I would like to implement into CCS generated pages.
>
> Question 1. Is there a way were I can create a page with CCS then insert
the pdf generating code into page.
>
> Questions 2. Is there a way to create the MYSQL code with CCS
> and only handcode the page layout of the pdf file.
>
> What I had in mind is the following:
> I create a grid but when the page is opened it will ignore the html page
and generate the pdf.
>
> This would save me the work from hand-coding the MYSQL statements.
>
> I am using PHP, MYSQL, & fpdf class
>
> Any hints would be appreciated.
>
> Tony Elmiger
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
TonyE
|
| Posted: 02/19/2004, 9:21 PM |
|
I ended up using using the pdf class from fpdf.org. I checked into the other suggestions but the fpdf.org seemed to be the easiest to install.
I ended up handcoding the pdf report from scratch. There are some examples you can use to get started. I did not have much knowledge about the php language but I was able to finish my first 2 pdf reports.
Tony
|
|
|
 |
johny_f
Posts: 23
|
| Posted: 02/20/2004, 12:14 AM |
|
Generating PDFs externally should be a better option...
I agree with peterr in that.
I am working now on the "invoice" system with ability to generate not only html but also pdf file. (PHP/MySQL)
I use a simple trick to optain the same SQL query into another file including "search" option.
Example:
I have Invoice list Grid with Search From - which means that final query si depended on the user's inputs.... order by, year, receiver etc.
The way I obtain final query:
In Grid AfterExecuteSelect Event:
// Iuse superglobal for storying query
// empty variables just in case there is something stored in memory
$_SESSION["xquery"] = "";
$_SESSION["xquery_count"] = ""; // for counting total record
$xsql = $formname->ds->SQL; // get SQL statement from grid
$xwhere = $fs_users_fs_countries_fs->ds->Where; // Where statement from grid
$xorder = $fs_users_fs_countries_fs->ds->Order; // get order
$wh = " WHERE "; // prefix for Where statment needed in SQL
if ($xwhere == ""){
$wh = ""; // if there is not where statment clean prefix unless you enjoy errore messages
}
$_SESSION["xquery"] = $xsql . $wh . $xwhere; // put all together
//echo $xquery;
// ------
// for record count:
$xcount = $formname->ds->RecordsCount;
$_SESSION["xquery_count"] = $xcount;
// ----
//To use it in any other file just recall the superglobal
// dont forget to have them turned ON
$SQL =$_SESSION["xquery_count"] ;
// ----
I hope this will help.
I will post some examples when I get finished with PDF exporting, I also prepare Mailing Lables export, but this will be even more complicated.
However again: FOR EXPORT problably handcoding will be neccessary
Johny_f
just an enthusiastic amateur
----------------
_________________
Johny_f |
 |
 |
RogerR
Posts: 21
|
| Posted: 02/22/2004, 6:08 AM |
|
Quote johny_f:
I am working now on the "invoice" system with ability to generate not only html but also pdf file. (PHP/MySQL)
I use a simple trick to optain the same SQL query into another file including "search" option.
Thank you Johny_f.
A department , at work, has requested the ability to create PDF reports from intranet programs; so I am just starting to look into this. Your example will go a long way to helping me get this project moving.
I really appreciate your posting this.
_________________
***********************************************************
The best antivirus a windose user can get - LINUX!
*********************************************************** |
 |
 |
|