6 Answers, 1 is accepted
I guess different report viewers will need different approaches or it may not be even possible for some of the viewers due to the used technology differences. Can you tell us what viewer you are using and also why do you need to execute a c# method?
The report viewer use is the Visual Studio 2013 Telerik Report Viewer for Silverlight. The reason why I need this is to set a record flag true once the record(s) have been exported so they are not exported twice.
With the specified version of Telerik Reporting you will need to extract the viewer's template and modify it with custom UI through which the export is handled programmatically - Exporting Report in Silverlight. This will allow you to detect the beginning and the end of the export, and execute custom logic for recording the user's action and disabling the custom UI.
I hope the above information is helpful.
Regards,
Stef
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Its quite late, but I have similar query
I have to use telerik silverlight report viewer default save button.
When user click on save button ExportBegin event called.
I want some event which can call after user clicks on Save &/or Cancel button on Confirm dialog box (which appear after click save button on silverlight report viewer menu)
I have checked to the style file it contains one
telerikReporting:DialogBox x:Name="ExportDialog"
with one save button having command as SaveExportCommand
I want to override this SaveExportCommand command. so that custom filter controls on same silverlight control can be kept disable till user not click on save /cancel button.
please help.
Such event is not exposed. The ExportBeging and Exportend events indicate when the reporting engine is done with the export. The user selection to save or not the document are not registered by the viewer.
An event that will fire during and after the ExportEnd event is UpdateUI. A custom solution will be to count the UI elements displayed by the viewer and to detect when the viewer is done with the export e.g.:
bool
_isExportFinished =
false
;
int
_numberOfUIElements = 0;
public
MainPage()
{
InitializeComponent();
ReportViewer1.ExportBegin += ReportViewer1_ExportBegin;
ReportViewer1.ExportEnd += ReportViewer1_ExportEnd;
ReportViewer1.UpdateUI += ReportViewer1_UpdateUI;
}
void
ReportViewer1_UpdateUI(
object
sender, EventArgs e)
{
if
(_isExportFinished)
if
(_numberOfUIElements == 1)
{
MyControl.IsEnabled =
true
;
_isExportFinished =
false
;
_numberOfUIElements--;
}
else
_numberOfUIElements++;
}
void
ReportViewer1_ExportEnd(
object
sender, EventArgs e)
{
_isExportFinished =
true
;
}
void
ReportViewer1_ExportBegin(
object
sender, Telerik.ReportViewer.Silverlight.ExportBeginEventArgs args)
{
MyControl.IsEnabled =
false
;
}
More reliable approach will be to use custom UI and to export tha report programmatically, where the save operation can be implemented by you - Exporting Report in Silverlight.
Regards,
Stef
Telerik by Progress