Connla is a Java library for creating data collections which can be exported to TXT, CSV, HTML, XHTML, XML, PDF and XLS formats.
Connlon[][] aConnlons = null; Connlon aConnlon = null; Connlon[] aHeaders = null; int n = 3; int m = 3; aHeaders = new Connlon[m]; aConnlon = new Connlon("ID"); aConnlon.setHeader(); aHeaders[0] = aConnlon; aConnlon = new Connlon("Name"); aConnlon.setHeader(); aHeaders[1] = aConnlon; aConnlon = new Connlon("Value"); aConnlon.setHeader(); aConnlon.setAlignRight(); aHeaders[2] = aConnlon; aConnlons = new Connlon[n][m]; aConnlon = new Connlon("test00"); aConnlon.setAlignRight(); aConnlon.setForegroundColor("yellow"); aConnlon.setBackgroundColor("red"); aConnlon.setBold(); aConnlon.setItalic(); aConnlon.setStrikethru(); aConnlon.setUnderline(); aConnlons[0][0] = aConnlon; aConnlon = new Connlon("test10"); aConnlon.setAlignRight(); aConnlon.setForegroundColor("ffff00"); aConnlon.setBackgroundColor("0000ff"); aConnlon.setBold(); aConnlon.setItalic(); aConnlons[1][0] = aConnlon; aConnlon = new Connlon("test20"); aConnlon.setAlignRight(); aConnlon.setForegroundColor("000000"); aConnlon.setBackgroundColor("00ff00"); aConnlon.setBold(); aConnlon.setItalic(); aConnlon.setUnderline(); aConnlons[2][0] = aConnlon; aConnlon = new Connlon("test02"); aConnlon.setAlignCenter(); aConnlons[0][2] = aConnlon; aConnlon = new Connlon("test12"); aConnlon.setAlignCenter(); aConnlons[1][2] = aConnlon; aConnlon = new Connlon("test22"); aConnlon.setAlignCenter(); aConnlons[2][2] = aConnlon; aConnlons[0][1] = new Connlon("42"); aConnlons[1][1] = new Connlon("Test"); aConnlon = new Connlon("Connla project page"); aConnlon.setURL("http://www.sourceforge.net/projects/connla"); aConnlon.showURLinPDF(); aConnlons[2][1] = aConnlon; int[] aWidthsA = {10, 80, 10}; aConnla = new Connla("Test", aWidthsA, aHeaders, aConnlons);In order to distribute the columns in a sane way, an arrays with relative widths is being passed to the Connla constructor. Note that an instance of Connla can also be created from Vectors of Connlon as opposed to arrays of Connlon.
aConnla.toCSV("test/out/test.csv"); aConnla.toTXT("test/out/test.txt"); aConnla.toHTML("test/out/test.html"); aConnla.toPDF("test/out/test.pdf"); aConnla.toXLS("test/out/test.xls");Below is a screenshot of the different output formats.