Ask Your Question

Base: printing report, macro

asked 2017-02-26 18:39:13 +0200

tommysvs gravatar image

Hello everyone,

I'm a newbie to libreoffice base. I'm trying to make a database for invoices and product store. After creating a tables, forms, queries I'm not able to send a report print that is based on a query.

I try to explain better. I have form where is possible to create an invoice. The invoice report is based on a query that ask WHAT "ID invoice" number to print. Now if I want to print the invoice "44" for example I have set up all so it ask me the input when I launch the "Invoice report" (This was set from the query).

Now I need a button on my "invoice form" that bring automatically the "invoice number" and send the print report without asking any input the user.

Is that possible only by macro? If yes how I have to do? I don't know any program languanges.

Thank you in advance for your support. I apologize if my english is not perfect :)

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2017-02-26 19:49:14 +0200

Ratslinger gravatar image

Based upon the information provided, it appears you have a form which creates an invoice which the user then fills out. It appears you want to then be able to, using a button, print this new invoice using an existing query which asks for an invoice number.

This is possible using macros but complicated for an outsider to direct on how to do it. First, Basic (primary LO macro language) in itself is not too difficult but other factors ( API & such) make it much more difficult to understand. Even if someone were to give you the code, some day things may change and you would once again be faced with the problem on how to get the code changed.

And for someone to get this code working for you, form details, query information and report information is needed. All this needs to be tied together to work properly.

You probably should just keep the current set-up where the query asks for the invoice number to be printed.

edit flag offensive delete link more


Thank you fro your kindly reply. I think I will keep the database and make it work as it. What do you mean about API? Should I get any API in order to make it work?

tommysvs gravatar imagetommysvs ( 2017-02-27 11:48:23 +0200 )edit

answered 2017-02-27 11:56:21 +0200

tommysvs gravatar image

I would ask another thing. I used

WHERE "IDinvoice" LIKE '%' || :input || '%'

in order to make it ask the invoice number to users. What any other way I can use to get the invoice number to print (except macro as mentioned before) ?

edit flag offensive delete link more


Most of the other ways are more tedious than what you are using and require more user interaction to complete. :input is the method for parameter entry but you can be a bit more specific:

WHERE "IDinvoice" = :InvoiceToPrint. That is a little more specific to the user as to what is expected to be entered.

Ratslinger gravatar imageRatslinger ( 2017-02-27 16:22:56 +0200 )edit

Ok thank you I will try by this

tommysvs gravatar imagetommysvs ( 2017-02-27 16:27:08 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-02-26 18:39:13 +0200

Seen: 501 times

Last updated: Feb 27 '17