Auto Generate Reports

asked 2019-07-22 12:46:09 +0200

nSeixas gravatar image

updated 2019-07-22 13:12:06 +0200

Hi all,

I'm developing a software with some reports.

I'm exporting my data as .dbf files and I want to use libreoffice to generate the reports. I've create a odb file linked to the folder where I export the data and I've created some reports. If I open the odb file and I click in the reports it generate the report properly, but I need to do this automatically (from my application just launch the report).

What is the best way to archive that?

PS: I created a macro to run the report and I'm trying to call is through command line but it doesn't work. Command: "soffice "pathToFile\LineMap.odb" "macro://LineMap/Standard.Reports.OpenMyReport""

Many thanks.

edit retag flag offensive close merge delete


If executing "libreoffic6.2 --help | grep "{macro" I get:

user@system:> libreoffice6.2 --help | grep "{macro"
   {file} {macro:///Library.Module.MacroName}

and this shows three slashes /// after "macro:" while your command above just shows two of 'em. Just a hint, may mean nothing but may be the cause of your command not working.

Finally I don't understand LineMap/ in your path to the macro, since from help I cannot see any / allowed in the specification of which macro to execute. Thus I'd expect something like:

soffice "pathToFile\LineMap.odb" "macro:///Standard.Reports.OpenMyReport"
(if you haven't defined your own library and therefore your macro resides in "Standard")

Opaque gravatar imageOpaque ( 2019-07-22 14:24:49 +0200 )edit

@Opaque thanks. I've managed to make it work.

nSeixas gravatar imagenSeixas ( 2019-07-23 13:57:52 +0200 )edit