trappistb
trappistb

Reputation: 1

Open PDF from file on report server dynamically not just by copying url

Hi I have tried in vain to get a pdf file to open from pdf files in the report server I have saved to a folder. I can create a link using the rs:Command=GetResourceContents when I open the file from report server and copy the URL but I need it to be dynamic so adding the table field name matchesing the pdf name, this opens the folder with all the docs but not open the actual PDF??

Anyone help with this please draining my brain for something I hope is simple.

I have tried this: file://MyServer/ReportServer/Test/Docs/MyDoc.pdf This comes back as file not found.

Also I tried action - URL again doesnt open the file just the main folder? ="https://MyServer/ReportServer/Test/="+Fields!Document_Name.Value

Would be good to nail this thx

Upvotes: 0

Views: 518

Answers (1)

Alan Schofield
Alan Schofield

Reputation: 21683

I'm not sure I understand what you mean when you talk about a table, but if you wanted a list of PDF's in a folder on SSRS and then wanted to click a link to open them you can do so like this.

Build a report which uses something like the following as the dataset query for a table.

select Path, Name, ItemID  from catalog where path like '/My PDF Folder/%' 

Then you can build a URL that will open the file directly, and place this expression in a new column in the table.

You have two main options...

="http://myServerName/reportserver?" & Fields!Path.Value & "&rs:Command=GetResourceContents"

or

="http://myServerName/reports/api/v1.0/CatalogItems(" & Fields!ItemID.Value & ")/Model.Resource/Content/$value"

I've not tested this so if there is an issue, let me know and I'll build something to test it against

Upvotes: 0

Related Questions