I have an issue with print and that is with print command on 2nd time.Here is the simple scenario..
I initialized report viewer of html5. On a button click i refresh report with new data source and added "viewer.commands.print.exec()" for print. It works for the first time. But Second time report is refreshed but is not printed.Here is my Refresh Codeviewer =
What can be the issue. I am using Q3_2014 v 8.2
8 Answers, 1 is accepted
On updating the viewer's reportSource, test binding to the viewer's renderingEnd event, which indicates when the report is ready and displayed in the viewer. Then after printing, unbind the event handler, to avoid issues on export or other operations in the viewer.
I hope the provided information is helpful.
it really worked as required.
You solution worked but it created another problem. I increases the number of print commands as much as print button is clicked. At 1st click one print is send and dialogue is shown once. But if i cancel the print and click the print button again it shows the dialogue 2 times.
Please tell me how can it be resolved.
Please check if the report is not refreshed twice, which will cause the renderingEnd event to fire. Updating the viewer's reportSource will automatically refresh the viewer, the calling refreshReport will refresh the viewer once again.
Test removing the call to the refreshReport method.
I had list of reports to be printed on one button click. What is suddenly started being wrong is that the print dialogue doesn't stops the code from being execute and 2nd report print call closes the first print dialogue, don't have time to send print.
This issue was actually fix on my previous reply but from few days it has been doing it again. What i have changed in this while is upgraded my kendo.all.min.js but my telerik report versions are same..
Can you please guide me what can be the real cause of this issue?
If you are using custom UI, test using the viewer's printBegin and printEnd events to disable and then re-enable the custom UI that triggers the viewer's print operation.
Telerik by Progress
Couldn't resolve the issue with these events as i already have applied onRenderingEnd event.
I have written the following code according to your previous answer,
which is supposed to stop execution at line 25 until print dialogue is closed (was working for a long time) but it continues and refreshes viewer for new report. No clue why?.
At line 25, you are invoking the print command of the viewer. The viewer is not aware about the user's choice to print or to close the Print dialog, as it is out of the scope of the Reporting engine. The Print dialog belongs to the browser's PDF plugin that handles the PDF file delivered by the Reporting REST Service to the client. You have a timeout after calling the print command, that can slow down consecutive operations.
If you are using the viewer only to print a report, not to display it, please consider the approach from Print a report directly at client-side without displaying it in a Viewer.
Telerik by Progress