StiSLViewerControl.InvokePrintReport Exception

Stimulsoft Reports.Silverlight discussion
Locked
ruby103
Posts: 5
Joined: Wed Dec 05, 2012 10:34 pm

StiSLViewerControl.InvokePrintReport Exception

Post by ruby103 »

Hello,
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(); 
    }
Do you have any hint for me ?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: StiSLViewerControl.InvokePrintReport Exception

Post by HighAley »

Hello.

We couldn't find an exception message.
Please, send us a sample working project to reproduce the issue.

Thank you.
ruby103
Posts: 5
Joined: Wed Dec 05, 2012 10:34 pm

Re: StiSLViewerControl.InvokePrintReport Exception

Post by ruby103 »

Hello
Thank you for the quickly responce. But, i coudnt send the working project... it is so big and it uses SQLServer for the data. I used the version 2011 before, now i update the version to 2012.3. So, i copy the projet WCFHelper witch is in in Sample in my projet . Is there a problem ?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: StiSLViewerControl.InvokePrintReport Exception

Post by HighAley »

Hello.

At first, please, send us a message of the exception.

Thank you.
ruby103
Posts: 5
Joined: Wed Dec 05, 2012 10:34 pm

Re: StiSLViewerControl.InvokePrintReport Exception

Post by ruby103 »

Hello :

Exception is :
DialogueBox should be initiated by the user.
(It was in french like this: Les boîtes de dialogue doivent être déclenchées par l'utilisateur. And I translate this into English.)

Details :
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)
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: StiSLViewerControl.InvokePrintReport Exception

Post by HighAley »

Hello.

Due to Silverlight restrictions it's impossible to show any dialog window without user action. For example, you could do it in the button click event.

Thank you.
ruby103
Posts: 5
Joined: Wed Dec 05, 2012 10:34 pm

Re: StiSLViewerControl.InvokePrintReport Exception

Post by ruby103 »

Hello,

Thank you very much for your response. But it was fine with the version 2011. In the version 2011, InvokePrintReport() worked

well, is just that i cant print my report in landscape automatically. I want to know if there has another possibility for that exception.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: StiSLViewerControl.InvokePrintReport Exception

Post by HighAley »

Hello.

Please, send us a working sample project to reproduce the issue.

Thank you.
Locked