简体   繁体   English

如何转移以SSRS中的表达式进行报告

[英]How to divert to report with expression in SSRS

Hi I have a SSRS Report in which i get a table report. 嗨,我有一个SSRS报告,其中有一个表格报告。

 ╔══════════════╦════════════════╦════════════════╗
 ║ Company Name ║ Customer Count ║ Employee Count ║
 ╠══════════════╬════════════════╬════════════════╣
 ║ Company A    ║ 1000           ║ 50             ║
 ╠══════════════╬════════════════╬════════════════╣
 ║ Company B    ║ 2000           ║ 100            ║
 ╠══════════════╬════════════════╬════════════════╣
 ║ Company C    ║ 3000           ║ 150            ║
 ╚══════════════╩════════════════╩════════════════╝

I want to go to report by Company Name. 我想按公司名称报告。

Suppose if User click on Company A Then it should go to Report CompanyAReport . 假设用户单击Company A ,则应转到Report CompanyAReport

If i click on Company B it should redirect to CompanyBReport . 如果我单击Company B ,则应重定向到CompanyBReport

To Achieve this scenario you have to create a separate report which will load details of the company. 要实现此方案,您必须创建一个单独的报告,该报告将加载公司的详细信息。 So another report which might be drill down report of the company which gives list all Employees or customers of the company. 因此,另一个报告可能是公司的向下钻取报告,该报告列出了公司的所有员工或客户。

And you have to put the link on your report to redirect to another report with the parameters like. 而且,您必须将链接放在报表上,才能使用类似的参数重定向到另一个报表。

In your report there will be tablix in which you will display all companies data. 在您的报告中,将使用tablix来显示所有公司数据。 In that tablix textbox for CompanyName you have to open the property window like in below image. 在CompanyName的tablix文本框中,您必须打开下图所示的属性窗口。

在此处输入图片说明

in above image for textbox property there will be Action tab in that you can set action (href) where you want to redirect when user clicks on company name. 在上图的文本框属性中,将存在“操作”选项卡,您可以在其中设置操作(href),以便在用户单击公司名称时重定向到该位置。 You can also set the parameters of the report that you need to pass to open that report. 您还可以设置打开该报告需要传递的报告参数。

Assuming the company report will be the same for both Company A and Company B then.. 假设公司A和公司B的公司报告相同。

Create a new report ()called say, _subCompanyReport ) that takes a parameter CompanyName . 创建一个新的报告()称为_subCompanyReport ,它使用参数CompanyName

Build a dataset that gets the info you need eg SELECT * FROM myCompanyTable WHERE CompanyName = @CompanyName 建立获取所需信息的数据集,例如SELECT * FROM myCompanyTable WHERE CompanyName = @CompanyName

Add whatever you need to show on that report. 添加您需要在该报告上显示的所有内容。

Go back to your original report, right-click the company name cell and and choose textbox properties . 返回原始报告,右键单击公司名称单元,然后选择textbox properties

Click Action , select Go to Report , choose _subCompanyReport from the report list 单击Action ,选择“ Go to Report_subCompanyReport从报表列表中选择_subCompanyReport

Click Add to add a parameters, choose or type CompanyName (case sensitive) in the Name field and finally select the "Company name" column from your report in the Value field. 单击“ Add以添加参数,在“名称”字段中选择或键入CompanyName (区分大小写),最后在“值”字段的报告中选择“公司名称”列。

That's pretty much it. 就是这样。 If you have problems, makes sure all parameter names are spelled correctly, they are case sensitive. 如果遇到问题,请确保所有参数名称的拼写正确,并且区分大小写。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM