提交報表

此範例顯示如何提交報表。指令碼會呼叫含有必要參數的批次檔案,而不是直接在指令碼中包含參數。請注意,如果您嘗試提交在參數中有等號 (=) 的報表指令碼,指令碼會失敗。

#
This sample Jython script provides code related to custom scripts. All the messages being logged (meaning printed) are visible in the process log file as per Log Level profile.
#
# Log the beginning of the script, at the INFO level
fdmAPI.logInfo("======================================================================")
fdmAPI.logInfo("Custom Script: Begin")
fdmAPI.logInfo("======================================================================")
# Execute the subprocess to call and run the batch file
import os
import subprocess
os.chdir("D:/ORCL/MW/EPMSystem11R1/products/FinancialDataQuality/bin")
myScriptName = "D:/ORCL/MW/EPMSystem11R1/products/FinancialDataQuality/bin/myreport.bat"
retcode = subprocess.Popen(myScriptName) 
fdmAPI.logDebug("The return code = " + retcode)

上面提及的 myreport.bat 檔案可能包含等號作為參數,如下所示:

runreport.bat <username> <password> "TB All Columns (Per,Cat,Loc)" "Period=Jan 15" "Category=Actual" "Location=AAA" "Rule Name=AAA" "Report Output Format=PDF"