Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 11 Monaten, 3 Wochen
Letzter Beitrag:
vor 11 Monaten, 3 Wochen
Beteiligte Autoren:
DarrenF, ccc2, Fabrice Harari

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

Startbeitrag von DarrenF am 07.12.2016 09:42

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:

Antworten:

Re: [WM21] Any ideas and examples for priniting from an Android app?

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

von Fabrice Harari - am 07.12.2016 11:32

Re: [WM21] Any ideas and examples for priniting from an Android app?

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 ?

von ccc2 - am 07.12.2016 12:09
Thanks guys... I shall mull over the contents of your responses.

von DarrenF - am 07.12.2016 12:43
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.