We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Exception when using Autofit feature in Unix environment

Hi,

When I run in unix environment with autofit prpoerty then the following exception is coming.(worksheet.autoFitColumns();):

Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.

at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)

at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:175)

at java.lang.Class.forName1(Native Method)

at java.lang.Class.forName(Class.java:180)

at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:91)

at java.awt.Font.initializeFont(Font.java:333)

at java.awt.Font.(Font.java:368)

at javax.swing.plaf.metal.DefaultMetalTheme$FontDelegate.getFont(DefaultMetalTheme.java:224)

at javax.swing.plaf.metal.DefaultMetalTheme.getFont(DefaultMetalTheme.java:182)

at javax.swing.plaf.metal.DefaultMetalTheme.getControlTextFont(DefaultMetalTheme.java:158)

at javax.swing.plaf.metal.MetalLookAndFeel$FontActiveValue.createValue(MetalLookAndFeel.java:1479)

at javax.swing.UIDefaults.getFromHashtable(UIDefaults.java:231)

at javax.swing.UIDefaults.get(UIDefaults.java:161)

at javax.swing.MultiUIDefaults.get(MultiUIDefaults.java:73)

at javax.swing.UIDefaults.getFont(UIDefaults.java:381)

at javax.swing.UIManager.getFont(UIManager.java:524)

at javax.swing.LookAndFeel.installColorsAndFont(LookAndFeel.java:119)

at javax.swing.plaf.basic.BasicLabelUI.installDefaults(BasicLabelUI.java:343)

at javax.swing.plaf.basic.BasicLabelUI.installUI(BasicLabelUI.java:295)

at javax.swing.JComponent.setUI(JComponent.java:484)

at javax.swing.JLabel.setUI(JLabel.java:267)

at javax.swing.JLabel.updateUI(JLabel.java:277)

at javax.swing.JLabel.(JLabel.java:170)

at javax.swing.JLabel.(JLabel.java:241)

at com.aspose.cells.aR.(Unknown Source)

at com.aspose.cells.j.a(Unknown Source)

at com.aspose.cells.j.(Unknown Source)

at com.aspose.cells.Worksheet.i(Unknown Source)

at com.aspose.cells.Worksheet.autoFitColumns(Unknown Source)

at com.avon.infomanagement.util.pdfutil.ExcelBuilder.setWorksheetProperty(ExcelBuilder.java:1706)

at com.avon.infomanagement.util.pdfutil.ExcelBuilder.saveDocument(ExcelBuilder.java:1164)

at com.avon.infomanagement.util.pdfutil.ExcelBuilder.drawData(ExcelBuilder.java:565)

at com.avon.infomanagement.util.pdfutil.ExcelBuilder.execute(ExcelBuilder.java:139)

at com.avon.infomanagement.util.pdfutil.ReportManager.startJobManager(ReportManager.java:159)

at com.avon.infomanagement.util.pdfutil.ReportManager.main(ReportManager.java:65)

When I remove the autofit apply code the program is working fine , This program with autofit featur is working fine in windows environment.

Couild you please help me out what could be reason ?

Thanks,

Satish Madadi

Hi Satish Madadi,

I think you may try to set some Env variables for your issue on your machine.

Please check the following thread for your reference: <A href="</A></P> <P>Thank you. </P>

Hi Amjad,

Its worked for me .thank you.