Hi,
I'm using SL4 and Telerik Reporting with the latest components from Q1 2011!
From the other threads I used the mechanism to directly print reports
without first showing them within ReportViewer:
private void button1_Click(object sender, RoutedEventArgs e)
{
var layoutRoot = (FrameworkElement)VisualTreeHelper.GetChild(this.ReportViewer1, 0);
var viewerModel = (ReportViewerModel)layoutRoot.DataContext;
viewerModel.ApplyReportParametersCommand.Execute(null);
viewerModel.PrintReportCommand.Execute(null);
}
Always the first time the parameter is not applied.
The mechanism for that is:
private void ReportViewer1_RenderBegin(object sender, RenderBeginEventArgs args)
{
args.ParameterValues["Parameter1"] = textBox1.Text;
}
The Xaml-Code:
<telerik:ReportViewer Grid.Row="1" x:Name="ReportViewer1"
Width="1000" UseNativePrinting="False"
telerikControls:StyleManager.Theme="{Binding SelectedItem, ElementName=ThemeSelector}"
ReportServiceUri="../ReportService.svc"
Report="ClassLibrary1.Report1, ClassLibrary1" RenderBegin="ReportViewer1_RenderBegin" />
When I make the ReportViewer big enough to observe I can see that the report is rendered
correctly even the first time!
But the printed document has only the report skeleton missing the real data.
From the second call on (button click) the parameter will be applied and its is working fine.
If I toggle the UseNativePrinting to true (the new default) it works also the first time.
Unfortunately I will need the UseNativePrinting=false option to get the reports with landscape-mode
immediately ready to print.
Please help me!
It is urgent since it should have been a fast switch from the old Q2 2010 Reporting.components
to the latest version and I have to deploy immediately.
Best Regards
Andrew
var r =
new
ProfitSystemReports.SalesByCategory();
r.ReportParameters[
"startDate"
].Value = Model.StartDate;
r.ReportParameters[
"endDate"
].Value = Model.EndDate;
ReportViewer1.Report = r;