Welcome! Log In Create A New Profile

Advanced

[WM21] Any ideas and examples for printing from an Android app?

Posted by DarrenF 
Hi,

Does anyone have ideas, thoughts and maybe code snippets for printing reports from a WM21 Android app.

Also, where the flip does the report end up? Can't see the com.xxx.appname folder when I look for it :confused:



Edited 1 time(s). Last edit at 12/07/2016 05:26PM by DarrenF.
Hi Darren

To print from an apk, you need to use the low level printing functions (iprint, iprintword, etc) like we were doing in the old time.

As to WHERE the report ends up, it depends of your code. BY default, it should be in the app directory (and the app directory is hidden for security reason, and only your app can access it)... So if you want to share you pdf, you need to save it by code on the sdcard

Best regards
First , WM21 - android don't have report like in WD .


depend on whether you want to print on receipt printer or A4 size paper on normal printer .

1) if you print to receipt printer the use ESC/POS script . it will work on epson printer and most receipt printer (other brands).

once you open the port (whether through usb / network) just write the string (ESC/POS
script) to the printer buffer.

2) if you want print normal A4 size paper to normal printer . then it will be a bit complicate.

- using report service (web based) -

depend on the DB
- HFSQL use webdev
- SQL SERVER use SSRS
- for others DB use BIRT / Crystal report .

to view report
- using httprequest . to request the report (html) and the output in html control. quality can be variant depend on report viewer . crystal report is almost same as pdf while SSRS and Birt don't show exact number of pages like pdf .

to print report
Method 1 : server print . add printer on server where you host the report server. the report viewer (html) that come with the report server has option "Print" on menu . the printer will show up

Method 2 : use android apps like print share( may need to pay)
depend whether your printer supported . use httprequest to report server . to request pdf version of the report . then use the app to open the pdf .

Method 3 : print through google print
use httprequest to report server . to request pdf version of the report then print by using GglPrintDocument() . if your printer support google print then easy . if not then you need a pc (windows) with chrome installed and connected to printer . then add the printer using chrome.

Method 4 : print using PS (printer must support PS script)
use httprequest to report server . to request pdf version of the report then write it to printer

Method 5 : print using PCL (only for report server that support this format out put)
use httprequest to report server . to request PCL version of the report then write it to printer. most printer support PCL . if you are good with PCL language and able to write the report . then you no need report server.



Conclusion :
Method 1 (print quality good) : is first to try but don't assume the print option will work on your android browser .

---the rest method will be slow since you need to download the report first.---

method 2 (print quality bad): use this only if your printer supported and cannot use google print

method 3 (print quality good) : this the slowest . need a pc runing chrome connected if printer not support google print.

method 4 (print quality best) : so far only those big office printer support such option.

Method 5 (print quality depend) : I not sure how many printer support PCL.




had anyone tried more crazy ideas ?
Thanks guys... I shall mull over the contents of your responses.



Edited 1 time(s). Last edit at 12/07/2016 05:26PM by DarrenF.
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: