Sql server reporting services select text
I'm using ssrs with the winforms ReportViewer
control to display reports to my users. Sometimes they want to select some of the text that the report outputs. But the ReportViewer
control does not give us that ability, it just renders the text. Is there some property that I can change in the .rdl report or some property in the ReportViewer
control that would give me that ability.
I've trie开发者_如何学运维d to google, but can't find anything.
Any help would be greatly appreciated. :)
You can let them export the report out as a PDF or an EXCEL file - that should give them the entire contents
One possible solution is to create kind of you own ReportViewer control.
Step 1 Use the SOAP Reporting Services to query your catalogs, find the reports you have, find their parameters and allowed values, default values etc.
Some starting points:
Documentation (for most recent version)
Another SO question
Step 2 Then offer your users some basic interface to select parameters. You might have to create this on your own but with a little bit of skills this is done in couple of hours, maybe you can find samples.
Step 3 Build a ReportServer URL that is required to query the report with the selected parameter values and get the report rendered as MHTML from the reporting services Url Access. This allows you to get the whole report as one piece without requirement to pull for example charts or any other pictures afterwards from the server. The result can easily be thrown into a webbrowser control and there you go, you can select content.
Sample:
var partialPath = System.Web.HttpUtility.UrlEncode(RelativeReportPath);
//RelativeReportPath is sth. like /YourFolder/YourReportName
var fullPath = string.Format("http://YourReportSereverDNS/ReportServer?{0}&rs:Command=Render&rc:Toolbar=false&rs:Format=MHTML", partialPath);
var client = new RestClient(fullPath);
client.Authenticator = new HttpBasicAuthenticator(@"domain\user", "SuperSecretPassword");
var request = new RestRequest(Method.GET);
var response = client.Execute(request);
//then throw response.Content into a Webbrowser Control in your winforms
Good luck (if you or anyone else is still interested) :-)
精彩评论