iT邦幫忙

0

FastReport .NET Community Edition 2023 如何做到報表端 動態使用DB

  • 分享至 

  • xImage

您好:
想請問 於

FastReport .NET Community Edition 2023 ,報表端
如何做到 動態使用DB?
如下圖,
原本報表都會抓一個connectionstring
但因為一份報表,要給多個DB使用
AA, AA_TEST, BB, BB_TEST 共4個DB (裡面的TABLE都一樣)
我有從API 端傳一個 connx過來
這可以是 一整串connectionString 或 connectionString內的DB名稱

請問,要如何在報表端,根據前端傳過來的connx,動態組成使用不同DB的Connection,抓不同DB的資料
謝謝

https://ithelp.ithome.com.tw/upload/images/20240527/201040956AY67Pvxmd.png

=========================2024.05.28 參考 說明,但都有問題

https://ithelp.ithome.com.tw/upload/images/20240528/20104095EKlSPQoupA.png
https://ithelp.ithome.com.tw/upload/images/20240528/20104095w8xfM4AF4M.png

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中
0
網世儒凮
iT邦新手 4 級 ‧ 2024-05-29 10:02:36
最佳解答

https://fastreports.github.io/FastReport.Documentation/PassingOwnConnectionString.html
你可以參考網頁的第二種方式
https://ithelp.ithome.com.tw/upload/images/20240529/20113415bmMyhoe18G.png
在報表編輯器 Datasource 下的connection 下面屬性視窗 ConnectionStringExpression property 加入 MyParameter
https://ithelp.ithome.com.tw/upload/images/20240529/20113415RyCtf1qC4Y.png
然後在程式裡面參數方式自行判斷要連哪個資料庫
https://ithelp.ithome.com.tw/upload/images/20240529/20113415E6sRDsVbWb.png

noway iT邦研究生 2 級 ‧ 2024-05-30 11:44:05 檢舉

您好: 從新貼到WWW ,可以了
謝謝您!

0
sam0407
iT邦大師 1 級 ‧ 2024-05-28 10:09:04

沒有用過Final Report,但剛剛看了線上文檔,以下幾篇您參考看看囉~~
[平台]Microsoft SQL Server数据连接
[设计器]JNDI连接数据库
[设计器]JDBC连接数据库
数据集

noway iT邦研究生 2 級 ‧ 2024-05-28 14:38:33 檢舉

您好:
謝謝您
但是要找 Fast report
不是您提供的 fine report (需要費用)

sam0407 iT邦大師 1 級 ‧ 2024-05-29 10:03:12 檢舉

呵呵,老眼昏花看錯了,
FastReport也有線上文件呀,
以下連結是.NET的用法,您參考一下:
Class MsSqlDataConnection

noway iT邦研究生 2 級 ‧ 2024-05-30 11:44:37 檢舉

謝謝您了!

0

There are certainly some challenges and more research needed with the GPO implementation approach, but there are also many areas that have already been implemented. Overall, there is much more research to be done with the GPO approach.
Source: poppy playtime chapter 3

我要發表回答

立即登入回答