帆软报表 js 调用sql_SQL Server中的报表–创建由先前创建的主报表调用的基于矩阵的子报表

本文介绍如何在帆软报表中通过js调用SQL,创建一个子报表,当用户点击图表上的特定月份时,显示相应的矩阵数据。作者详细讲解了从创建存储过程到构建子报表和矩阵,以及参数传递的过程,最后展示了如何在主报表中调用子报表并显示实际月份名称。
摘要由CSDN通过智能技术生成

帆软报表 js 调用sql

Introduction

介绍

As you will remember from our last “get together” we created an application that permitted us to report upon financial data based upon an unorthodox financial year. In fact, our fiscal year started in July and ended in June. We created a chart to display the data.

您可能会记得,从上次“ 聚会 ”开始,我们创建了一个应用程序,该应用程序使我们能够基于非正统的财务年度报告财务数据。 实际上,我们的会计年度从7月开始,到6月结束。 我们创建了一个图表来显示数据。

In today’s “get together” we are going to push our application a bit further and build in a subreport which will bring up the underlying data when the end user clicks upon the chart for any particular month. Thus should the user click on February 2015, then all of February’s data (for the selected funds) is shown in a matrix. If the user chooses March, then March’s data is shown.

在今天的“聚在一起”中,我们将进一步推动我们的应用程序并构建一个子报表,当最终用户单击任何特定月份的图表时,该子报表将显示基础数据。 因此,如果用户单击2015年2月,则矩阵中将显示2月份的所有数据(针对选定的资金)。 如果用户选择三月,则显示三月的数据。

Without further ado, let’s get started!

事不宜迟,让我们开始吧!

入门 ( Getting Started )

We begin by opening SQL Server Data Tools and opening the project that we created in the article entitled “Setting run dates on the fly”.

我们首先打开SQL Server数据工具,然后打开在标题为“即时设置运行日期”的文章中创建的项目。

Our report surface is brought into view. We note that at this stage in the game, that all we have is the chart.

我们的报告界面已成为现实。 我们注意到在游戏的这个阶段,我们所拥有的只是图表。

In SQL Server Management Studio, we open the stored procedure that we created for this chart.

在SQL Server Management Studio中,我们打开为此图表创建的存储过程。

We are now going to clone an additional stored procedure that will utilize an additional parameter and render the raw data behind the graph; the contents of which will be dependent upon which value of year month that is passed through via the main report. The code listing may be seen in Addenda 1.

现在,我们将克隆一个附加的存储过程,该过程将使用附加的参数并将原始数据呈现在图形后面。 其内容将取决于通过主报表传递的年份月份的值。 代码清单可以在附录1中看到。

The reader will note that we have added the parameter @YearMth to the stored procedure header (see above). Additionally, we have declared a variable @YearMth and set this variable to ‘201502’. This will be commented out once we are ready to create the new stored procedure.

读者会注意到,我们已将参数@YearMth添加到存储过程标头中(请参见上文)。 此外,我们已声明变量@YearMth并将此变量设置为'201502'。 一旦我们准备创建新的存储过程,这将被注释掉。

In the screen dump above, we are able to view the result set generated by the query.

在上面的屏幕转储中,我们可以查看查询生成的结果集。

返回报告服务 ( Back in Reporting Services )

We right click upon the “Reports” folder and select “Add” and “New Item”.

我们右键单击“ Reports”文件夹,然后选择“ Add”和“ New Item”。

We select “Report” and give our report a name “DatesOnTheFlySubReport”. We click “Add” and we are brought into the “DatesOnTheFlySubReport” subreport drawing surface (see below).

我们选择“报告”,并将报告名称命名为“ DatesOnTheFlySubReport”。 单击“添加”,然后将其带到“ DatesOnTheFlySubReport”子报表工程图表面(请参见下文)。

We add a “Matrix” report item from the tool box (see above).

我们从工具箱中添加了一个“矩阵”报告项(见上文)。

We now must create dataset. Should you be unfamiliar with the concept of “data sources” and “

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值