简体   繁体   中英

How to divert to report with expression in SSRS

Hi I have a SSRS Report in which i get a table report.

 ╔══════════════╦════════════════╦════════════════╗
 ║ 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 .

If i click on Company B it should redirect to 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. In that tablix textbox for CompanyName you have to open the property window like in below image.

在此处输入图片说明

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. 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..

Create a new report ()called say, _subCompanyReport ) that takes a parameter CompanyName .

Build a dataset that gets the info you need eg 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 .

Click Action , select Go to Report , choose _subCompanyReport from the report list

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.

That's pretty much it. If you have problems, makes sure all parameter names are spelled correctly, they are case sensitive.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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