1. ? ?
  2. PowerServer 2020 or older (Obsolete)
  3. Monday, 25 April 2022 07:28 AM UTC

你好:

请问下怎样可以把手机上的dw中的数据保存为excel或者pdf 文件保存在手机上面,方便把数据转发给他人

谢谢

? ? Accepted Answer Pending Moderation
  1. Wednesday, 27 April 2022 08:43 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 1

那如果只能用pdf保存,怎样可以保存为横向的pdf, 默认我转是 竖向的显示

Comment
  1. Kai Zhao @Appeon
  2. Wednesday, 27 April 2022 08:51 AM UTC
请尝试在PB IDE > 数据窗口对象 > Properties > Print Specifications页设置Paper Orientation为横向(Landscape).
  1. Helpful
There are no comments made yet.
? ? Accepted Answer Pending Moderation
  1. Tuesday, 26 April 2022 06:41 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 2

dw_1.SaveAs(ls_file,Excel!, false,EncodingUTF8!)  用了帮助里面的几种格式,还都是乱码

Comment
  1. Kai Zhao @Appeon
  2. Tuesday, 26 April 2022 07:30 AM UTC
PB下正常吗?可能是Excel版本太低不支持多字节字符. 建议导出为PDF文件。
  1. Helpful
There are no comments made yet.
? ? Accepted Answer Pending Moderation
  1. Tuesday, 26 April 2022 05:53 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 3

用: dw_1.SaveAs(ls_file,Excel5!, false)  不可以上传失败

用  dw_1.SaveAs(ls_file,Excel!, false)  这个格式可以, 但表格里面的中文是乱码

Comment
  1. Kai Zhao @Appeon
  2. Tuesday, 26 April 2022 06:28 AM UTC
PB下是乱码吗?saveas默认的Encoding是ANSI ,可能不支持中文,请尝试其他Encoding参数.
  1. Helpful
There are no comments made yet.
? ? Accepted Answer Pending Moderation
  1. Tuesday, 26 April 2022 05:02 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 4

string ls_recipient[]
string ls_attachmentfile[]
string ls_cc[]
string ls_bcc[]
string ls_filename
int li_ret, li_re
eon_mobile_str_mailcontent lstr_content
eon_mobile_awsex lnv_aws

lnv_aws = create eon_mobile_awsex

lstr_content.s_subject = 'test'
lstr_content.s_notetext = 'mytest'
//ls_cc[1] = sle_2.text
ls_recipient[1] ='292246223@qq.com'

ls_filename = string(datetime(today(),now()),'yyyymmdd-hhmmss')+srand+"-daochu.pdf"
li_ret = dw_1.SaveAs(ls_filename,PDF!,true)
if li_ret = -1 then
messagebox("AVISO" , "ERROR PDF")
else
messagebox("AVISO" , "OK PDF")
ls_attachmentfile[1] = appeongetcachedir()+"/plugin/"+ ls_filename

END IF

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

destroy lnv_aws

 

我用你说的上面代码运行,但不能直接把文件发给我上面的邮箱,会弹出一个 发邮件的客户端窗口,里面主题什么的是按上面的信息,但没有附件,没我保存下来的附件,那怎样发送,不可能我要去点附件去文件夹找文件吧

Comment
  1. Kai Zhao @Appeon
  2. Tuesday, 26 April 2022 05:20 AM UTC
你用的是Android 12?请使用Android 10/11试试。

Android 12权限配置有变化,请确认你的邮箱app具有访问所有文件权限,只有访问媒体文件权限不行。
  1. Helpful
  1. Kai Zhao @Appeon
  2. Tuesday, 26 April 2022 05:24 AM UTC
建议你把文件存到数据库让其他用户访问; 或者使用 fileserver 上传文件到web服务器上,让其他用户通过URL访问.
  1. Helpful
There are no comments made yet.
? ? Accepted Answer Pending Moderation
  1. Tuesday, 26 April 2022 04:27 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 5

我试了下,用 dw_1.SaveAs(ls_file,PDF!, false) 这样可以,但用 dw_1.SaveAs(ls_file,xlsx!, false) 保存为excel 文件就不行,是不是不能保存excel  ?

Comment
  1. Kai Zhao @Appeon
  2. Tuesday, 26 April 2022 05:17 AM UTC
你好,PowerServer不支持SaveAs的xlsx!格式,请用Excel5!.
  1. Helpful
There are no comments made yet.
Kai Zhao @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 26 April 2022 00:19 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 6

你好,

请用saveas函数导出数据到excel或pdf,文件保存在应用目录的plugin文件夹内,你可以用类似下面代码获取完整路径.
ls_filename = appeongetcachedir() + "/plugin/" + 'erdmobile-daten1.pdf'

你可以邮件中附上上面生成的文件给其他人,请参考下面帖子。
https://community.appeon.com/index.php/qna/q-a/how-do-i-send-an-email-thru-mobile-app-with-a-pdf-as-attatchement-pb2017r3-powerserver#reply-12848

Regards,
Kai

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.