OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Filling reports

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Akhorahil
General User
General User


Joined: 30 May 2005
Posts: 11

PostPosted: Tue May 31, 2005 10:32 pm    Post subject: Filling reports Reply with quote

Hi all,

I've got some questions about creating reports using OOo and the java API. I'm using OOo 1.9.104 and the 2.0SDK on WinXP.

1: I need to create reports that have a recurring pattern. What I'd like to do is to create a template with some text that is used as an "inner template". So I want to copy that part for every entry I need in my report. Is this a good solution, or are there better ays to do this? And are there some examples on how to copy/paste text using the API?

2: Some other reports that I have to create are created from data in a database. I allready looked at Base and that looks ok. But is it possible to use the API and fill these reports from java, without the need to use the OOo interface?

Thanks in advance,

Alexander
Back to top
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Wed Jun 01, 2005 12:06 am    Post subject: Re: Filling reports Reply with quote

Akhorahil wrote:
And are there some examples on how to copy/paste text using the API?

Again the OOo Development Guide contains a lot of usefull informations: http://api.openoffice.org/docs/DevelopersGuide/Text/Text.htm#1+3+1+Word+Processing

It's not directly copy and paste, but searching, navigating, and editing.

Akhorahil wrote:
2: Some other reports that I have to create are created from data in a database. I allready looked at Base and that looks ok. But is it possible to use the API and fill these reports from java, without the need to use the OOo interface?

I think I didn't get the point of this question. What do you want to achieve? What is in your opinion the OOo interface and why do you not want to use it?

With kind regards
hol.sten
Back to top
View user's profile Send private message
Akhorahil
General User
General User


Joined: 30 May 2005
Posts: 11

PostPosted: Wed Jun 01, 2005 1:13 am    Post subject: Re: Filling reports Reply with quote

hol.sten wrote:

Again the OOo Development Guide contains a lot of usefull informations: http://api.openoffice.org/docs/DevelopersGuide/Text/Text.htm#1+3+1+Word+Processing

It's not directly copy and paste, but searching, navigating, and editing.


Hmm, overlooked that part :S. Thx for the hint. But I still do have some problem, I allready found another thread with exact the same question, so I replied to that one.

http://www.oooforum.org/forum/viewtopic.phtml?t=19272

hol.sten wrote:

Akhorahil wrote:
2: Some other reports that I have to create are created from data in a database. I allready looked at Base and that looks ok. But is it possible to use the API and fill these reports from java, without the need to use the OOo interface?

I think I didn't get the point of this question. What do you want to achieve? What is in your opinion the OOo interface and why do you not want to use it?


What I want to do is to create a report with data from a database. I need some sort of template that has the query to select the correct data from the database.

Now I have a jdbc connection with a database, and use Base to create reports from data in the database. Now I have to start Base, select a report and create it.

My question is, is it possible to create those reports using the API, without having to start Base and the User Interface of OOo. Or is it maybe possible to create a Writer template that has a connection with the database and does what I want?

TiA,

Alexander[/url]
Back to top
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Wed Jun 01, 2005 9:46 am    Post subject: Re: Filling reports Reply with quote

Akhorahil wrote:
Now I have a jdbc connection with a database, and use Base to create reports from data in the database. Now I have to start Base, select a report and create it.

If I had to solve your problem, I would use another database like MySQL and access the data with an OR-Mapping-Tool like Hibernate. That should be MUCH faster.

Akhorahil wrote:
My question is, is it possible to create those reports using the API, without having to start Base and the User Interface of OOo. Or is it maybe possible to create a Writer template that has a connection with the database and does what I want?

Sometimes I'm wondering why I didn't get tired of answering the same questions again and again Wink

If you want to use OOo functions you need a running OOo http://www.oooforum.org/forum/viewtopic.phtml?t=15789

You can reduce the GUI overhead by using the option "-headless" when you start OOo http://www.oooforum.org/forum/viewtopic.phtml?t=19790&highlight=headless

WIth kind regards
hol.sten
Back to top
View user's profile Send private message
Akhorahil
General User
General User


Joined: 30 May 2005
Posts: 11

PostPosted: Sun Jun 05, 2005 10:24 pm    Post subject: Re: Filling reports Reply with quote

hol.sten wrote:

Akhorahil wrote:
My question is, is it possible to create those reports using the API, without having to start Base and the User Interface of OOo. Or is it maybe possible to create a Writer template that has a connection with the database and does what I want?

Sometimes I'm wondering why I didn't get tired of answering the same questions again and again Wink

If you want to use OOo functions you need a running OOo http://www.oooforum.org/forum/viewtopic.phtml?t=15789

You can reduce the GUI overhead by using the option "-headless" when you start OOo http://www.oooforum.org/forum/viewtopic.phtml?t=19790&highlight=headless


I think you misunderstand my question. What I do now is use the OOo GUI to create the reports. Start OOo Base, open a odb file, go to the reports part, select a report, open that report.. What I would like to do is the same thing, but using the api, so I can programmaticaly create the reports.

But I will look into the hibernate solution. Never done anything with hibernate before.

Thx for you help!

Alexander
Back to top
View user's profile Send private message
Akhorahil
General User
General User


Joined: 30 May 2005
Posts: 11

PostPosted: Sun Jun 05, 2005 10:31 pm    Post subject: Re: Filling reports Reply with quote

hol.sten wrote:
Akhorahil wrote:
Now I have a jdbc connection with a database, and use Base to create reports from data in the database. Now I have to start Base, select a report and create it.

If I had to solve your problem, I would use another database like MySQL and access the data with an OR-Mapping-Tool like Hibernate. That should be MUCH faster.


Forget to ask something in the other post.

If you use hibernate, what do you use to create reports?

TiA,

Alexander
Back to top
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Mon Jun 06, 2005 9:06 am    Post subject: Re: Filling reports Reply with quote

Akhorahil wrote:
I think you misunderstand my question.

The better the question, the better the answer Wink

Akhorahil wrote:
What I do now is use the OOo GUI to create the reports. Start OOo Base, open a odb file, go to the reports part, select a report, open that report..

OK, I didn't get the point that you arn't using any API calls at all.

Akhorahil wrote:
What I would like to do is the same thing, but using the api, so I can programmaticaly create the reports.

I think that that should be possible, although I have no idea how to access Base. I've never done that. I would start reading here http://api.openoffice.org/docs/DevelopersGuide/Database/Database.htm.

Akhorahil wrote:
If you use hibernate, what do you use to create reports?

That depends on the demands. If someone asks for a plain text report, I write that with Java, if necessary (perhaps the hole task is much easier solved with some database reporting tool, depends on the database). If someone asks for a filled in word template, I would use OOo and access it through the Java-UNO-API.

With kind regards
hol.sten
Back to top
View user's profile Send private message
Akhorahil
General User
General User


Joined: 30 May 2005
Posts: 11

PostPosted: Wed Jun 08, 2005 3:19 am    Post subject: Reply with quote

Thx for your help! I will play a little more with the api and write some more samples so I understand the api and sdk better.

Alexander
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group