Server wants to display Form on WebReport-creation when no Printer is installed

ASP.NET

ASP.NET AJAX & iPhone Controls

Server wants to display Form on WebReport-creation when no Printer is installed

  • rated by 0 users
  • This post has 7 Replies |
  • 1 Follower
  • Hello!

     

    I have the problem that the WebReport, or the underlying C1Preview wants to display a Form on the WebServer. This causes an exception.

    I have already tried to set the Registrykey Current_USER\Software\ComponentOne\C1PrintDocument\DisableNoPrintersWarning

    But this doesn't seem to prevent the preview from trying to display the message.

    I can install some printer and after a restart the Preview doesn't try to display this message anymore.

    This is the output of the exception that is raised:

    Server Error in '/HB_DPS' Application.
    --------------------------------------------------------------------------------

    Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.

    Source Error:


    Line 36:         </tr>
    Line 37:     </table>
    Line 38: <cc2:C1WebReport ID="C1WebReport1" runat="server" Height="360px" Width="861px" Scrollable="False" style="left: 20px; position: relative">
    Line 39:             <NavigationBar Style-BackColor="Transparent" Text="Seite {0} / {1}">
    Line 40:             </NavigationBar>
     

    Source File: c:\Inetpub\wwwroot\HB_DPS\ReportPage.aspx    Line: 38

    Stack Trace:


    [InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.]
       System.Windows.Forms.Form.ShowDialog(IWin32Window owner) +2084181
       System.Windows.Forms.Form.ShowDialog() +6
       C1.C1Preview.Forms.WarningForm.ShowWarning(String warningText, String warningDisableRegistryKey) +155
       C1.C1Preview.C1PrintDocument.SelectBestMeasurementDevice() +139
       C1.C1Preview.C1PrintDocument.InitMeasurementDevice() +27
       C1.C1Preview.C1PrintDocument.CloneMeasurementGraphics(Graphics& graphics, IntPtr& dc) +20
       C1.C1Preview.C1PrintDocument.InitDocument() +28
       C1.C1Preview.C1PrintDocument..ctor(String info) +98
       C1.C1Report.Layout..ctor(C1Report report) +78
       C1.C1Report.C1Report.Initialize() +59
       C1.C1Report.C1Report..ctor(String runtimeKey) +150
       C1.Web.C1WebReport.C1ReportWrapper..ctor() +10
       C1.Web.C1WebReport.C1WebReport..ctor() +153
       ASP.reportpage_aspx.__BuildControlC1WebReport1() in c:\Inetpub\wwwroot\HB_DPS\ReportPage.aspx:38
       ASP.reportpage_aspx.__BuildControlWrContainer() in c:\Inetpub\wwwroot\HB_DPS\ReportPage.aspx:17
       ASP.reportpage_aspx.__BuildControlContent1(Control __ctrl) in c:\Inetpub\wwwroot\HB_DPS\ReportPage.aspx:7
       System.Web.UI.CompiledTemplateBuilder.InstantiateIn(Control container) +12
       ASP.masterpage_master.__BuildControlContentPlaceHolder1() in c:\Inetpub\wwwroot\HB_DPS\MasterPage.master:37
       ASP.masterpage_master.__BuildControlform1() in c:\Inetpub\wwwroot\HB_DPS\MasterPage.master:20
       ASP.masterpage_master.__BuildControlTree(masterpage_master __ctrl) in c:\Inetpub\wwwroot\HB_DPS\MasterPage.master:1
       ASP.masterpage_master.FrameworkInitialize() in c:\Inetpub\wwwroot\HB_DPS\MasterPage.master.cs:912307
       System.Web.UI.UserControl.InitializeAsUserControlInternal() +31
       System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +1978592
       System.Web.UI.Page.get_Master() +48
       System.Web.UI.Page.ApplyMasterPage() +18
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +543

     


    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

     

    Any thoughts on how I can suppress this message? Thanks a lot!

     

     

     

  • Which version of C1Report are you using? This should not occur in versions 2.6.20093.53204 or later.

    But in any case, the registry workaround should work - PROVIDED you set it on the correct user registry tree, please double check that (normally your current user would be different). Also note that you must set that key to a non-0 value (e.g. 1).

    Hope this helps.

    Cheers, Dima.
  • Hello Dima!

     

    Thanks for your help.

     

    I currently use the following function to disable the PrinterWarning:

     

    protected bool DisablePrinterWarning()

    {

     

    if (Registry.CurrentUser.OpenSubKey(@"Software\ComponentOne\C1PrintDocument") != null)

     

    return false;

     

    RegistryKey rkBase = Registry.CurrentUser.CreateSubKey(@"Software\ComponentOne\C1PrintDocument");

     

    if (rkBase.GetValue("DisableNoPrintersWarning") == null)

    {

    rkBase.SetValue(

    "DisableNoPrintersWarning", 1, RegistryValueKind.DWord);

     

    return true;

    }

     

    return false;

    }

     

    The Dll-Version is 2.6.20092.52106. Was there a problem with this version? Where can I get the current version?

     

    Thanks a lot!

     

     

     

     

  • You can get the current version from http://prerelease.componentone.com/

    Cheers, Dima.
  • Thanks. I tried the release version of 2.6.20101.54005 for the WebReport first. I need to release a working version as soon as possible so I want to go the release-route here.

    There is no C1WebGrid-class anymore, is that correct? Is the C1GridView-Control supposed to replace it?

     

    Thanks for your help.

  • Some additional questions, I have replaced all the C1WebGrids by C1GridViews, now on every page I have this control an exception is raised "A ScriptManager control mus exist on the current page". How do I get this working again?

    And: I have all .Net-Fraemworks up to 3.5 installed on my PC. In the Web-Application-project in Visual Studio 2005 I seemingly cannot select the GridView for .net version 2 into the Toolbox. But when I have dragged a .net 3 GridView onto a page, I can delete the references to C1.Web.UI.3.dll and C1.Web.UI.Controls.3.dll and it gets compiled.

    I would like to stick to .net version 2 for now.

    I have to say it gets increasingly difficult and cumbersome to update to a new C1-Version. I think I have all the changes in the licx-file made but there is still a lot to update. Especially as there has been a reword of the namespace- and class-structure. Are there any how-tos on what I have to do to convert a project from the old structure to the new one?

     

    Thanks!

  • Look, I am not a C1WebGrid developer (I am a C1Report/C1WebReport developer, not a general support person), so I do not know much about C1WebGrid. I only asked you to upgrade your C1WebReport version to build 2.6.20093.53204 or later - NOT other controls. None of the C1WebReport builds posted on our site requires .NET 3.5 - they all should happily work with 2.0. Basically, all you need to do is get a C1WebReport zip (e.g. the latest one is http://prerelease.componentone.com/dotnet20/c1webreport/2010-t1/C1WebReport.2_2.6.20101.54005.zip - but if you do not have 2010 v1 license you could get http://prerelease.componentone.com/dotnet20/c1webreport/2009-t3/C1WebReport.2_2.6.20093.53218.zip) and rebuild your app with that (but please make sure that the dlls that are being used by your server have REALLY been upgraded - sometimes they stay cached for a while, so e.g. a server reboot may be required). Please let me know if that helps.

    If you continue to have problems with C1WebGrid - please post a question in the corresponding forum, I really do not know much about it and cannot answer those questions.

    Thanks.

    Cheers, Dima.
  • Hello Dima!

    I'm sorry to have asked you about the C1WebGrid as this is not the correct forum for doing so.

    However, I got this WebGrid-problem sorted out by reverting to an old Version, but sticking to the new WebReport-Version. In the current WebReport-Version, the registry-setting works again and I can produce reports without the need for an installed printer. This as an FYI for anyone running into the same problem.

    Thanks again for your help  regarding the C1WebReport.

     

    Best regards,

Page 1 of 1 (8 items)