资讯   |   开发   |   选机中心   |   产品大全 | IBM | 惠普 | 联想 | 戴尔 | 苹果 | 神舟
更多: | 华硕 | 明基 | 方正 | 紫光 | TCL | 夏新 | 联宝 | 宏碁 | 七喜 | 长城 | 清华同方 | 海尔 | 三星 | 东芝 | 索尼 | 富士通 | LG | 技术 | ddnoon
当前位置:笔记本 > 软件开发 >
Advertisement
文章正文

老问题换个地方:PB9.0使datawindow生成pdf报表

类型:转载   责任编辑:asp.net   日期:2007/05/23


热门软件下载:


   

这已经是一个老问题了,前面已经有好多人问过,但却没有明确的答复。  
  我已经抠了几天,利用saveas()生成html、xls文件都没有问题,但是到pdf就有问题了,不是生成不了文件就是生成的pdf文件用Adobe   Reader   打不开。  
  帮助文档所说的需要GNU   Ghostscript我也照着安装了,不过全是英文资料看的不是很透彻,还希望大虾指点:  
   
      To   support   saving   as   PDF   using   GNU   Ghostscript,   Ghostscript   files   are   installed   with   PowerBuilder   in   Sybase\Shared\PowerBuilder\gs7.05.   The   default   PostScript   printer   driver   and   related   files   are   installed   in   Sybase\Shared\PowerBuilder\drivers.  
   
  When   you   deploy   applications   that   use   the   ability   to   save   as   PDF   using   the   distill   method,   you   must   deploy   the   gs7.05   and   drivers   directories   in   the   same   directory   as   the   pbdwe90.dll   runtime   file.   For   example,   if   you   deploy   your   application   and   pbdwe90.dll   and   the   other   PowerBuilder   runtime   files   in   a   directory   called   MyApplication,   the   Ghostscript   files   must   be   deployed   in   MyApplication\gs7.05,   and   the   default   PostScript   printer   driver   and   related   files   must   be   deployed   in   MyApplication\drivers.  
      这是帮助文档里介绍的第一种方法,希望可以解决问题。  
  我使用的代码:  
      第一套:dw_1.SaveAs("D:\test2\aaa.pdf",pdf!,true)  
       
      第二套:  
  int   li_ret      
  dw_1.Object.DataWindow.Export.PDF.Method   =   Distill!    
  dw_1.Object.DataWindow.Printer   =   "\\prntsrvr\pr-6"    
  dw_1.Object.DataWindow.Export.PDF.Distill.CustomPostScript="Yes"      
  li_ret   =   dw_1.SaveAs("D:\test2\aaa.pdf",   pdf!,   true)  
   
      第三套:  
  int   li_ret    
  dw_1.Modify("Export.PDF.Method   =   XSLFOP!   ")    
  dw_1.Modify("Export.PDF.xslfop.print=Yes")    
  li_ret   =   dw_1.SaveAs("d:\test\PDFtemp2.pdf",   PDF!,   true)  
   
  安装GNU   Ghostscript之前还可以生成pdf文件,就是打不开,安装GNU   Ghostscript之后就生成不了了,只是自动打开一个tiff文件。  
  这个问题好像在csdn上已经存活好长时间了,好像有好多人都遇到此问题,问出来大多数虾们都说简单,却不说具体如何解决,如果是我们安装的问题,请指教!  
   
  分不够可以去  
  <a>http://community.csdn.net/Expert/topic/3428/3428080.xml?temp=.3493616</a>  
  领分!  
   
 

网友回答:

发表者:sywen

試試這段代碼  
  我用9.0   Builder   5507的都可以。  
  string     ls_docname,   ls_named  
  integer   li_value  
  li_value   =   GetFileSaveName("保存文件",   ls_docname,   ls_named,   "pdf",&  
                "pdf   文件   (*.pdf),   *.pdf"   )  
  IF   li_value   =   1   THEN    
              li_value=dw_1.saveasascii(ls_named)    
          end   if  
  else  
      return  
  end   if  
  if   li_value=1   then  
      messagebox("提示","导出成功!")  
  else  
      Messagebox(Error,导出失败!!!,StopSign!)  
  end   if

发表者:linda_gao

I   have   tried   the   Distiller   method   many   times!The   printer   can   not   print   pdf   files!  
      Hav   you   succeded??  
   
   
  save   as   PDF   is   not   print   it   to   printer   .   it   will   just   save   as   .pdf   file   .   you   can   open   .pdf   file   using   acrobat   reader   .    
   
  I   dont   know   whats   your   problem   .   what   do   u   want   to   do   ?


 

 
热门推荐笔记本: 清华同方笔记本
相关文章:
webmaster:popbb@126.com   最佳浏览:1024X768 MSIE
©2007 popbb.net All Rights Reserved