ssrs url path string manipulation

让人想犯罪 __ 提交于 2019-12-24 15:08:19

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!