Skip to content

Commit e4aabbf

Browse files
Merge branch 'sw360cab-master'
2 parents a5e825d + a13f42b commit e4aabbf

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

grails-app/conf/BuildConfig.groovy

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ grails.project.dependency.resolution = {
1717
}
1818
dependencies {
1919
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
20-
compile (group:'org.apache.poi', name:'poi', version:'3.7');
21-
compile (group:'org.apache.poi', name:'poi-ooxml', version:'3.7') {
20+
String poiVersion = '3.12'
21+
compile ('org.apache.poi:poi:' + poiVersion)
22+
compile ('org.apache.poi:poi-ooxml:' + poiVersion) {
2223
excludes 'stax-api'
2324
}
24-
compile ('org.apache.poi:poi-ooxml-schemas:3.7') {
25+
compile ('org.apache.poi:ooxml-schemas:1.1') {
2526
excludes 'stax-api'
2627
}
2728
compile ('dom4j:dom4j:1.6.1')
28-
runtime('xerces:xercesImpl:2.10.0') {
29+
runtime('xerces:xercesImpl:2.11.0') {
2930
excludes 'xml-apis'
3031
}
3132
}

test/unit/pl/touk/excel/export/XlsxExporterManipulateCellsTest.groovy

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,28 @@ class XlsxExporterManipulateCellsTest extends XlsxExporterTest {
2424
assert xlsxReporter.getCellAt(0, 2).getNumericCellValue() == longValue
2525
assert xlsxReporter.getCellAt(0, 3).getBooleanCellValue() == booleanValue
2626
}
27+
28+
@Test
29+
void shouldChangeCellAndColumnsStyle() {
30+
//given
31+
String stringValue = """Lorem Ipsum is simply dummy text of the printing and \
32+
typesetting industry. Lorem Ipsum has been the industry's standard dummy \
33+
text ever since the 1500s, when an unknown printer took a galley of type \
34+
and scrambled it to make a type specimen book. It has survived not only five \
35+
centuries, but also the leap into electronic typesetting, remaining essentially"""
36+
37+
//when
38+
xlsxReporter.putCellValue(0, 0, stringValue)
39+
40+
//then
41+
xlsxReporter.getCellAt(0, 0).getCellStyle().setShrinkToFit(true)
42+
assert xlsxReporter.getCellAt(0, 0)?.getCellStyle().getShrinkToFit()
43+
44+
// column
45+
xlsxReporter.getSheet().setColumnWidth(0, 70)
46+
assert xlsxReporter.getSheet().getColumnWidth(0) == 70
47+
xlsxReporter.getSheet().getColumnStyle(0).setShrinkToFit(true)
48+
assert xlsxReporter.getSheet().getColumnStyle(0).getShrinkToFit()
49+
50+
}
2751
}

0 commit comments

Comments
 (0)