You are not logged in.
Dear users of this forum,
we are pleased to inform you that we will be updating the software behind this forum in the near future.
Existing posts, users and categories will remain untouched.
Important:
We will keep you informed in the pinned thread.
Kind regards,
Your ReportServer Team
Liebe Nutzer dieses Forums,
wir freuen uns, euch mitteilen zu können, dass wir in naher Zukunft die Software hinter diesem Forum aktualisieren werden.
Existierende Beiträge, Nutzer und Kategorien bleiben weiterhin bestehen!
Wichtig:
Wir halten euch im angepinnten Beitrag auf dem Laufenden!
Mit vielen Grüßen
Euer ReportServer Team
Pages: 1
Hi,
I try to build a simple Excel document using Apache POI library in a Groovy script which is executed by a Script Report. I try to use the object net.datenwerke.rs.core.service.reportmanager.engine.basereports.CompiledXlsxReport for which I have unfortunately no API. My output is an ObjectOutputStream or a FileOutputStream but I cannot provide them to the CompiledXlsxReport class.
Do you have a simple functioning example in this respect?
Many thanks in advance.
Cristian
Offline
Hi Christian,
ReportServer CE sources and apidoc can be found here
In most cases it should be sufficient as a help in scripting.
Below is a fragment of a script that I use:
/* create POI Workbook */
def excel2008 = true
def wb = null
if(! excel2008) {
wb = new HSSFWorkbook();
} else {
wb = new XSSFWorkbook();
}
// your code here
// when you are ready with the workbook, then:
/* generate bos */
def bos = new ByteArrayOutputStream()
wb.write(bos)
/* get bytes and close stream */
def result = new CompiledXlsxReport(bos.toByteArray())
bos.close()
return resultHope it helps.
Karolina
Offline
Hi Karolina,
Many thanks for the info and for your script. This is exactly what I needed, it is running just fine.
Greetings,
Cristian
Offline
Pages: 1