![]() Kick off the subscription and once it is done. Make sure that you put it in a Begin Transaction Commit Transaction Block or the subscription may fire before the changes are committed, this actually happened in one of my tests. Then update the fields in the SSRS and SharePoint tables. My solution was to stored all current values of necessary IDs and the report name and path in a table before updating the SSRS and SharePoint tables. The second is the tp_LeafName field in the dbo.AllUserData table. The first is the LeafName field in the dbo.AllDocs table. Remember that in an integrated mode the report is also a document in SharePoint.īoth of these additional fields are in the WSS_Content_Reports database. ![]() If you are running a SharePoint integrated instance of SSRS then there are two other places that must be updated in order for you to successfully kick off the subscription via SQL. Would love to see comments by anyone else who is able to do this! If(url.indexOf("viewer.aspx") > 0) (window.open) // Override the window.I'm going to give the missing info on SSRS running in SharePoint integrated mode. Var newWindow = open(url, name, features) // Set to variable so we can run additional Javascript Var newFileName = ("quotenumber").getValue() // Change to anything you want For convenience, you can download the script here. To use the script below, create a new Web Resource in CRM and set the onload event for the form to setReportFilename. So, in the end, I did end up using a timing function but in this case, I used setInterval instead of a recursive setTimeout in addition, I also utilized regex to change the FileName value, both of which resulted in a simpler approach. Given the above, attempting to set the ExportUrlBase when the iframe finishes loading or when the DOM is ready won’t work (specifically because everything is generated via Javascript) in fact, the onload for the iframe will fire, but remember that the source for the iframe is a blank document! Unfortunately, the best way to tackle this is to use timing to ensure that the reportViewer object finally gets loaded. ?ReportSession=&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=&OpType=Export&FileName=&ContentDisposition=OnlyHtmlInline&Format= Which should result to something similar the following: You can inspect ExportUrlBase in the report window using IE8’s Developer Tools (hit F12):ĭocument.getElementById("resultFrame").contentWindow.$find("reportViewer")._getInternalViewer().ExportUrlBase The key here is to modify the ExportUrlBase property because that is what contains the FileName URL parameter. When you export a report, a URL is dynamically generated based on the ExportUrlBase property of the reportViewer object.Javascript is then used to dynamically build the HTML within the iframe using an object called reportViewer.When viewer.aspx loads, it first loads a blank HTML file ( /_static/blank.htm) into an iframe.After several hours, I finally understood why Alex (who wrote the above article) used setTimeout in his code: So, I went about rewriting the code to utilize an event-driven approach ( onload, onreadystatechange, etc.). Testing it out, it worked without a hitch, however, I wasn’t too fond of using setTimeout in Javascript from past experience, using a paradigm that depends on timing is a mistake. We decided to try out the code, so we added it as a web resource and placed the setHandler function in the onload event of the Quote form. Then a colleague pointed me to this article, which uses Javascript to rename the file using SSRS’s URL parameter FileName. It probably is possible to do it that route, but many people would be averse to attempting to do such a thing. At first I thought of attempting to modify the viewer.aspx file by inserting Javascript there. As you probably already know, there’s no built-in way to specify the filename of a report you want to export to PDF, Excel, Word, etc. This one took a while to figure out so I hope this saves people a few hours of tinkering. Then a colleague pointed me to this article.įirst off, the code for the below solution can be downloaded here. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |