|
![]() |
#1 |
Участник
|
a33ik: SSRS renderingCompleted delegate
Источник: http://daxonline.org/1664-ssrs-rende...-delegate.html
============== Comment from: \Classes\SrsReportRunController\renderingCompleted /// Write event handlers and hook into this to handle the rendering complete event. /// IMPORTANT NOTE: Please ensure you register your event handler in preRunModifyContract method. /// This will ensure that event is called in both batch and interactive scenario. /// For interactive cases controller main method is called. For batch case controller run method is called. /// Both batch and interactive call preRunModifyContract prior to running report. /// If using SrsPrintMgmtController you can also register this event in runPrintMgmt method. Subscription: \Classes\CustInterestNoteFormLetterController\main SrsReportRunController reportRunController = new CustInterestNoteFormLetterController(); reportRunController.parmReportName(PrintMgmtDocType::construct(PrintMgmtDocumentType::CustInterestNote).getDefaultReportFormat()); reportRunController.parmArgs(_args); reportRunController.renderingCompleted += eventhandler(CustInterestNoteFormLetterController::renderingComplete); reportRunController.startOperation(); Standard example: \Classes\CustInterestNoteFormLetterController\renderingComplete public static void renderingComplete(SrsReportRunController _sender, SrsRenderingCompletedEventArgs _eventArgs){ CustInterestJour custInterestJour; InterestNote interestNote; Query query; QueryRun queryRun; FormRun formRun; SRSReportExecutionInfo executionInfo = _eventArgs.parmReportExecutionInfo(); if(executionInfo && executionInfo.parmIsSuccessful()) { // Get the report's query query = _sender.parmReportContract().parmQueryContracts().lookup(_sender.getFirstQueryContractKey()); // Mark all interest notes "Printed" queryRun = new QueryRun(query); ttsbegin; while(queryRun.next()) { interestNote = queryRun.get(tableNum(CustInterestJour)).(fieldNum(CustInterestJour, InterestNote)); update_recordset custInterestJour setting Printed = NoYes::Yes where custInterestJour.InterestNote == interestNote && !custInterestJour.Printed; } ttscommit; // Refresh the grid formRun = _sender.parmArgs().caller() // as FormRun // ; if(FormRun) { formRun.dataSource(1).research(true); } }} Источник: http://daxonline.org/1664-ssrs-rende...-delegate.html |
|
|
Опции темы | Поиск в этой теме |
Опции просмотра | |
|