• Post Reply Bookmark Topic Watch Topic
  • New Topic

Landlord application  RSS feed

 
Lukas Bec
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

this is my first post here so please be patient.
I am beginner at writing java code, still much to do, but I know java basics.

I am trying to write my first, "serious" application. I would like to write a program which would allow me to put variables from my application into the callculation sheet made in Word.
I know that there is docx4j or ApachePOI which can do such things, but i find it little too hard for a beginner like me.

Is there any other way, maybe little easier to achieve my goal?
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lukas Bec wrote:Is there any other way, maybe little easier to achieve my goal?

All the Microsoft Office formats are proprietary formats created by Microsoft and they're not that keen on giving other people access to them.
That's why libraries like docx4j and ApachePOI exist - they are the 'easy' way to do what you want to do.

I haven't actually used either of those libraries, but if you are finding them hard to use, then you might want to put off this application until you know a bit more about Java.
I hope I haven't discouraged you - that wasn't my intent.

Maybe if you explain why you think you need to use this calculation sheet made in Word, somebody may be able to suggest a better (easier) alternative.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think POI is not too hard to get into, but let's take a step back so you can explain a bit more what you intend to do. For example:
callculation sheet made in Word

This has me confused - Word is a text processor; calculations are made in a spreadsheet like Excel.
 
Lukas Bec
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for reply.

I poorly described what I would like to do. I need sheet which will only be a pattern, that I could use to put variables, like for example date, and people names, and their rent. I would like to have keywords in that sheet, and replace them with values from my variables.
I dont realy need that to be done in Word, but I would like to open that calculation sheet in some program, and print it or just watch it.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66306
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still not sure, but perhaps you just want to create a PDF rather than a Word doc?
 
Lukas Bec
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course it can be PDF. I just wish to make one document, to be a pattern, and then use it im my application, to print my program results.
And please forgive me my english.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so you need a word processing template with variable substitution. I recommend to create the template in Word, and then to save it as RTF. RTF has the advantage of being text, so programmatic search-and-replace is comparatively easy.
 
Lukas Bec
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much. I will try do it that way.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66306
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good call on the RTF, Ulf!
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lukas Bec wrote:Is there any other way, maybe little easier to achieve my goal?

I'm going to take a slightly different tack to my esteemed colleagues - don't bother with Office, spreadsheets, or RTF at all.

At least, not YET.

Presumably, this app has lots of other things to do than just create/update Office docs; so concentrate on that, and get that part (ie, the Java part) of it working, before you think about how you're going to save your data.

Others may disagree, but my worry with taking on something like POI - or even RTF - is that that is likely to take up all your energy, and distract you from your primary task, which is to get your application working.

And if you really need to save data? Just bash it out as plain text (or possibly java.util.Properties) for the moment.

HIH

Winston
 
Lukas Bec
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Everything you wrote Winston, is true.

I will leave this all RTF files stuff for now, because I use all my time to understand it, insetead of writing things that i can do in my application. But later I will try to understand and use a RTF template, to view results of my work, and try to print it. It is my goal.

Thank you all for advices.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!