寫資料到本地EXCEL的模板中去
*&---------------------------------------------------------------------*
*& Report Z_TEST_2
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT Z_TEST_2.
*---------------------------OLE----------------------------------*
include ole2incl.
data: excel type ole2_object, " Excel object
workbook type ole2_object, " Workbook object
sheet type ole2_object, " Worksheet object
range type ole2_object, " Range object
cell type ole2_object. " Cell object
data: sheet_name(20) value 'BS'. "Excel檔案裡的sheet name
data local_file like rcgfiletr-ftfront."下載檔案型別
local_file = 'c:DO_TEST_OLE.xls'.
START-OF-SELECTION.
data: c1 type i,
c2 type i,
c3 type i,
c4 type i.
create object excel 'EXCEL.APPLICATION'. " CREATE EXCEL OBJECT
if sy-subrc ne 0.
write: / 'Excel init failed, return code is ', sy-subrc.
exit.
endif.
set property of excel 'Visible' = 1.
call method of excel 'Workbooks' = workbook.
data h type i.
call method of workbook 'Open' exporting #1 = local_file.
call method of excel 'Sheets' = sheet exporting #1 = sheet_name.
call method of sheet 'SELECT' .
*填充抬頭
perform fill_range using 1 1 'F_TEST1'.
perform fill_range using 1 2 'F_TEST2'.
free object excel.
free object workbook.
free object sheet.
free object range.
free object cell.
*---------------------------------------------------------------------*
* FORM fill_range *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> VALUE(F_ROW) *
* --> VALUE(F_COL) *
* --> VALUE(F_VALUE) *
*---------------------------------------------------------------------*
form fill_range using value(f_row)
value(f_col)
value(f_value).
call method of excel 'CELLS' = cell
exporting
#1 = f_row
#2 = f_col.
set property of cell 'VALUE' = f_value.
endform. "FILL_RANGE
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7941665/viewspace-975470/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- excel導資料到PostgresqlExcelSQL
- Python批量匯入Excel資料到MySQLPythonExcelMySql
- Vue匯出資料到Excel電子表格VueExcel
- 【帶資訊的Excel模板下載】Excel
- excel模板資料填充 :tablefillExcel
- 利用Excel匯入資料到SAP C4CExcel
- 使用Excel匯入資料到SAP Cloud for Customer系統ExcelCloud
- C#快速匯出百萬級資料到Excel方法C#Excel
- 用 ABAP 新建本地 Excel 檔案並寫入資料試讀版Excel
- 從資料到視覺化:看板工具讓Excel更出色視覺化Excel
- Java 匯入資料到Excel並提供檔案下載介面JavaExcel
- 【python】python初學 讀取map檔案資料到excel中PythonExcel
- Python匯出資料到Excel表格-NotImplementedError: formatting_info=True not yet implementedPythonExcelErrorORM
- Golang初學:高併發時寫入資料到不同的mapGolang
- 如何通過 Excel import 的方式匯入測試資料到 SAP Commerce Cloud 伺服器ExcelImportCloud伺服器
- 儲存資料到MySql資料庫——我用scrapy寫爬蟲(二)MySql資料庫爬蟲
- 如何將 EXCEL 資料寫入資料庫Excel資料庫
- Python中去除重複資料的方法有哪些?Python
- 使用phpoffice/phpspreadsheet實現載入excel模板生成excelPHPExcel
- excel生成單元格帶下拉選項的模板 + 資料匯入Excel
- 如何批次匯出地圖上商家店鋪資料到手機電腦excel表格地圖Excel
- 【轉載】ALV的Excel方式顯示缺少模板Excel
- python 讀寫 excelPythonExcel
- ASP.NET 匯出gridview中的資料到Excel表中,並對指定單元格換行操作ASP.NETViewExcel
- C# 將資料寫入到Excel表格C#Excel
- 用DataX導資料到Clickhouse遇到的坑
- SQLServer插入資料到有自增列的表SQLServer
- flinkcdc同步mysql資料到selectdbMySql
- 遷移sqlserver資料到MongoDbSQLServerMongoDB
- 讀取本地Excel檔案生成echartsExcelEcharts
- 帶格式寫入excelExcel
- python openpyxl讀寫excelPythonExcel
- 寫模板, 並查集。並查集
- 分享一個 Excel 格式的功能測試用例模板Excel
- JAVA 資料寫入excel併傳送郵件JavaExcel
- ATMS中去pause Activity A.
- java匯出Excel定義匯出模板JavaExcel
- Excel模板匯出之動態匯出Excel
- 從 "垃圾 "資料到資料完整性的轉變