Detect within a report if running in SharePoint integrated mode or Native mode
For a drillthrough using an expression, I have to specify the .rdl extension in SharePoint integrated mode but I have to leave it off when running in preview or native mode. Is there some means of detecting which so I can have my drillthrough working in both modes?Nick Ryan SQL Server Developer OnePath (NZ) Ltd
August 5th, 2012 11:01pm

Hi Nick, Yes, you could use the Globals!ReportServerURL property to detect if the report is running in SharePoint Integrated mode or in Native mode. The ReportServerURL property is available / has a value only in Native mode whereas in SharePoint Integrated mode, it is empty. So I am guessing an expression like the one below could be used: =IIf ( IsNothing (Globals!ReportServerUrl), "Running in SharePoint Integrated Mode", "Running in Native Mode" ) I am pretty sure this should work. You could just replace the True and False parts of the expression above to include or exclude the ".rdl" from your drill through expression, something like that below: =IIf ( IsNothing (Globals!ReportServerUrl), ".rdl", "" ) Just another point to be noted: This value is not set even when the report is run / designed in BIDS. So, you might just want to keep this is mind. Please ignore if you already are aware of this. Please let me know if you need more info. HTH. Cheers, IceQB Please mark correct answers :)
Free Windows Admin Tool Kit Click here and download it now
August 6th, 2012 5:00am

Hi Thanks for the suggestion. It doesn't actually work the way you thought because the URL is returned in SharePoint integrated mode. I set it up the way you show and found it was trying to connect to the report without the .rdl extension so I put the URL in a text box on the report and tried again. Sure enough, it's populated. However, this does suit the majority of what I'm doing as I can use the IsNothing to specify the report without the .rdl and with the .rdl otherwise and it will work when I'm developing in BIDS and when I deliver it to SharePoint. Won't work if I have to use a native Report Server but that's OK for me as I don't often have to do that. I wonder if what you thought about the URL depends on which version of SharePoint it is hosted in? Regards, NickNick Ryan SQL Server Developer OnePath (NZ) Ltd
August 6th, 2012 5:36pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics