?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. Note: Make sure to change the print medium type back to screen if you want to print the report on the screen.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 will set the print medium type to file, and the file name to be a combination of the sales ID and the print time. Settings.fileName(strFmt(‘%1_%2’, parmSalesId, printTime)) In the above code, I have modified the following lines: ![]() Settings.fileFormat(SRSReportFileFormat::PDF) Ĭontroller.parmExecutionMode(SysOperationExecutionMode::Synchronous) Settings.fileName(strFmt('%1_%2', parmSalesId, printTime)) Settings.printMediumType(SRSPrintMediumType::File) SRSPrintDestinationSettings settings = controller.parmReportContract().parmPrintSettings() SalesId parmSalesId = enumerator.current() ĭeliver圜reditNoteController controller = new Deliver圜reditNoteController() Ĭontroller.parmTableRecId(custPackingSlipJour.RecId) Ĭontroller.parmReportName(ssrsReportStr(Deliver圜reditNoteReport, Report)) ![]() SetEnumerator enumerator = salesIdSet.getEnumerator() SalesIdSet.add(custPackingSlipTransTmp.OrigSalesId) ![]() & custPackingSlipTransTmp.DeliveryDate = custPackingSlipJour.DeliveryDate & custPackingSlipTransTmp.PackingSlipId = custPackingSlipJour.PackingSlipId Where custPackingSlipTransTmp.SalesId = custPackingSlipJour.SalesId Str printTime = System.String::Format('', timeInUserTz) ĬustPackingSlipJour custPackingSlipJour = _args.record() ĬustPackingSlipTrans custPackingSlipTransTmp,custPackingSlipTrans UtcDateTime timeInUserTz = DateTimeUtil::applyTimeZoneOffset(DateTimeUtil::utcNow(), DateTimeUtil::getUserPreferredTimeZone()) I use the following code to print multiple ssrs on the screen, and then export to pdf, but I found that the file name of all pdf is composed of the last printed salesid: public static void main(Args _args)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |