[Solved] Save Report in AOO Base with macro

Getting your data onto paper - or the web - Discussing the reports features of Base

[Solved] Save Report in AOO Base with macro

Postby branco » Wed Feb 28, 2018 8:46 pm

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 !!
Last edited by branco on Thu Mar 01, 2018 1:20 am, edited 2 times in total.
Open Office 4.1.5 Windows 10 and Mac OS x 10.5
branco
 
Posts: 3
Joined: Wed Feb 28, 2018 7:58 pm

Re: Save Report in AOO Base with macro

Postby Villeroy » Wed Feb 28, 2018 11:14 pm

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())
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 27245
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Save Report in AOO Base with macro

Postby branco » Thu Mar 01, 2018 12:47 am

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
Open Office 4.1.5 Windows 10 and Mac OS x 10.5
branco
 
Posts: 3
Joined: Wed Feb 28, 2018 7:58 pm

Re: Solved! Save Report in AOO Base with macro

Postby branco » Thu Mar 01, 2018 1:19 am

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"
Open Office 4.1.5 Windows 10 and Mac OS x 10.5
branco
 
Posts: 3
Joined: Wed Feb 28, 2018 7:58 pm


Return to Reporting

Who is online

Users browsing this forum: No registered users and 3 guests