Hello,
I'm trying to create an xlsx spreadsheet with various cell styles (bold, bordered, etc.) For that I'm creating a styles.xml Part:
- Code: Select all
WorksheetPart sheet = xlsUtils.createWorkSheet(pkg);
Styles styles = new Styles(new PartName("/xl/styles.xml"));
styles.setJaxbElement(sb.createStyleSheet());
where sb is a StyleSheetBuilder class that looks like this:
package xlsx;
import javax.xml.bind.JAXBElement;
import org.xlsx4j.sml.CTBooleanProperty;
import org.xlsx4j.sml.CTBorder;
import org.xlsx4j.sml.CTBorderPr;
import org.xlsx4j.sml.CTBorders;
import org.xlsx4j.sml.CTCellStyle;
import org.xlsx4j.sml.CTCellStyleXfs;
import org.xlsx4j.sml.CTCellStyles;
import org.xlsx4j.sml.CTCellXfs;
import org.xlsx4j.sml.CTColor;
import org.xlsx4j.sml.CTDxfs;
import org.xlsx4j.sml.CTExtension;
import org.xlsx4j.sml.CTExtensionList;
import org.xlsx4j.sml.CTFill;
import org.xlsx4j.sml.CTFills; ...