This is a migrated thread and some comments may be shown as answers.

print dialog not showing

5 Answers 164 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
richard
Top achievements
Rank 1
richard asked on 11 Apr 2013, 12:46 PM
On my development pc I have used some ideas from this forum to implement direct printing from Silverlight( well sorta direct as it skips showing the reportviewer). The user is supposed to be presented the Print dialog box which works great on my dev PC. When moving the xap and dlls to the testing server the user is never shown the print dialog box therefore nothing happens.

Any ideas why it wont show on the server?

Thanks much,
Richard

5 Answers, 1 is accepted

Sort by
0
richard
Top achievements
Rank 1
answered on 12 Apr 2013, 03:22 PM
ok I made sure the win server 2003 had all of its updates installed...still doesnt work.
0
Peter
Telerik team
answered on 15 Apr 2013, 01:53 PM
Hi Richard,

We will need additional information. Please share the printing code you have used. Generally our recommendation is to review the following forum thread. Additionally you may find useful the Silverlight Printing MSDN article. 

All the best,
Peter
the Telerik team

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

0
richard
Top achievements
Rank 1
answered on 15 Apr 2013, 07:40 PM
1) the reportviewer is defined in the xaml
2) the URI is all defined in the XAML
3) this works on local dev PC
4) I upload to the server and nothing happens after pressing the Print button - no error is returned or raised when it should show the system Print Dialog box

here is the code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Telerik.ReportViewer.Silverlight;
using Telerik.Reporting.Service.SilverlightClient;
 
namespace PW.Views
{
  public partial class DirectPrintPup : ChildWindow, IReportServiceClientFactory
  {
    bool printFlag, runOnce;
    string _title, _text, _liter, _mfg, _model, _year, _vin, _images, _sections;
    Models.Company _C;
    int _engid;
 
    public DirectPrintPup(Models.Company C, string mfg, string model, string liter, string year, string vin, int engid, string sections)
    {
      InitializeComponent();
 
      progressBar1.Minimum = 0;
      progressBar1.Maximum = 10;
 
      progressBar1.Value = 1;
      PrintButton.Visibility = Visibility.Collapsed;
 
      this.ReportViewer1.ReportServiceClientFactory = this;
 
       printFlag = false;
  
     _C = C;
      _mfg = mfg;
      _model = model;
      _liter = liter;
      _year = year;
      _vin = vin;
      _engid = engid;
      _sections = sections;
 
      progressBar1.Value = 2;
 
      this.ReportViewer1.RenderBegin += new Telerik.ReportViewer.Silverlight.RenderBeginEventHandler(ReportViewer1_RenderBegin_3);
 
      printFlag = true;
     }
 
    ReportViewerModel viewModel;
    ReportViewerModel ViewerModel
    {
      get
      {
        if (viewModel == null && VisualTreeHelper.GetChildrenCount(this.ReportViewer1) > 0)
        {
          var layoutRoot = (FrameworkElement)VisualTreeHelper.GetChild(this.ReportViewer1, 0);
          viewModel = (ReportViewerModel)layoutRoot.DataContext;
        }
        progressBar1.Value = 5;
        PrintButton.Visibility = Visibility.Visible;
        return viewModel;
      }
    }
 
    public ReportServiceClient Create(Uri remoteAddress)
    {
      var serviceClient = new ReportServiceClient(remoteAddress);
      serviceClient.RenderAndCacheCompleted += new EventHandler<RenderAndCacheEventArgs>(serviceClient_RenderAndCacheCompleted);
      progressBar1.Value = 10;
 
      return serviceClient;
    }
 
    void serviceClient_RenderAndCacheCompleted(object sender, RenderAndCacheEventArgs e)
    {
      if (printFlag)
      {
        ViewerModel.PrintReportCommand.Execute(null);
        progressBar1.Value = 6;
 
      }
      printFlag = false;
    }
 
    private void ReportViewer1_RenderBegin_3(object sender, RenderBeginEventArgs args)
    {
      args.ParameterValues["mfg"] = _mfg;
      args.ParameterValues["model"] = _model;
      args.ParameterValues["vin"] = _vin;
      args.ParameterValues["year"] = _year;
      args.ParameterValues["liter"] = _liter;
      args.ParameterValues["engid"] = _engid;
      args.ParameterValues["sections"] = _sections;
      args.ParameterValues["name"] = _C._Cname;
      args.ParameterValues["address"] = _C._Caddress;
      args.ParameterValues["city"] = _C._Ccity;
      args.ParameterValues["state"] = _C._Cstate;
      args.ParameterValues["zip"] = _C._Czip;
      args.ParameterValues["phone"] = _C._Cphone;
      args.ParameterValues["email"] = _C._Cemail;
      progressBar1.Value = 4;
    }
 
     private void CancelButton_Click(object sender, RoutedEventArgs e)
    {
      this.DialogResult = false;
      this.Close();
    }
 
     private void PrintButton_Click(object sender, RoutedEventArgs e)
     {
       progressBar1.Value = 10;
 
       printFlag = true;
       try
       {
         this.PrintReport();
       }
       catch (Exception ex)
       {
         MessageBox.Show("print exception");
       }
     }
 
     void PrintReport()
     {
       this.ViewerModel.PrintReportCommand.Execute(null);
       this.Close();
     }
  }
0
Stef
Telerik team
answered on 18 Apr 2013, 03:45 PM
Hi Richard,

The issue you are having is most probably due the fact that you have set the ReportViewer.UseNativePrinting property to false and you are using Firefox 19 or later. For more information please check this help article about True Print - with this setting printing depends on the browser's PDF plug-in. If you have issues only in Firefox 19 or later, the reason is in the newly introduced native PDF plug-in in it. The fix is available in Telerik Reporting Q1 2013 internal builds.

If this is not your issue please elaborate and it will be best if you can provide us with runnable samples so that we are able to reproduce the issue locally and advise you more accordingly.

Kind regards,
Stef
the Telerik team

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

0
richard
Top achievements
Rank 1
answered on 18 Apr 2013, 04:13 PM
i use Chrome and yes it is set to FALSE. Also tried IE 9.

Anyways I give up...went back to showing the ReportViewer.

Case can be closed.
Tags
General Discussions
Asked by
richard
Top achievements
Rank 1
Answers by
richard
Top achievements
Rank 1
Peter
Telerik team
Stef
Telerik team
Share this question
or