Hello,
I'm currently facing problem loading the report (using silverlight viewer) in the old way I did on Q2... I need to load the report when the user passes 2 parameters and click a button
here's my code...
here's the Report Loaded event
can you please provide me a sample where when I click on a button it calls a report with 2 parameters?
Thanks..... as far as I've seen the BeginRender event is not fired when I click the button (it was done in the previous version when it calls
Thanks
Paolo
I'm currently facing problem loading the report (using silverlight viewer) in the old way I did on Q2... I need to load the report when the user passes 2 parameters and click a button
here's my code...
private void btnCarica_Click(object sender, RoutedEventArgs e)
{
LoadRendiconto();
}
private void LoadRendiconto()
{
reportViewer.Visibility = Visibility.Visible;
//tbErrore.Visibility = Visibility.Collapsed;
if (dtPicker.IsDateValid() && ucRapporto.RapportoSelezionato != null)
{
reportViewer.Height = double.NaN;
var reportViewerModel = reportViewer.DataContext as ReportViewerModel;
Telerik.Reporting.Service.Parameter paramRapporto = new Telerik.Reporting.Service.Parameter();
paramRapporto.Name = "Rapporto";
paramRapporto.Type = typeof(int).FullName;
paramRapporto.Value = ucRapporto.RapportoSelezionato.IDInterno;
Telerik.Reporting.Service.Parameter paramData = new Telerik.Reporting.Service.Parameter();
paramData.Name = "Data";
paramData.Type = typeof(DateTime).FullName;
paramData.Value = dtPicker.SelectedDate;
// parameters.Add(paramUser);
if (reportViewerModel.Parameters != null)
{
reportViewerModel.Parameters.Add(paramRapporto);
reportViewerModel.Parameters.Add(paramData);
}
// if (reportViewerModel.ApplyReportParametersCommand.CanExecute(null))
reportViewerModel.ApplyReportParametersCommand.CanExecute(null);
//if (!IsFromHistory)
// AddItemToHistory();
SetHeader();
}
//else
//{
// reportViewer.Visibility = Visibility.Collapsed;
// tbErrore.Visibility = Visibility.Visible;
//}
}
here's the Report Loaded event
private void Report_Loaded(object sender, RoutedEventArgs e)
{
this.reportViewer.RenderBegin += new RenderBeginEventHandler(reportViewer_RenderBegin);
if (IsFirstLoad)
{
ucRapporto.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(ucRapporto_PropertyChanged);
if (IsFromHistory)
{
ucRapporto.ForzaLostFocus();
}
SetFirstLoad(false);
}
}
can you please provide me a sample where when I click on a button it calls a report with 2 parameters?
Thanks..... as far as I've seen the BeginRender event is not fired when I click the button (it was done in the previous version when it calls
reportViewerModel.ApplyReportParametersCommand.CanExecute(null);
)Thanks
Paolo