Page 1 of 1

[Solved] Save Report in AOO Base with macro

PostPosted: Wed Feb 28, 2018 8:46 pm
by branco
Hi, I am new in AOO, but I am sure that my question can have response and thank you all in advance for your help.
Question: I have some tables, forms, query ecc.
In start up form with buttons, and querys in macro's produce some results, stored in a target table ( to be sure have this result later.. ).
I have also produced reports, based on this table.
Selecting report and clicking on it, is all ready ( as I want ) and I can save (OO or pdf format), print as normal operations in OO Writer from toolbars.
I want save report as pdf file automatically from click on one button ( and macro I suppose ) from startup form, not opening other forms, windows or apps.

What do you think ? is possible ?
Thank you

PS: I try, with some macros, and I can open report, but after this I do not know how procede in OO Writer to save it, and also I can save a document ( always with macro ) but this opoeration save the form where is button , not report !!

Re: Save Report in AOO Base with macro

PostPosted: Wed Feb 28, 2018 11:14 pm
by Villeroy
Code: Select all   Expand viewCollapse view
Dim props(0) as new com.sun.star.beans.PropertyValue
props(0).Name = "FilterName"
props(0).Value = "writer_pdf_Export"
oDoc.storeToURL("file://C:/path/name.pdf"),props())

Re: Save Report in AOO Base with macro

PostPosted: Thu Mar 01, 2018 12:47 am
by branco
Hi, thank you, but:
my report name is "Fattura" and I want save it with "Fattura_dd_mm_yy.pdf" name.
the sub called by pressing button is:
'==============================
sub exp_2()
Dim props(0) as new com.sun.star.beans.PropertyValue
sURL = convertToURL("Fattura_dd_mm_yy.pdf")
props(0).Name = "FilterName"
props(0).Value = "writer_pdf_Export"
oDoc.storeToURL(sURL,props())
end sub
'====================
but AOO give me "Object variable not set". Why ? I think ODoc is not defined, also for report name , where I define that I start from "Fattura" report and have as result "Fattura_dd_mm_yy.pdf" file ??

thank you

Re: Solved! Save Report in AOO Base with macro

PostPosted: Thu Mar 01, 2018 1:19 am
by branco
after unsuccessful step I looking in Forum and found ( now sorry!) this post by Andy-Jordan :
http://ooo-forums.apache.org/en/forum/v ... 13&t=79145

Now is working om my Win10, Tomorrow try on Mac.
it is very close my need.

thank you. very much
or "Grazie"