Welcome! Log In Create A New Profile

Advanced

How to create report for...

Posted by ICI 
ICI
How to create report for...
March 15, 2009 11:18AM
Regards !
Is there any sample or way how to create reports to print it on dot-matrix or termal POS printers (7,5cm ribbon continious)

1. Is that prepared .TXT file or I can do that via integrated report designer.
2. Do I need to have installed this type of printer to prepare format,....

Any suggestion will be very useful.
Arie
Re: How to create report for...
March 15, 2009 04:29PM
POS printers can be used as any "normal" printer via the Report Designer. Works like a charm! To avoid slow printing you should use fonts, known by your specific printer. To do so, you need to setup this printer as your default, on the developers machine. That way you will see all known printerfonts in WD (as you do in Word and all other programs).
You also should avoid printing borders and lines on some older POS-printer (new one will print this at a normal speed). You better of printer minus-signs or underscores then.
I'm working with Epson TM-88IV and don't have any problems.

Arie
ICI
Re: How to create report for...
March 15, 2009 07:48PM
Arie !
Thank you for your answer. This is preaty clear answer but I have second question.
Is continous paper normaly supported or I heft to control page limit.
If POS printer is default do WinDev automaticaly adjust design window to that kind
of paper and display continous white or there is page break.

Regards !
Arie
Re: How to create report for...
March 16, 2009 09:21AM
ICI,
good point I forgot to mention. I use a "very long" custom paper size in WD. 3500 mm is long enough in my case.
The Epson driver allows me to set "cut paper" at the end of a print job. So I don't have to do that myself.
But you still can if you want. After printing your report (designed with the Report Designer) you have to send some esc-characters with iEscape().

And if you want to open a cash-drawer, connected to the POS printer, you have to do it the same thing. Print your report and send esc-characters afterwards. Or let the driver do the job, if it has build in support for that (latest Epson driver do!)

Arie
ICI
Re: How to create report for...
March 16, 2009 10:40AM
Now is all clear !
So on some button or function for printing on POS printer code will be like this:

sOpenDrawerSRP270A is string = ESC + 112+0+64+240

iPrint(SomeReport,Param1,....)
iEscape(sOpenDrawerSRP270A)

Are I am right ????
Arie
Re: How to create report for...
March 16, 2009 10:59AM
Exactly! Here is my code (I left out all errorhandling to make it more readable).

iConfigure(somePrinter)
iParameter(iCopies,nNumerOfCopies)
// Skip anyoing waiting-window
iWindowCancel()
iInitReportQuery(myQuery,param1)
iPrintReport(someReport)

iDestination(iPrinter)
iEscape(sOpenDrawerSRP270A)
iEndPrinting()

Arie
Arie
Re: How to create report for...
March 16, 2009 11:07AM
ICI,
one other thing. Somewhere in the help there's a line saying: don't use timers in your windows and use printer-functions at the same time.
And that's true!! It cost me several days to track a every-now-and-then problem. My application just froze, say once every 2 days.

I traced it down to "printing". I decided to make a separate printing-executable, sitting in the taskbar-tray. From my main app I'm sending a message to this print-module, whenever the user want a printout. Then this module does the actual printing stuff as described in the other posts.

Instead of sending windows message, you can also use HOnServerCall(), if you're using HFCS. That's easier.

This sure solved my problem.

Arie
ICI
Re: How to create report for...
March 16, 2009 12:07PM
Thank you Arie !
Very useful information. I am at your serve ! winking smiley)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: