Error when printing report, after publish my site

Posted by: gefferson on 10 September 2017, 11:50 am EST

  • Posted 10 September 2017, 11:50 am EST

    Hi!

    In my machine, the reports works very well...
    But, after publish my site (in UOL Host (www.uolhost.com.br)), the reports don´t works anymore
    This error occurs!!!

    {"Message":"Request failed.","StackTrace":" at C1.C1Preview.PrinterUtil.#xB(Int32 mask)rn at C1.C1Preview.PrinterUtil.FindBestPrinter(Single minDpi, Single& bestPrinterDpi)rn at C1.C1Preview.C1PrintDocument.SelectBestMeasurementDevice()rn at C1.C1Preview.C1PrintDocument.InitMeasurementDevice()rn at C1.C1Preview.C1PrintDocument.InitDocument()rn at C1.C1Preview.C1PrintDocument..ctor(String info, Boolean doNotResetPageSettingsToDefault, Boolean doNotUpdatePageCount)rn at C1.C1Report.Layout..ctor(C1Report report)rn at C1.C1Report.C1Report.Initialize()rn at C1.C1Report.C1Report..ctor(String runtimeKey)rn at C1.Web.Wijmo.Controls.C1ReportViewer.C1ReportViewer.CreateC1Report()rn at SuperaWeb.DataAccess.Report..ctor(String pReportName, String pXmlFilePath, String recordSource, String pConnectionString, String pReportDescription) in D:\M_Z\superaweb\AJAX EXT.NET 2.X\SuperaWeb\SuperaWeb.DataAccess\MZLISTR\Report.vb:line 30rn at SuperaWeb.MZListR.report_Initialize(Hashtable rptConf) in D:\M_Z\superaweb\AJAX EXT.NET 2.X\SuperaWeb\SuperaWeb\App\MZLISTR\MZListR.asmx.vb:line 58","ExceptionType":"System.Security.SecurityException"}

    Any help??
  • Replied 10 September 2017, 11:50 am EST

    This problem has caused me great inconvenience ...

    Does anyone have any tips on where I can begin to unravel this problem?
  • Replied 10 September 2017, 11:50 am EST

    Hello Gefferson,

    I tried hosting a website and printing some reports but it worked properly at my end. There might be several causes for this exception like:
    1. It might be possible that the website is unable to find any printer.
    2. Make sure that you have set propert trust level while hosting the site as it might not allow the webpage to access the printer.

    Are you able to print any other page from website which does not use C1Report ? Which build are you using ?

    Could you kindly share a small sample replicating the issue so that I can check hosting it at my end and can assist you further ?

    Regards
  • Replied 10 September 2017, 11:50 am EST

    Hi Jindal!!!

    Thanks for your reply!!!

    I would like try investigate the topics that you enumerated.

    1. It might be possible that the website is unable to find any printer.
    How I can check this???

    2. Make sure that you have set propert trust level while hosting the site as it might not allow the webpage to access the printer.
    I don´t find in userpanel of my host service a option to configure a trust level!!! This configuration is a configuration of Windows or the IIS server?

    What hosting service you use? I wish try publish my application in this service, for tests!


    Thanks for your attention, again! I appreciate this!
    Regards.
  • Replied 10 September 2017, 11:50 am EST

    Hi Jindal!

    Thanks for your reply!

    I think so not!

    I install ISS 7.5 Express in a machine with Windows 7!
    Install my web application in this server!
    Remove all printers (Fax and Microsoft XPS was installed only and I removed it)...
    I set the security level of user to medium!
    restart the machine...
    Tryed access my application and works very fine.

    And also my application don´t print in server side... I open the report in reportviewer first. But my application is rendered in server side and after is opened in reportviewer...

    There are another test that I should execute?
  • Replied 10 September 2017, 11:50 am EST

    Hello Gefferson,

    Could you kindly answer the below questions:
    1. Are you able to print the report on the Windows 7 machine where you tested ?
    2. Are you only using Print button of the Wijmo ReportViewer ? Because if you are using PrintDialog method as well then it would require printer to be installed on server else will give the above error.

    Also, kindly share a small sample replicating the issue so that I can check the same at my end and can assist you accordingly ?

    Regards
  • Replied 10 September 2017, 11:50 am EST

    >>1. Are you able to print the report on the Windows 7 machine where you tested ?
    No, because no printer installed in this machine... only IIS 7.5 Express is installed in this machine. But, i opened the report IN MY MACHINE (accessing IIS 7.5 Express, over intranet), and printed this report without problems.

    >>2. Are you only using Print button of the Wijmo ReportViewer ? Because if you are using PrintDialog method as well then it would require printer to be installed on server else will give the above error.
    The problem occurs before renderer document! Before any attempt to print.
    More specific, in this line:
            mvarC1Report = C1.Web.Wijmo.Controls.C1ReportViewer.C1ReportViewer.CreateC1Report


    I made a little sample, as attached.
    In my machine, works very fine!!!
    If I publish in my hosting service, a error occurs!
    You can see the published test project in
    http://beta.superaweb.net
    2012/11/WebApplication11.zip
  • Replied 10 September 2017, 11:50 am EST

    Hi Jindal!!!

    More informations about this problem!!!

    I'm publishing the sample project in HostGator, and the same error occurs...

    If you want, I can create for you a login and password to view the configurations of website!!!
  • Replied 10 September 2017, 11:50 am EST

    Hi All!

    This problem occurs because the IIS in hosting service was configured to 'medium trusted'...

    I move my webapplication to arvixe.com, and works very fine!!!

    thanks a lot for help!!!
  • Replied 10 September 2017, 11:50 am EST

    Hello,

    I think the problem occurs because you are using Print method of the PrintDocument which is a server side method. So, when you try to print the report then it tries to find any printer at the server. But since, you are using a Third party server which does not have any printer attached, this results the above error.

    Therefore, I would suggest you to user Print button of the ReportViewer instead of using Print method of the PrintDocument object.

    Hope it clarifies.

    Regards
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels