內錶轉WORD一法, 可以呼叫WORD做報表了

2021-05-22 23:29:12 字數 936 閱讀 3513

今天在技術群裡再討論abap呼叫word列印的問題, 忽然想起.net中常用組合html字串的方法來匯出word檔案, 這個方法在abap中應該也可以吧, 於是簡單做了個測試, **如下:

data: begin

of wa_html,

zhtml(255),

endof wa_html,

gt_html like

table

method cl_gui_frontend_services=>gui_download

exporting

filename = 'c:/a.doc'

changing

data_tab = gt_html.

if sy-subrc eq

0.write

'ok'.

else.

write

'er'.

endif.

執行上面的**後, 會在c盤生成乙個a.doc的檔案, 雙擊, 可以看到word能正夠正常顯示內容及格式. 再自動化一點,就是例項化ole物件並開啟這個檔案啦, 這裡就不寫了, 有興趣的自己試吧.

---------------------------------2010-07-05 更新----------------------------------------

注: 加上如下**, 程式執行將直接呼叫wod開啟檔案

call

function

'call_internet_adress'

exporting

pi_adress           = 'c:/a.doc'

*   pi_techkey          = ''

exceptions

no_input_data       = 1

others              = 2

.

一維表轉二維表(mysql)

例子資料 drop table ifexists tmp0103.temp test create table tmp0103.temp test id int 11 not null auto increment,class varchar 255 default null,score doubl...

獲取Excel表名另一法

除了前一文說的方法外,還有一種方法可獲取excel所有表名 bool getexcelalltablenames cstring celfile,cstringlist sltablename celfile strcpy strdsn,sdsn 分配環境控制代碼 sqlhenv m henv if...

pdf轉word出現很多換行符將一整行切斷

1 正常的行結尾。特點是 句號 換行符 2 非正常的行中換行。特點是在兩個正常的文字中間突然出現 換行符 從而導致一整行被切斷。將換行符替換為空格。但是這樣做,會誤傷正常的行結尾換行符。因此,需要先將正常的行結尾換行符替換為乙個文章中從未出現過的特殊字元,從而將其保護起來。然後再替換文章中行中換行符...