0

I am trying to open a URL in an SSRS report in a new window. I have used the following expression: ="javascript:void(window.open(escape("+ Fields!ImagePath.Value + "),'_blank'))". Nothing happens when I click on the field (Fields!ImagePath.Value). I have also tried removing the "escape" expression. I've also used the REPLACE function in my SQL statement to replace the "\" with %5C. On the occasion when it has more or less worked, the backslashes are dropped entirely.

Dale K
  • 25,246
  • 15
  • 42
  • 71
TomLenzmeier
  • 49
  • 1
  • 10

3 Answers3

1

This worked: ="javascript:void(window.open('" + Replace(Fields!ImagePath.Value, "\", "/") + "','_blank'));" The clue, for me, was swapping out the back-slash for a forward-slash.

TomLenzmeier
  • 49
  • 1
  • 10
0

Try this. Open SSRS URL in New Window

="javascript:void(window.open('" & Fields!ImagePath.Value & "'))"
Community
  • 1
  • 1
SS_DBA
  • 2,403
  • 1
  • 11
  • 15
0

Try this:

="javascript:void(window.open('" + Fields!ImagePath.Value + "','_blank'));"
SMM
  • 2,225
  • 1
  • 19
  • 30
  • I get an error saying the image is invalid. The path that is returned is http://intranet.xxx.com/sqlReports/FFScannedImage.php?image=003VENDORPREQUALIFICATIONp71567.pdf and the backslashes have been dropped. The correct path is http://intranet.xxx.com/sqlReports/FFScannedImage.php?image=003%5CVENDOR%5CPREQUALIFICATION%5C16071567.pdf – TomLenzmeier Dec 05 '16 at 13:22
  • Sounds like an encoding issue. Can you paste those links as code blocks so that characters don't get replaced? – SMM Dec 05 '16 at 13:45
  • The full path is "http://intranet.xxx.com/sqlReports/FFScannedImage.php?image=003\VENDOR\PREQUALIFICATION\12076029.PDF" When the URL comes up, it says invalid image and that's because all of the backslashes get dropped. It displays in the browser as "http://intranet.xxx.com/sqlReports/FFScannedImage.php?image=003VENDORPREQUALIFICATION12076029.PDF". The field has the entire URL. I've tried using the REPLACE function where the "\" is replaced with %53. – TomLenzmeier Dec 05 '16 at 17:12
  • Can you show how you are using the replace function in your expression? Also, I think backslash should be %5C... – SMM Dec 05 '16 at 18:09
  • Replace(Field.ImagePath.Value, "\", "%5C") I also tried it in the stored procedure: REPLACE(ImagePath, '\', '%5C') AS ImagePath. – TomLenzmeier Dec 05 '16 at 18:21
  • It looks right to me but we don't have backslashes in any of our URLs. You night need to ask this as a separate question. – SMM Dec 05 '16 at 18:52