Hi,
Hello,
I took a closer look at the error I receive when using conditional formatting.
java.security.securerandom.nextbytes --> nullpointerexception
Apparently this class was not found !
Searching the www I found I have to extend my classpath directories.
==> /QOpenSys/QIBM/ProdData/JavaVM/jdk60/32bit/jre/lib/ext
After doing so the conditional formatting works
So, No need to spend time on it !
Sorry for the inconvenience and thanks a lot !!
Hi again,
Thanks Babar,
I think most basic things are working now.
However there is one strange thing in applying styles.
When I apply a style to a row everything is ok, but when I apply a style to a cell I have strange behavior.
–> The style is not visible when I do not apply the default style to the row.
–> When I open the result in Excel, and go to a cell with a certain style, the style selection at the top shows ‘DEFAULT’ (see attachment)
I suppose I’m doing something wrong …
Hi,
Hello,
I’m using “getNamedStyle” / “createStyle”.
Can these still be used, or should I use “getStyles.get/add” ? What does “getStyles” return ? Styles or StylesCollection ?
Thanks
Hi,
This code shows the problem.
I applied a style to cell(0, 0). The style is visible in the workbook, but the cell is not tagged with that style.
When compiling the code I see that “getStyles” is deprecated … What should I use instead ?
import com.aspose.cells.*;public class styletest {
public static void main(String[] args) {//System.out.println(CellsHelper.getVersion()); try { //Instantiating a Workbook object Workbook workbook = new Workbook(); Worksheet sheet = workbook.getWorksheets().get(0); int styleIdx = workbook.getStyles().add(); Style style = workbook.getStyles().get(styleIdx); style.getFont().setColor(Color.getRed()); style.setName("Style1"); //Initialize styleflag object. StyleFlag flag = new StyleFlag(); //Set all formatting attributes on. flag.setAll(true); Cells mycells = sheet.getCells(); RowCollection myrows = mycells.getRows(); Row myrow = myrows.get(0); Cell mycell = myrow.get(0); mycell.putValue("Tekst"); mycell.setStyle(style, flag); //Saving the Excel file workbook.save("styletest.xlsx", SaveFormat.XLSX); } catch(Exception e) { } }
}
Hi,
babar.raza:Thank you for the code snippet. I am able to observe the mentioned issue, that is; style is being set properly, however, relevant style has not been selected from the available collection of styles when spreadsheet is viewed in Excel. I have to check back with the product team to get a justification for this behaviour.
The issues you have found earlier (filed as CELLSJAVA-41659) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.