Base and new Report Builder in 3.5

Am 18.03.2012 08:56, Mark Stanton wrote:

I think the point Mark was making was to switch away from using the
embedded back-end to pretty much any external one. Which is what
you often suggest too.

Yes indeed.
Can HSQLDB be used as an external engine? I thought not, which is why I didn't
include it.

Mark Stanton
One small step for mankind...

http://hsqldb.org
Download the latest version.
Put it somewhere in your libraries (no installation required).
Point your office Java to the extracted hsqldb.jar.
Extract ./database/ from your embedded database somewhere to your files.
Rename your database files with a common "dbname." prefix.
Connect a new Base document using JDBC with an URL like this one (refer to the downloaded documentation in your libs):

jdbc: hsqldb:file:/home/andreas/hsqldb-2.2.5/databases/Praxis/hsqldbdata/db0/chargen;default_schema=true;shutdown=true;hsqldb.default_table_type=cached;get_column_name=false

Copy over the queries, forms and reports from your embedded thing.

You get the latest version of a full featured HSQLDB without restrictions, many more functions, the access control and safety you would expect from a database application.
You can write a configuration file to run a server for concurrent access.

Drawbacks:
- Embedded HSQL requires another Java config. I use OOo for embedded and LibO 3.3.4 for "normal" access.
- Base can not handle user defined row filters with HSQLDB2. I use my own "power filters" anyway.

Some additions for anybody who wants to follow my receipt:

Am 18.03.2012 10:25, Andreas Säger wrote:

Extract ./database/ from your embedded database somewhere to your files.
Rename your database files with a common "dbname." prefix.

The "dbname" in the below URL is "chargen" so I renamed the files "data", "properties" and "script" to "chargen.data", "chargen.properties" and "chargen.script"

Connect a new Base document using JDBC with an URL like this one (refer
to the downloaded documentation in your libs):

jdbc:
hsqldb:file:/home/andreas/hsqldb-2.2.5/databases/Praxis/hsqldbdata/db0/chargen;default_schema=true;shutdown=true;hsqldb.default_table_type=cached;get_column_name=false

where "chargen" is the database name and the semicolon separated options improve the look and interoperability in Base.

THANKS for that, I must admit I've gotten "spoilt" by lots of years on Windows now, expect one install file to set up a program, and never having to use a command line -- even for Windows the program HSQLDB still encourages people to use command lines for some things

Mind you, I don't mind learning again, if one is learning to do things more reliably and or powerfully

Rusty
in more ways than one I'm rusty :wink:

Hi All

Thanks for all the information and suggestions from everyone!! Appreciated!!

First of all an apology from me - Re: "Hi-jacking" a thread. I'm on a couple of other "lists" and on these I only have to change the Subject Line to start a new thread - and I keep forgetting that the LO list DOES NOT work this way!! Will try to remember in future!!

To Andreas and Alex a special thank you for your help! Do I have a back-up file, Yes, but about a month old so I will have lost some work but that's not too serious. I also tried to open the .odb file after renaming it as a .zip but nothing opens although it is over 40Mb in size!!

I next followed up on the suggestion to use HSQLDB as an external engine. My LO Installation is using Java 1.6.0_31 and was not showing any problems so have not had to go back to 22!

To set the Class Path I had to search for hsqldb.jr and found it under /opt/libreoffice/program/classes.

I then copied the sample file, extracted it and renamed the files as suggested. I put them into /home/FS/Database/FilterData.

I then created a New Database using JDBC with the Datasource jdbc:hsqldb:file:/home/FS/FilterData.db

I set the Driver Class to org.hsqldb.jdbcDriver (And the "Test Driver" button says "Installed correctly"). I set the User Name to 'SA" with no Password. I "registered" the Database and opened for editing. I was then asked for the location so selected that.

I then get an error Box - "Connection could not be established". It complains that the Properties file is not found and that Properties.new - no such file or directory. (The Properties file IS at that location but there is NO Properties.new file!!)

(I made the three files in FilterData all rwx and tried again but got the same error!!)

Where have the wheels fallen off??

As a last point I have my backup copy of the file running OK on the system with the embedded engine but am VERY keen to get this external method working!!

Thanks guys

Ian Whitfield
Pretoria.

/

Hi

One thing I've lost with my "crash" is the correct sorting order on my Base Form.

I originally found a nice tutorial on the Net on how to do this but can no longer find this!!

Can anyone point me in the right direction to be able to sort my data again??

I want to sort by Surname and then by First Name.

Thanks

Ian Whitfield
Pretoria/
/

The Form navigation toolbar has three tools (icons) for sorting:
an "a" above a "z", an "a" above a "z" with a down arrow, and "z"
above an "a" with a down arrow. The first one is the one you want.

--Dan

HOWEVER . . . Calc is also broken in 3.5, in that you cannot filter any
data from external sources, so it makes it virtually impossible to run
reports in Calc in 3.5.

Hi :slight_smile:
If the Form is based on a Query then it's fairly easy to sort the Query. In the Query just put the Surname column first and the First name after it. Then just set each column to sort in ascending order.

If the Form is based straight off a Table instead then there is probably some way of doing it but it's likely to be a bit less transparent. I don't know how to re-base a Form off a Query instead of a Table but i think that is the direction i would go in, in order to increase flexibility and transparency in the future.
Regards from
Tom :slight_smile:

Hi Ian,

One thing I've lost with my "crash" is the correct sorting order on my
Base Form.

There is a known bug in 3.5 where the sort order does not get memorised
and stored for re-use on next opening of the ODB file. It should be
fixed for 3.5.2.

Alex

Hi Andreas...

I know it's been a while since you posted - I'm not sure if you have solved
this problem yet.

Anyway, this is what I found works for me using the LRD (legacy 'old' report
designer/wizard) in LO 3.5.3 to create the report:

STEPS

1. Create your primary SQL query showing all the fields contained in your
report. This is the QUERY the report 'feeds off'.

2. In your query above, make sure the primary sort field/column (using the
ORDER BY command in the SQL) is the one you are using for the GROUP header
in the REPORT. If you don't do this, I found, like you, that the report
GROUP HEADER text gets repeated, instead of occurring ONCE at the beginning
of the GROUP as it should. Of course, you can also add secondary sorts as
usual in your query.

3. When you first create your report in the LRD (not the Report Builder
Extension), even though you will select the relevant query you created in
step 1 above, you will probably need also to paste the SQL for this query
(step 1 above) into the hidden COMMAND field in the report FORM NAVIGATOR
window. This is due to the BUG mentioned elsewhere. See this:
https://bugs.freedesktop.org/show_bug.cgi?id=47473

4. Hopefully, your report should now behave properly.

5. More info is here:
http://en.libreofficeforum.org/node/2589
http://nabble.documentfoundation.org/Base-and-new-Report-Builder-in-3-5-td3817159.html#a3835807

There is also info here about re-using legacy reports done in OO (or maybe
early versions of LO).

Let us know if this helps you.

- Fred

Hello Alex.

Thanks your response.

I'm using 3.5.4 from Ubuntu 12.04 LTS software library.

Right now, the only workaround I've found is to create view from the query,
then use that for the report.

However, I'm going to assume you've gotten 3.7 from the LO website.

I'll uninstall my 3.5.4 and d/l from the LO site.

Do you think I'll have any problem using the DB with the newer version?

Thanks,
Al

No, I have been using 3.6.4.3 for Base working with tables, queries, forms, and reports without any problems. This is true for both 32 and 64 bit versions.
      The following I have done on a 32 bit laptop. (I also have a tower that is 64 bit. All LO software on it comes from the LO website.) I use LO 3.6.4.3 from the LO site and have no problems with Base. LO 3.7 has been changed to LO 4.0.0, and this is almost but not quite ready to be used for everyday use. If I were you, I would download the version I use: 3.6.4.3.
  Until today, I had been using 3.5.4 from Ubuntu 12.04 to connect to MySQL. I used this to access the data from tables and run queries. I did not do any work with reports. But after reading your emails about problems with reports, I tried to create a report from a query. The wizard would not even open. So, I have removed it.
      Recently, I have been able to use a different driver to connect to MySQL, so I have not learned anything.
      If you are going to uninstall your 3.5.4 version, use synaptic to do so. Search for "libreoffice" and remove anything that is listed in the Installed Version column and begins with 1:3.5.4-0Ubuntu.
      If you want some suggestions as to how to install LO 3.6.4.3 from the LO site, let me know.

--Dan