[Solved] Calc + UserFields

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
Stijn
Posts: 6
Joined: Tue Feb 19, 2008 4:13 pm

[Solved] Calc + UserFields

Post by Stijn »

Hello all,

I am currently creating an application which stores documents in a database so documents can be categorized and sorted.
The application creates a document with the UNO API and uses invisible userfields to store information about database connections and relations with other documents in the database. When I want to store the document, these userfields are read and used to determine where to store it.

The code works quiet nice.........as long as you create text documents.......
OOo Calc doesn't seem to have those fields. So I am currently in search for another solution.

I have been thinking of hiding the first row and filling cells with the information I need.
I would like to use another method though, because I think it is less tidy and the template documents might be made by others.
It is a bit confusing for the end user if rows suddenly disapear from their templates.

What suggestions does the community have for this problem?

Thanks in advance,
Stijn.

p.s. I am programming in a V.B. like language, but I guess that won't influence the type of solution.
Last edited by Stijn on Thu Jul 03, 2008 1:56 pm, edited 1 time in total.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Calc + UserFields

Post by Villeroy »

Calc has database ranges with stored import descriptors. Just drage an object (table, view or query) from a registered database in the left pane of the datasource window onto a sheet-cell and you get a refreshable import range (menu:Data>Define...).
You can manipulate these import ranges: http://user.services.openoffice.org/en/ ... php?id=248
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
Stijn
Posts: 6
Joined: Tue Feb 19, 2008 4:13 pm

Re: Calc + UserFields

Post by Stijn »

Villeroy, Thanks alot for your response.

I am connecting to a Lotus Notes database and not sure if I am able to use this method to connect to it.
Atleast it is a nice example and you gave me a new idea for an alternative solution.

I will play around with these database ranges to learn to use them and see how far I can get.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Calc + UserFields

Post by Villeroy »

If it has an odbj driver (or jdbc), it can be imported as a datasource.
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
Stijn
Posts: 6
Joined: Tue Feb 19, 2008 4:13 pm

Re: Calc + UserFields

Post by Stijn »

Villeroy wrote:If it has an odbj driver (or jdbc), it can be imported as a datasource.
It has, but with the current application design it would require a complete redesign of the dataflow.
I am currently using a second sheet like you did in your example.

This sheet will be automaticly added through the UNO API so the user can see it after a document is generated but doesn't have to worry about it while creating templates. Would be even better if it is possible to hide the sheet, but don't know if this is possible.

Thanks for the feedback, I changed the status of the topic to solved :)
Post Reply