Export to Excel - removing linked report hyperlinks

  • I have a master report that has "Jump to report" (direct report with parameters) hyperlinks. Naturally, the hyperlink URL has all sorts of hidden parameters and credentials that are implemented by SSRS.

    Everything works fine in the web browser. However, if I export the main report to Excel, the hyperlink detail (http://...), including the report server path, and ALL parameters are also exported behind the cells. Naturally, this is totally unacceptable due to the security issues.

    However, an export to PDF doesn't export out the hyperlink URLs.

    Does anyone know how to prevent the hyperlink URLs from being exported when exported to Excel (or any other format)?


    [font="Arial Narrow"](PHB) I think we should build an SQL database. (Dilbert) What color do you want that database? (PHB) I think mauve has the most RAM.[/font]

  • Hi

    As far as I know there is no way to directly achieve this in SSRS2005 and I've not seen any enhancements to this effect in SSRS2008. The way I overcome the problems with exporting to excel normally is to add a boolean parameter that the user checks to say they want the excel version. This would then remove the URL's conditionally based on the parameter.

    The problem here is that because your issue is one of security, this doesn't really cut it, because there is nothing to stop the user from selecting NO, then exporting it anyway.

    If this report can be scheduled to run automatically then that's what I'd do, just remove it from any available lists for the user to run it, then schedule the report to run automatically to Excel.

    Not much help I know, but maybe it'll save you some time looking for an answer.

    Nigel West
    UK

  • Can you post the expression you're using to conditionally turn off hyperlinks? Do you have to modify each Navigation node one at a time or can it be done on the report level?

  • Nevermind, found the syntax...

    In the expression where you put your report name you would do something like:

    =iif(Parameters!RemoveHyperlinks.Value, Nothing, "ReportName") instead of just ReportName

    Assuming you had a parameter called RemoveHyperLinks

  • Ok !! this is great!!

    But If we used reportviewer to export to excel then how do I fix to disable the hyperlink( or link of servername).

    Advance Thanks !!

  • You should be able to pass the parameter RemoveHyperlinks=True to the report viewer before it displays the report...

    Unfortunately, if you've shown the report with hyperlinks (if the parameter is missing or set to false) and the user choose the export to Excel the hyperlinks will come through. There is not much you can do to prevent that other than to educate the users. Maybe it will get better in the next release.

  • But how to pass the parameter to reportviewer? any custom function you'r talking about?

    really this issue is blocking to me

    Thanks in advance!!!

  • Interesting topic.

    I'm having the same issue over here.

    We got a custom made reporting portal in ASP.NET. Users can choose their parameters on that portal before opening te report. Parameter security is done in this portal so a user can only choose parameter which he's allowed to choose. Nothing wrong with this.

    Now I got a report with some hyperlinks to other reports. When I export this report to Excel, the hyperlinks are intact. When I click on one of these hyperlinks, the reportmanager opens and I can see all of the parameters in the url. I'm afraid that users will change the ID's of the parameters to get information their not allowed to see.

    Is there a way I can tackle this problem?

    Edit:

    I had some discussion with a developer here and we got a nice solution to prevent uers from editing the parameters in the drillthrough report. I'll post this solution on my blog tomorrow!

  • I'm struggling with the same issue. You mention you have a solution and a blog? Any chance of letting me know where I can see this info?

    Thanks in advance,

    Matt

  • I made a blog of it but sorry, it's in Dutch only (click)

  • I had the same sort of problem, combined with the issue of Excel merging cells etc. My report has drilldowns and hyperlinks to subreports etc and the whole thing just looked rubbish when exported to Excel.

    So, I added a boolean parameter (Excel format: Yes/No) on the report.

    The report has a second table that formats the data with just one header row, and one data row, and no grouping or hyperlinks.

    Then its simply a case of testing the boolean parameter in the Visibility>Hidden property of the tables to display either the formatted table or the Excel-friendly table (=Parameters!paramExcelFormat.Value).

    Not a security solving problem I know,as per previous post re users still running reports without selecting the excel option can still see the hyperlink code, but it solves the problem of messy Excel exports.

    Of course being Reporting Services its not *quite* that simple, there are one or two other things to do to make it work:-

    - You have to set the visibility of all textboxes (report name, page number etc) to hidden if the Excel format is selected, otherwise these textboxes can cause cell merging. The only thing that can remain visible on the report is the Excel-friendly table.

    - You have to put your Excel-friendly table at the very top of the report to avoid a blank row in Row A.

    Hope that helps 🙂

  • We also created a custom reporting site using the report viewer control. To overcome the export issue turned off all the controls on the report viewer bar and created a custom controls with a back button and drop downs to export the report. That way we could control what export types they could choose and what hyperlinks got added to the excel export.

  • codesight (11/11/2008)


    We also created a custom reporting site using the report viewer control. To overcome the export issue turned off all the controls on the report viewer bar and created a custom controls with a back button and drop downs to export the report. That way we could control what export types they could choose and what hyperlinks got added to the excel export.

    I can't create a custom portal unfortunately. FYI you can modify the standard RS Server to exclude export options :-

    Locate and open the rsreportserver.config file with a text editor. C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\rsreportserver.config

    (Replacing my MSSQL.2 with your Report Server Instance ID).

    Locate the config section:

    Find the config entry.

    remove the export options you don't want. Sorry haven't tried this myself because I am not actually in the IT department, just found it on the web...

  • Hi I'm trying this out a bit confused, can anyone help me on this :

    1. I add a new parameter in the report named : "RemoveHyperLinks"

    2. I've a matrix table displaying the results, this is where all the server name and parameter information appears as hyperlink in excel report.

    3. Below Fix suggest by another guy, where I should be placing this statement? in the Matrix Filter collection?

    =iif(Parameters!RemoveHyperlinks.Value, Nothing, "ReportName") instead of just ReportName

    Please help. Thank you for your time.

    Sunny

  • Go to the textbox properties --> Action --> where you specify a report --> add this expression

    =IIF(Globals!RenderFormat.Name = "EXCEL", Nothing,"Detail Report Name")

    Hope it works!

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic. Login to reply