反饋已提交

網絡繁忙

當前為10.0版本文檔,更多實例內容將在最新幫助文檔中展現,點選跳轉至 最新版幫助文檔

自訂提交按鈕

一、概述

  1. 在使用填報表時,不希望使用 FineReport 內建的工具欄的按鈕,希望能夠自訂提交按鈕,將資料入庫。

  2. 自訂按鈕既可以是 FineReport 範本中新增的按鈕元件,也可以是 Web 整合頁面中HTML 的按鈕標簽。FineReport 範本中的

    按鈕元件實現自訂提交操作詳細請參照 JS自定义提交按钮。   

  3. 本文詳述在 Web 頁面中點選 HTML 中的按鈕提交 iframe 中的 FineReport 報表。

二、操作步驟

1
打開範本。
  1. 本文使用範本:%FR_HOME%\webapps\webroot\WEBINF\reportlets\doc\Form\FreeFrom\FreeForm.cpt。

2
編輯 HTML 程式碼。
  1. 實現思路說明:

    FineReport 內建的報表提交 JS 程式碼是contentPane.writeReport(),調用嵌入的報表提交功能的話,使用document.getElementById('報表所在iframe的  id').contentWindow.contentPane.writeReport()實現。

  2. 在網頁中新增【提交】按鈕,程式碼:<button type="button" onclick="document.getElementById('reportFrame').contentWindow.contentPane.writeReport()">提交</button>  。

  3. 完整程式碼如下。

<html>     <head>     <title>自定义提交按钮</title>   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head>     <body>     <div id="toolbar">     <button type="button" onclick="document.getElementById('reportFrame').contentWindow.contentPane.writeReport()">提交</button></div>     <iframe id="reportFrame" onload="afterload()" src="/webroot/decision/view/report?viewlet=doc/Form/FreeFrom/FreeForm.cpt&op=write&__showtoolbar__=false" width = 100% height = 80%></iframe>     </body>     </html>
3
儲存預覽。
  1. 已完成頁面請查看%FR_HOME%/webapps/webroot/help/page_demo/write.html。

  2. 啟動設計器,在瀏覽器輸入:http://localhost:8075/webroot/help/page_demo/write.html,效果如下圖。

1.gif

附件列表


主題: 部署整合
已經是第一篇
已經是最後一篇
  • 有幫助
  • 沒幫助
  • 只是瀏覽
  • 圖片不清晰
  • 用語看不懂
  • 功能說明看不懂
  • 操作說明太簡單
  • 內容有錯誤

文 檔回 饋

滑鼠選中內容,快速回饋問題

滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

不再提示

10s後關閉