问题
I have a url string that I'm getting from the DB for a file in my sharepoint server e.g.
http://mysharepointserver.com/abc/def.jpg
and I would like to get the url path e.g. http://mysharepointserver.com/abc removing the file name. Can someone please give me an example on how this can be done in SSRS? I'm using SSRS 2012 but I'm fairly new to SSRS.
Any help greatly appreciated.
Vince.
回答1:
You could write some custom code on the report. There is a Code property on the report itself where you can write VB functions. One similar to this should do the job.
Function GetPath(ByVal FullPath As String) As String
Return System.IO.Path.GetDirectoryName(FullPath)
End Function
Then in the expression on a Textbox you can call the function.
=Code.GetPath("http://mysharepointserver.com/abc/def.jpg")
For more detailed step by step instructions try http://msdn.microsoft.com/en-us/library/ms156028.aspx
来源:https://stackoverflow.com/questions/17334131/ssrs-url-path-string-manipulation