R
Rob Y.
I have a system written in C/C++ that produces PDF's (using ClibPDF)
from data in a special 'flagged CSV' file format. The flags provide
formatting info that allows me to generate pretty nice looking
tablular reports. There's also a control file that tells me how to
format report headers, insert logos, do pagination, etc.
Now a big client wants the data in excel files with all the formatting
intact (or as much as possible). I already support export as plain
CSV with all the formatting ripped out, but for some reason he prefers
his reports in Excel instead of as PDF's.
It seems like the only mature library around to produce XLS files on a
unix server is the jakarta-poi stuff. Okay, so I finally have a
reason to learn Java. So far, so good. But my problem is that I
already have a ton of code that knows how to decode and interpret the
source data for these reports, and that code is in C. Does anybody
have any good ideas on how to leverage that stuff?
Ideally, I'd structure the thing so that my existing C code controls
things and I'd replace all the calls to ClibPDF with appropriate calls
to POI, but I assume there's no easy way to do that (would a JNI work
in a case where both sides need to keep their data structures active
simultaneously?)
I considered somehow launching an external java app that would somehow
open a pipe (can you do that in Java?) and accept commands from the C
caller, which could then control it that way.
Similarly, I guess, I could produce a text file with a stream of
commands to do spreadsheet'y things, and then launch a java/poi app to
use that as its input. Don't know whether that would be easier or
harder than just biting the bullet and re-implementing my PDF
generator and 'flagged CSV' library in Java. But I need to keep the
PDF stuff too, and a rewrite would require maintaining two code bases.
Am I missing something, or am I just out of luck in wanting to use a
Java library from C?
Anybody know of a good C/C++ equivalent of POI for creating XLS's?
from data in a special 'flagged CSV' file format. The flags provide
formatting info that allows me to generate pretty nice looking
tablular reports. There's also a control file that tells me how to
format report headers, insert logos, do pagination, etc.
Now a big client wants the data in excel files with all the formatting
intact (or as much as possible). I already support export as plain
CSV with all the formatting ripped out, but for some reason he prefers
his reports in Excel instead of as PDF's.
It seems like the only mature library around to produce XLS files on a
unix server is the jakarta-poi stuff. Okay, so I finally have a
reason to learn Java. So far, so good. But my problem is that I
already have a ton of code that knows how to decode and interpret the
source data for these reports, and that code is in C. Does anybody
have any good ideas on how to leverage that stuff?
Ideally, I'd structure the thing so that my existing C code controls
things and I'd replace all the calls to ClibPDF with appropriate calls
to POI, but I assume there's no easy way to do that (would a JNI work
in a case where both sides need to keep their data structures active
simultaneously?)
I considered somehow launching an external java app that would somehow
open a pipe (can you do that in Java?) and accept commands from the C
caller, which could then control it that way.
Similarly, I guess, I could produce a text file with a stream of
commands to do spreadsheet'y things, and then launch a java/poi app to
use that as its input. Don't know whether that would be easier or
harder than just biting the bullet and re-implementing my PDF
generator and 'flagged CSV' library in Java. But I need to keep the
PDF stuff too, and a rewrite would require maintaining two code bases.
Am I missing something, or am I just out of luck in wanting to use a
Java library from C?
Anybody know of a good C/C++ equivalent of POI for creating XLS's?