Roberto Lopez wrote:rathinagiri wrote:Exactly the same way of thinking Roberto.
Regarding PDF, yes fpdf is the nice choice. I think we have to collect all data for printing from startdoc() up to enddoc() and once enddoc() is called, a single call from js to php can be made along with all the parameters. What do you think?
I've was thinking exactly that!
I absolutely agree.
When printing be finished, will be ready for production apps.
But...
Many times, I spent a lot of time thinking prior to start coding and sometimes (only sometimes) it results in a good thing
Regarding printing, I've realized that my first idea is pretty inefficient
In the proposed schema, we need to transfer the data from server to client, create the report in the client and then transfer processed data again to the server to be converted to a PDF, then the PDF is transfered to the client.
So, the data (in different shapes) traveled three times across the network.
This is not a problem for small reports, but for big ones, it will be.
So, my idea now, is to create a report class, like this:
SqlReport ( cQuery , cTitle , cPaperSize )
It will create a PDF file (using fpdf) that will be transfered to the client.
Of course, it can be expanded later to give it the ability to create non-tabular reports, include images, etc.
We will need the Harbour counterpart too, but I'm not sure what PDF library is better and how exactly we could transfer the file to the client using uhttpd server.
It should be something like:
Report ( cTitle , cTable , cOrder , cFilter , aColumns , aTitles , cPaperSize )