Hello Qatan,
On Friday, June 7, 2013 9:23:07 AM UTC-5, Qatan wrote:Hello all,I would like to add printing to my little program but I realized that I never did any routine for printing in Harbour (I know how to generate PDF or to print as it was in Clipper).
I mean, from what I understand, that {Cfd:CadenaOriginal} can expand to 1 or 5 lines and the html renderer will take care of it...I see that a lot of people using Harbour is working in the pharma business.... :-)Teo idea is really smart.
I'd create a pdf directly using harupdf... but Teo solution is better since its form can have placeholder that can "expand" and he doesn't have to take care of this.
but what happens when there are too many lines and you need to print 2 pages ?
Dear Qatan:You've initiated a good topic!. Thanks for it and hope we will have good inputs in this thread...Actually many among us who are still into Dos printing mode, are still wondering for a "REAL-LIFE REASONABLE METHOD" to cope with Windows Printing keeping compatibility with DOS also. There could be many ways.....1)Old clipper style can be adopted. Run the report and re-direct the output to a text file (the old clipper way) and then have "WINDOWS PRINTING ROUTINE" using Harbour. Printer Dialog Box can be invoked for printer selection. And HERE along with other windows/dos printers, we can have any free Printer Pdf pre-installed so that the output could be re-directed to a Pdf file without using any source for printing to a pdf file.2)The power of OLE could be used here - like exporting to Excel. I've found this method generates the true excel report, where one can have complete control of the format of the report and can perform calculations/modify the excel report like it was created "manually" and not "programtically". Just too perfect.....3)Using Tbrowse - we can redirect the report to a text file and then browse the textfile using tbrowse. And now from here you can export it to clipboard..then to notepad..word...excel....etc.4)Have seen in HMG or somewhere else, the report engine creates an "IMAGE" of the actual report in tiff/bmp or in any other image format. And this image can be printed...5) Exporting to Html - The implementation of Teo Fonrouge is just amazing6)Exporting to XMLLike you, I'm also looking for the best possible and reasonable to implement solution. Currently using the old clipper way..... but have experimented with steps 1 to 3 on real application.Dear Teo Fonrouge:Great job! This (or XML) could be THE BEST seeing current scenario (browser dependency increasing) Wondering what you are doing here... are you first transferring the report to tbrowse or dbf then exporting to HTml? Long time ago saw a routine somewhere tbrowse to Html...With Teo's method, how a multiple pages report could be generated and print of the same can be taken would be an interesting thing.
Regards,Swapan
On Friday, 7 June 2013 20:39:44 UTC+5:30, Teo Fonrouge wrote:To print complex reports/documents I use an .html file which has tokens with the fields to 'fill' in the final .html file, the 'fill' process is made by parsing the tokens in the .html file to generate a new .html file which has the real values from the app, images can be inserted too.I choose the .html format because it is easy to edit for end users with any html editor.
Hello Teo,Your idea is very good. Thanks for your suggestion and for answering.Somehow here it does not show correctly. The accented words are wrong and the logo is not showing completely... I am using Win 7 Pro 32bits and IE 9.0.8112.16421. Am I missing something? (look the attached files to see what I got).
Hello Teo / Everyone else,I was looking your HTML file and I would like to know how do you build the HTML template.Do you use some type of editor? How do you do it?
I am also interested to know how do you do to save the image (logo) as string “base64...etc...”It seems interesting.
openssl enc -base64 -A -in myimage.jpg > base64encoded.txt
But I'm sure that you also can use the base64 routines that has Harbour.