Creating querys or reports based on form?

Discuss the database features
Post Reply
frx2000
Posts: 3
Joined: Sat Mar 28, 2009 3:21 am

Creating querys or reports based on form?

Post by frx2000 »

Beginner here.

I want to make a form that would have 2 date controls. One should be named "From" the other "To"

I want to make an interval between 2 dates. And then when i have selected my dates a query will run or a report will be generated and it will select all my posts that i have in a table called "Meetings". Inside meeting i have a field called just meetdate. And if meetdate is > my "From" date and < "To" date it will be a match.

Is this possible? And how can i do this?
OOo 3.0.X on Ms Windows XP
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Creating querys or reports based on form?

Post by Villeroy »

Have a look at my pictures.odb.
The form document contains a subform filtered by one list box on a main form.
The main form is bound to one particular record (ID=0) of some dummy-table "Filter".
"Filter" stores the filter setting.
The stored filter can be used to create a report.

An advanced example with the same type of filter
This one allows for pattern matching and it shows all records for an empty text box (null-filter).
Once you've got the concept, you should be able to use 2 date fields on the same row of a filter table.
This thread may help around some difficulties: [SOLVED] Form: enter a string expression to populate a grid
The nested SELECT-query [SELECT ... WHERE ... IN (SELECT...)] is required only if the subform needs to be writable. You can use a normal join for read-only records.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
frx2000
Posts: 3
Joined: Sat Mar 28, 2009 3:21 am

Re: Creating querys or reports based on form?

Post by frx2000 »

THX...i will check it out!

Another question...is there some basic "coding guide" for OOBasic? I need to "communicate" with the controls and forms i have.

I looked at some tutorials...and it seems to be based on the general syntax. I want to handle objects that are all ready on my form.
OOo 3.0.X on Ms Windows XP
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Creating querys or reports based on form?

Post by Villeroy »

http://development.openoffice.org/
http://api.openoffice.org/
http://wiki.services.openoffice.org/wik ... pers_Guide
http://www.pitonyak.org/
https://addons.mozilla.org/de/firefox/addon/4102
Indispensible helper tool: http://extensions.services.openoffice.org/project/MRI

The primitive Basic language is almost fully documented in the F1-help. In my opinion it's a very convenient API-caller to be embedded in ODF templates.
Next version 3.1 will allow for Basic in database documents as well.
In my honest opinion you can not really write programs using this clumsy, slow, buggy, 100% procedural language, but you can use a wide variety of programming languages for calls to the very same office-API.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
JoJo
Posts: 39
Joined: Wed Oct 07, 2009 1:43 am
Location: España

Re: Creating querys or reports based on form?

Post by JoJo »

I think I am even more of a beginner than the original poster because I followed the advice in this thread and downloaded the examples, but I'm still stuck and would really appreciate any basic help.

I to am trying to filter on a date (but have also failed to get any text field to filter). I imagine that this is a very basic function, but I have been trying, all ways, for days, and it is eluding me.

I don't need anything fancy. I have tried installing Sun Report Builder but that kept crashing on exit, so I'd like to try without the SRB extension if possible.

I have created a database, then tried creating reports both from the table and from a query I created. I can filter the records in the table, query or form view, but if I preview or print a report the filter is not applied (all records print). Even if I apply basic (funnel icon) 'Auto' or 'Standard' filters all records still appear in a report.

If anyone can just give me a very basic description, I can hopefully go on from there.

Thanks for any help.

3.0.1-9ubuntu3.1
Ubuntu 9.0.4
OpenOffice 3.1.1 on Ubuntu 9.10
JoJo
Posts: 39
Joined: Wed Oct 07, 2009 1:43 am
Location: España

Re: Creating querys or reports based on form?

Post by JoJo »

Not to worry about my question. I think I have solved it :)
OpenOffice 3.1.1 on Ubuntu 9.10
Post Reply