![]() I believe this fulfills your initial request of adding the filmname into the output filename. Then in STEP 4 of your data-driven subscription you need to change the setting for "File name" to "Get the value from the database" and select the FILENAME field from the dropdown. This gives you an extra output column called FILENAME, containing the dynamic filename with the name of the film in it. SELECT filmname, 'TheaterList_' + filmname AS FILENAME FROM SomeTable What you can now do is change this query to the following: That makes a lot of sense, no discussion about that.īased on that information, I would think that you are rendering several reports, one for each film stored in your database (possibly with other filters but that's not important at this point).įurthermore, as you're using data-driven subscription, in STEP 3 you probably have set up a query that retrieves your filmnames so that you can pass them into the report. Procedures and these Stored Procedures are getting called in SSRS reports. Looking at your initial request plus some extra info from your replies, you are passing a parameter called "filmname" into the report and you want that parameter's value to be part of the filename when rendered into a file share using data-driven subscription. Stored procedures can dynamically create a SQL statement and execute it. In fact, since my first reply I've been giving you the instructions on how it can be done. But I need this while user downloading report. In subscription, it is generated on scheduled basis right. After generating the report, if user download the report as excel/pdf, I have to give file name dynamically. It's absolutely clear to me what you're trying to do, and I do believe that it's possible. From SSRS reports, user can download report as pdf, excel etc. In case I have misunderstood your question and you're asking how you can add the date parameter when the user clicks the Export button in the Report Manager (interactively), the answer is: it's not possible and the filename needs to be entered manually. ![]() Unless through a sort of configuration (or maybe "report scheduling") table in a database.įor some more info on these types of subscription, have a look here: But I don't see how the user is supposed to enter a date directly in the report parameter in combination with data-driven subscription. I can understand why you'd want the date parameter in the filename, and as far as I can tell that should not be a problem using data-driven subscription. Note: Make sure to change the print medium type back to screen if you want to print the report on the screen.How exactly is the user supposed to enter the date when you're using data-driven subscription? The whole point of subscription is that the reports are getting generated automatically, without any user interaction. 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. |