1. Shin Jungi
  2. PowerBuilder
  3. Monday, 18 December 2023 05:26 AM UTC

hello?
It's Powerbuiltder 2019 R3 version.
APPEON works on Android phones.
I'm trying to convert DW_3 into PDF or JPG, but it doesn't work well.

What's wrong with the script under?


-- under --
String ls_filename, as_filename

ls_filename = "file:///storage/emulated/0/Download/p2023121301_test.PDF"
as_filename = ls_filename

//dw_3.saveas(as_filename, XLSX!, true)

dw_3.saveas(as_filename, PDF!, true)

 

Thanks

Benjamin Daniels Accepted Answer Pending Moderation
  1. Tuesday, 9 January 2024 07:51 AM UTC
  2. PowerBuilder
  3. # 1

Hi Shin

 

We can now confirm that you are able to save datawindow as pdf on mobile device and able to find the pdf file on the device (this was the original issue).

 

The emailing part is a separate issue. On my side I use gmail app (when app list pops when sending email). I did provide full access (permissions) when I installed gmail app. Try gmail app and see if that works.

 

Another option is to upload the pdf to the webserver (using file service function) and then send emails from web server (using normal PB smtp object).

Comment
  1. Shin Jungi
  2. Tuesday, 9 January 2024 08:39 AM UTC
Thank you always.



1. Create DW_3 as a PDF file on your mobile device

I tried to create something that moves to the /plugin/ -> /0/Download folder.



In the above part, appeongetcachedir() + "/plugin/" creates an aa.pdf file, and even saves the aa.pdf file using lnv_file.of_appeonupload. But again, through the lnv_file.of_appeondownload (ls_appeon_server_full_filename, ls_download_path) function,

I asked a question because I couldn't receive /0/Download/aa.pdf, but Benjamin Daniels sent me a sample by email, so I tested it again.



However, this sample all works well, but the file attachment does not work, so I posted a question.



To sum it up (I just need to be able to receive the PDF on my phone or send it by email)

1. Uploader of PDF file to server is successful

The download function that can be opened on the phone fails.

2. Other parts of the email sending function work, but the function to attach a file in the appeongetcachedir() + "/plugin/" aa.pdf folder to the email has failed.



thank you

I have no problem with any function.



Thank you so much for your help.

It's frustrating that neither Korea's Pentasoft nor any of its engineers have any experience with APPEON Mobile.



Regsrds, Jungi
  1. Helpful
  1. Benjamin Daniels
  2. Tuesday, 9 January 2024 12:27 PM UTC
Hi Shin



1) did you try to use gmail app on mobile to send email and see if pdf attachment works ?

2) try the run command as per Kai Zhao comment below (download pdf from webserver and email)



Benjamin
  1. Helpful
There are no comments made yet.
Benjamin Daniels Accepted Answer Pending Moderation
  1. Monday, 8 January 2024 22:20 PM UTC
  2. PowerBuilder
  3. # 2

Hi Shin

I can saveas pdf using PowerServer 2020 on android. Check sample code below (saves datawindow as pdf and emails it from mobile device):

eon_mobile_str_mailcontent lstr_content
string ls_recipient[], ls_cc[], ls_bcc[], ls_attachmentfile[], ls_file, ls_file2
integer li_re

ls_file = "my_export.pdf"
li = dw_1.saveas(ls_file, pdf!, True)

if appeongetclienttype()="MOBILE" then
    eon_mobile_awsex lnv_aws  
    lnv_aws = create eon_mobile_awsex
    lstr_content.s_subject = "DW Export List"
    lstr_content.s_notetext = "DW Export List"
    ls_recipient[1] = "me@me.com"
    ls_attachmentfile[1] = appeongetcachedir() + "/plugin/" + ls_file
    li_re = lnv_aws.of_sendmail (lstr_content, ls_recipient, ls_cc, ls_bcc, ls_attachmentfile)
end if

destroy lnv_aws

Comment
  1. Shin Jungi
  2. Tuesday, 9 January 2024 02:43 AM UTC
thank you so much. Benjamin Daniels

I conducted the test according to the method you suggested.

--------------------

eon_mobile_str_mailcontent lstr_content

string ls_recipient[], ls_cc[], ls_bcc[], ls_attachmentfile[], ls_file, ls_file2

integer li_re, li



ls_file = "F20230108_Purchase Order.pdf"

li = dw_3.saveas(ls_file, pdf!, True)



if appeongetclienttype()="MOBILE" then

eon_mobile_awsex lnv_aws

lnv_aws = create eon_mobile_awsex

lstr_content.s_subject = "[Sea Refrigerator]-F20230108_Order Form"

lstr_content.s_notetext = "[Sea Refrigerator]-F20230108_Order Form"



ls_recipient[1] = "jgshin1@naver.com"

ls_attachmentfile[1] = appeongetcachedir() + "/plugin/" + ls_file



messagebox(' ls_attachmentfile[1]', ls_attachmentfile[1])



li_re = lnv_aws.of_sendmail(lstr_content, ls_recipient, ls_cc, ls_bcc, ls_attachmentfile)

end if



destroy lnv_aws

---------------------

We modified and tested as above.

When you run it, a POP-UP will appear asking you to select the app from the app on your phone.

I chose Naver Mail.

I did that, but the subject and body of the email are sent well.

ls_file = "F20230108_Purchase Order.pdf" The email is sent without the PDF file attached.



I checked on my phone.

ls_attachmentfile[1] = appeongetcachedir() + "/plugin/" + ls_file

This file is created on a regular basis.



What settings do I need to set on my Android phone?

Do you not have read permission?

How do I solve this?



Regards, Jungi
  1. Helpful
There are no comments made yet.
Shin Jungi Accepted Answer Pending Moderation
  1. Thursday, 4 January 2024 06:28 AM UTC
  2. PowerBuilder
  3. # 3

Hi, Chris

--------

String ls_filename, as_filename, ls_path, ls_appeon_path

//ls_filename = "file:///storage/emulated/0/Download/p2023121301_test.PDF"

ls_path = getcurrentdirectory()
ls_appeon_path = appeongetcachedir()

//messagebox('ls_path', ls_path)
//messagebox('ls_appeon_path', ls_appeon_path)

//appeonprint2pdf()

// ls_path = null
// ls_appeon_path = /storage/emulated/0/Android/data/com.cnssolution.badam/files/App_running$

//ls_filename = ls_appen_path + '/p2023121301_test.PDF'
//ls_filename = "file:///storage/emulated/0/Android/p2023121301_test.PDF"

ls_filename = "/storage/emulated/0/Download/p2023121301_test.PDF"

as_filename = ls_filename

dw_3.saveas(as_filename, PDF!,true)

-------------------

I tested with the above source code and no error occurred, but the p2023121301_test.PDF file is not created in the /storage/emulated/0/Download/ folder.
ls_appeon_path = appeongetcachedir()
When I check this, /storage/emulated/0/Android/data/com.cnssolution.badam/files/App_running$ appears as /storage/emulated/0/Download/ on my phone.
I'm trying to create a folder with the name p2023121301_test.PDF.

What part is wrong?
thank you

 

Comment
  1. Shin Jungi
  2. Monday, 8 January 2024 09:05 AM UTC


<fileserver>

<file-path value="E:\www_root" />

<session-timeout value="3600" />

<allowed-file-types value="txt;doc;jpg;mpeg;pdf" ignorecase="true" />

<max-file-size value="200" />

<users>

<user name="mus" password="*****" />

<user name="sj01" password="***!!" />

<user name="cns" password="****!" />

</users>

</fileserver>



appeonfileserver.xml files.

<allowed-file-types value="txt;doc;jpg;mpeg;pdf" ignorecase="true" />

<max-file-size value="200" />

Two part changed

1. add pdf

2. value = "70" -> "200"
  1. Helpful
  1. Kai Zhao @Appeon
  2. Tuesday, 9 January 2024 00:14 AM UTC
As I mentioned before, only the file in the directory appeongetcachedir() + '\plugin' can be operated (download, upload, etc.), it has full read/write rights to the sandbox of the application, but not to the others.

Please try access pdf via URL on browser on Android, then download it.

For Android, you can also try the Run function, this will give control to Android, and Android will decide whether to prompt the user to select a program to open the PDF file. Please refer to the Run function chapter in PowerServer Help.

https://docs.appeon.com/ps2020/features_help_for_appeon_mobile/supported_functions.html#System_Functions_System___Environment_Functions
  1. Helpful
  1. Shin Jungi
  2. Tuesday, 9 January 2024 02:36 AM UTC
thank you so much. Benjamin Daniels

I conducted the test according to the method you suggested.

--------------------

eon_mobile_str_mailcontent lstr_content

string ls_recipient[], ls_cc[], ls_bcc[], ls_attachmentfile[], ls_file, ls_file2

integer li_re, li



ls_file = "F20230108_Purchase Order.pdf"

li = dw_3.saveas(ls_file, pdf!, True)



if appeongetclienttype()="MOBILE" then

eon_mobile_awsex lnv_aws

lnv_aws = create eon_mobile_awsex

lstr_content.s_subject = "[Sea Refrigerator]-F20230108_Order Form"

lstr_content.s_notetext = "[Sea Refrigerator]-F20230108_Order Form"



ls_recipient[1] = "jgshin1@naver.com"

ls_attachmentfile[1] = appeongetcachedir() + "/plugin/" + ls_file



messagebox(' ls_attachmentfile[1]', ls_attachmentfile[1])



li_re = lnv_aws.of_sendmail(lstr_content, ls_recipient, ls_cc, ls_bcc, ls_attachmentfile)

end if



destroy lnv_aws

---------------------

We modified and tested as above.

When you run it, a POP-UP will appear asking you to select the app from the app on your phone.

I chose Naver Mail.

I did that, but the subject and body of the email are sent well.

ls_file = "F20230108_Purchase Order.pdf" The email is sent without the PDF file attached.



I checked on my phone.

ls_attachmentfile[1] = appeongetcachedir() + "/plugin/" + ls_file

This file is created on a regular basis.



What settings do I need to set on my Android phone?

Do you not have read permission?

How do I solve this?



Regards, Jungi
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.