I try to use the version 2012.3 for printing the report en landscape. My report is configured en landscape. But when i call InvokePrintReport() i receive une exception like this :
à System.Windows.Printing.PrintDocument.PrintInternal(String documentName, PrinterFallbackSettings printerFallbackSettings, Boolean useDefaultPrinter)
à System.Windows.Printing.PrintDocument.Print(String documentName)
à Stimulsoft.Report.Viewer.StiPrintReport.Print()
à Stimulsoft.Report.Viewer.StiSLViewerControl.OnPrintReport(EventArgs e)
à Stimulsoft.Report.Viewer.StiSLViewerControl.InvokePrintReport()
à CIBApplication.ReportHelper.service_LoadReportCompleted(Object sender, LoadReportCompletedEventArgs e)
à CIBApplication.ReportServiceReference.ReportServiceClient.OnLoadReportCompleted(Object state)
My code on side Serveur :
Code: Select all
public string LoadReport(string reportName, string reportParam)
{
if (!string.IsNullOrEmpty(reportName))
{
StiReport report = new StiReport();
report.Load(HttpContext.Current.Server.MapPath("/Reports") + "\\" + reportName + ".mrt");
report.Dictionary.Databases.Remove(report.Dictionary.Databases[0]);
report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("CIB",
"CIB",
ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString,
false));
report.Compile();
report["monParam1"] = reportParam;
report.Render(false);
return StiSLRenderingReportHelper.CheckReportOnInteractions(report, true);
}
return null;
}
Side Client :
Code: Select all
private void service_LoadReportCompleted(object sender, ReportServiceReference.LoadReportCompletedEventArgs e)
{
myReportViewer.progress.Start("ReportService", StiLocalization.Get("DesignerFx", "LoadingDocument"), false);
if (e.Error == null && e.Result != null && e.Result.Length > 2)
{
myReportViewer.ApplyRenderedReport(e.Result);
}
else
{
MessageBox.Show("Erreur à la génération de l'édition");
}
myReportViewer.progress.Close();
myReportViewer.progress = null;
myReportViewer.InvokePrintReport();
}