请教前辈,birt多个报表如何设置统一公用数据源
展开全部
csdn上的问答也是你发的么,我看到问题是一模一样的,那上面的回答还蛮多的,你可以参考下,下面我也提供一种百度搜到的答案(因为我用的是FineReport,不大用你这种要写很多代码的)。
1
2
3
4
5
6
IReportEngine birtEngine = ...;
IReportRunnable runnable = birtEngine.openReportDesign(...);
IRunAndRenderTask runAndRenderTask = birtEngine.createRunAndRenderTask(runnable);
Map appContext = runAndRenderTask.getAppContext();
Connection conn = ...;
appContext.put(IConnectionFactory.PASS_IN_CONNECTION,conn);
1
2
3
4
5
6
IReportEngine birtEngine = ...;
IReportRunnable runnable = birtEngine.openReportDesign(...);
IRunAndRenderTask runAndRenderTask = birtEngine.createRunAndRenderTask(runnable);
Map appContext = runAndRenderTask.getAppContext();
Connection conn = ...;
appContext.put(IConnectionFactory.PASS_IN_CONNECTION,conn);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询