Make ExcelIO server-side work with mono without X-Server

Originally Posted 7 June 2017, 3:21 pm EST

  • Originally Posted 7 June 2017, 3:21 pm EST

    Hi,

    We would like to run excelIO server-side on a docker environment using Mono.
    The docker container doesn't have a X-Server (no display) so we have an exception because ExcelIO need System.Windows.Forms functions to work.


    Unhandled Exception:
    System.TypeInitializationException: The type initializer for 'System.Windows.Forms.XplatUI' threw an exception. ---> System.ArgumentNullException: Could not open display (X-Server required. Check your DISPLAY environment variable)
    Parameter name: Display
    at System.Windows.Forms.XplatUIX11.SetDisplay (System.IntPtr display_handle) [0x00408] in :0
    at System.Windows.Forms.XplatUIX11..ctor () [0x00077] in :0
    at System.Windows.Forms.XplatUIX11.GetInstance () [0x00019] in :0
    at System.Windows.Forms.XplatUI..cctor () [0x00066] in :0
    --- End of inner exception stack trace ---
    at System.Windows.Forms.TextRenderer.MeasureTextInternal (System.Drawing.IDeviceContext dc, System.String text, System.Drawing.Font font, System.Drawing.Size proposedSize, System.Windows.Forms.TextFormatFlags flags, System.Boolean useMeasureString) [0x00007] in :0
    at System.Windows.Forms.TextRenderer.MeasureText (System.Drawing.IDeviceContext dc, System.String text, System.Drawing.Font font, System.Drawing.Size proposedSize, System.Windows.Forms.TextFormatFlags flags) [0x00000] in :0
    at GrapeCity.SpreadSheet.BCL.Service.WinForm.ExcelMeasureStringService.MeasureString (System.String text, System.String fontName, System.Double fontSize, System.Boolean wordWrap, System.Boolean bold, System.Boolean italic, System.Double width) [0x00144] in :0
    at fv+d.c () [0x000c8] in :0
    at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00014] in :0
    at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in :0
    at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in :0
    at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in :0
    at System.Threading.ThreadHelper.ThreadStart () [0x00008] in :0
    [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'System.Windows.Forms.XplatUI' threw an exception. ---> System.ArgumentNullException: Could not open display (X-Server required. Check your DISPLAY environment variable)
    Parameter name: Display
    at System.Windows.Forms.XplatUIX11.SetDisplay (System.IntPtr display_handle) [0x00408] in :0
    at System.Windows.Forms.XplatUIX11..ctor () [0x00077] in :0
    at System.Windows.Forms.XplatUIX11.GetInstance () [0x00019] in :0
    at System.Windows.Forms.XplatUI..cctor () [0x00066] in :0
    --- End of inner exception stack trace ---
    at System.Windows.Forms.TextRenderer.MeasureTextInternal (System.Drawing.IDeviceContext dc, System.String text, System.Drawing.Font font, System.Drawing.Size proposedSize, System.Windows.Forms.TextFormatFlags flags, System.Boolean useMeasureString) [0x00007] in :0
    at System.Windows.Forms.TextRenderer.MeasureText (System.Drawing.IDeviceContext dc, System.String text, System.Drawing.Font font, System.Drawing.Size proposedSize, System.Windows.Forms.TextFormatFlags flags) [0x00000] in :0
    at GrapeCity.SpreadSheet.BCL.Service.WinForm.ExcelMeasureStringService.MeasureString (System.String text, System.String fontName, System.Double fontSize, System.Boolean wordWrap, System.Boolean bold, System.Boolean italic, System.Double width) [0x00144] in :0
    at fv+d.c () [0x000c8] in :0
    at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00014] in :0
    at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in :0
    at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in :0
    at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in :0
    at System.Threading.ThreadHelper.ThreadStart () [0x00008] in :0


    We can use "Xvfb" to simulate the monitor, but it can be great if ExcelIO doesn't need System.Windows.Forms to work.

    We also have an other error using mono (but the ssjson is generated) :

    Unhandled Exception:
    System.NotImplementedException: The method or operation is not implemented.
    at GrapeCity.Spread.Sheets.ExcelIO.Spread+SpreadJsonConverter.a () [0x0005c] in :0
    at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00014] in :0
    at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in :0
    at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in :0
    at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in :0
    at System.Threading.ThreadHelper.ThreadStart () [0x00008] in :0
    [ERROR] FATAL UNHANDLED EXCEPTION: System.NotImplementedException: The method or operation is not implemented.
    at GrapeCity.Spread.Sheets.ExcelIO.Spread+SpreadJsonConverter.a () [0x0005c] in :0
    at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00014] in :0
    at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in :0
    at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in :0
    at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in :0
    at System.Threading.ThreadHelper.ThreadStart () [0x00008] in :0


    Thanks
  • Reply

    Hello,

    We have escalated your issue to our concerned team for further investigation. We will get back to you as soon as we hear anything from them.

    Tracking id for your issue is #236694.

    Thanks,
    Reeva
  • Marked as Answer

    Reply

    Hello,

    Unfortunately, our current ExcelIO server-side component could not work with mono. We regret the inconvenience.

    Thanks,
    Reeva
Need extra support?

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

Learn More

Forum Channels