1. tomms tomms
  2. PowerServer 2020 or older (Obsolete)
  3. Friday, 17 July 2020 07:44 AM UTC

Dear Appeon, 

 

i have a problem with this script , the QR Code result value and the image QR Code is different, between exe and web appeon, the code like this below ;

linet_main = CREATE inet
luo_data = CREATE n_cst_internet

SetPointer(HourGlass!)
//li_rc = &
li_rc = linet_main.GetURL('https://api.qrserver.com/v1/create-qr-code/?size=150x150&data='+as_assetno+'&format=jpg',luo_data)

SetPointer(Arrow!)

IF li_rc = 1 THEN
// s_XMLdata = String(luo_data.is_data, EncodingUTF8!)
// ole_blob = Blob(s_XMLdata, EncodingUTF8!)
ole_blob = luo_data.is_data


SetPointer(Arrow!)

IF li_rc = 1 THEN
// s_XMLdata = String(luo_data.is_data, EncodingUTF8!)
// ole_blob = Blob(s_XMLdata, EncodingUTF8!)
ole_blob = luo_data.is_data

ls_directory = gs_directory + "\"

ls_temp_prefix = "temp_"
ls_datetime = String(year(today())) + String(month(today())) + String(day(today())) + String(hour(time(today()))) + String(minute(time(today()))) + String(second(time(today())))

ls_file_path = ls_directory + ls_temp_prefix + ls_datetime+"."+'jpg'
//ls_file_path = ls_directory + ls_temp_prefix +"."+'jpg'

this.setredraw(False)

li_FileNum = FileOpen(ls_file_path, &
StreamMode!, Write!, Shared!, Replace!)
FileWriteEx(li_FileNum, ole_blob)

fileclose(li_filenum)

SELECT ast_mst_asset_locn,ast_mst_asset_shortdesc
into :ls_location,:ls_desc
FROM ast_mst
where ast_mst_asset_no = :as_assetno and site_cd = :gs_site ;

dw_2.reset()
dw_2.insertrow(0)

// dw_2.setitem(1,'title',ls_file_path)
dw_2.Modify("p_display.Filename='" + ls_file_path + "'")

Please help and what the issue in powerserver, i use powerserver 2019, if have the other method to get QR Code please share. thank you for your Attention.

 

Regards,

 

 

Tomms

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 17 July 2020 15:18 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # Permalink

Hi Tomms;

  I suspect that your issue is the value in the "ls_file_path" variable. The working directory of a PS Mobile or PS Web App is not the same as a native PB App. You need to use the PowerServer of_getcachedir() command to get the proper App's working folder where you have the proper permissions. Please see the PS Help for more details.

HTH

Regards ... Chris

Comment
  1. tomms tomms
  2. Monday, 20 July 2020 00:58 AM UTC
Hi chris,







the app has been use this script like this below ;



If gs_env_type = "PB" Then

gs_directory = GetCurrentDirectory( )

ElseIf gs_env_type = "WEB" Then

gs_directory =appeongetcachedir()

End If







the issue is value print out ,different image QR Code between exe and appeon web , i have attach the sample image. and u can try use that script i sent to your before , compare with exe and appeon web.



than u for your attention.











Regards,











Nasrullah
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Monday, 20 July 2020 15:23 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 1

Why do you believe the result from the PowerServer Web appeongetcachedir function is going to be identical to the PowerBuilder GetCurrentDirectory function?

I'll freely admit I'm not very familiar with PowerServer Web, but a quick look at the function documentation leads me to believe these two functions return VERY different paths.

Comment
There are no comments made yet.
tomms tomms Accepted Answer Pending Moderation
  1. Friday, 17 July 2020 23:37 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 2

Hi chris,

 

the app has been use this script like this below ;

If gs_env_type = "PB" Then
gs_directory = GetCurrentDirectory( )
ElseIf gs_env_type = "WEB" Then
gs_directory =appeongetcachedir()
End If

 

the issue is value come out ,but different image QR Code between exe and appeon web , i have attach the sample image. and u can try use that script i sent to your before , compare with exe and appeon web.

than u for your attention.

 

 

Regards,

 

 

Nasrullah

Attachments (1)
Comment
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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.