B4J Question jPOI ForegroundColor (PoiCellStyle) ,Excel 2003

eric19740521

Member
Licensed User
Longtime User
I download this example, try to execute, the following error occurs

Excel 2003 ,not 2007

bug.error:
Waiting for debugger to connect...
Program started.
Error occurred on line: 37 (Main)
java.lang.NumberFormatException: For input string: "0x00ff00ff"
    at java.base/jdk.internal.math.FloatingDecimal.parseHexString(FloatingDecimal.java:2082)
    at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1870)
    at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
    at java.base/java.lang.Double.parseDouble(Double.java:543)
    at anywheresoftware.b4a.BA.ObjectToNumber(BA.java:434)
    at b4j.example.main._createworkbook(main.java:155)
    at b4j.example.main._appstart(main.java:83)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
    at b4j.example.main.start(main.java:38)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Thread.java:834)

I found it was caused by the foreground color.
block it





block it:
   Dim titleStyle As PoiCellStyle
    titleStyle.Initialize(wb)
    titleStyle.BorderBottom = titleStyle.BORDER_THIN
    'titleStyle.ForegroundColor = fx.Colors.Green.As(Int)
 
    titleStyle.HorizontalAlignment = titleStyle.HORIZONTAL_CENTER

I changed it to this, but it didn't work

B4X:
titleStyle.ForegroundColor = xui.Color_Blue

Is there any way? Can use color on excel 2003.thank you all
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

eric19740521

Member
Licensed User
Longtime User
I see this line
  • Supports both xls and xlsx (Excel 2007+ format). jExcel only supports the old format.
Also can only try Excel 2007
 
Upvote 0

eric19740521

Member
Licensed User
Longtime User
Currently there is only Excel 2003 version, so learn from JPOI first,

jPOI 5 + XLUtils . I checked the code, default Excel 2007, Requires Excel 2007 to be installed,If I need them, I need to install Excel 2007.. Thanks,Erel
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Currently there is only Excel 2003 version, so learn from JPOI first,

jPOI 5 + XLUtils . I checked the code, default Excel 2007, Requires Excel 2007 to be installed,If I need them, I need to install Excel 2007.
I'm sorry to say but everything written here is wrong.

jPOI5 + XLUtils work with the old Excel 2003 format.
You don't need Excel to be installed.
 
Upvote 0
Top