Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

excel sheet template

Thread view: 
gk - 11 Mar 2007 16:21 GMT
Hi,

I am using jakarta POI.

I have a excel sheet template .

I want to create a  new excel-sheet  from that  template and want to
pour data into it.

how to copy the template into a new excel sheet ?

i do this way...

FileOutputStream out = new FileOutputStream("c:\\zingot.xls"); // this
creates a new excel file

can i use my excel template here ?
Joshua Cranmer - 11 Mar 2007 18:37 GMT
> Hi,
>
[quoted text clipped - 13 lines]
>
> can i use my excel template here ?

This is dependent on whether or not a .xlt file is a valid .xls file. If
it is, then you can just use this code:

FileInputStream in = new FileInputStream("C:\\blah.xlt");
FileOutputStream out = new FileOutputStream("C:\\blah.xls");
int byte;
while ((byte = in.read()) != -1) {
    out.write(byte);
}

If not, then tell your problems to Microsoft.
gk - 13 Mar 2007 12:36 GMT
On Mar 11, 10:37 pm, Joshua Cranmer <Pidgeo...@epenguin.zzn.com>
wrote:
> > Hi,
>
[quoted text clipped - 26 lines]
>
> If not, then tell your problems to Microsoft.

2 questions

(1) whats .xlt file ?
(2) i wont copy data from .xlt file and put it into .xls file. i want
to use the template xls file because thats nice looking and
colorful ....my new excel  should have the same color and look
borrowed from the template....however , i shall bring data from some
other sources and would like to put those into the new excel sheet.
Lew - 13 Mar 2007 14:39 GMT
> (1) whats .xlt file ?

The Excel spreadsheet template.

-- Lew
Joshua Cranmer - 13 Mar 2007 23:12 GMT
> On Mar 11, 10:37 pm, Joshua Cranmer <Pidgeo...@epenguin.zzn.com>
> wrote:
[quoted text clipped - 29 lines]
> borrowed from the template....however , i shall bring data from some
> other sources and would like to put those into the new excel sheet.

I can't help you here, because it sounds as if you need Microsoft's .xls
format, which is (naturally) non-public. There might be some information
online if you dig for it, but there is no official documentation.

if you just want to copy one .xls to another, my code above should work.
jb - 18 Mar 2007 10:59 GMT
> can i use my excel template here ?

Well I have been up to doing such things some time ago, and I dug up
following things:
1. Doing it witg Office is not a good idea, first you may break the
law (by de-enginierring closed specyfication), second you won't get
any help from nobody except for money, third your spreadsheet may look
awfyully disorted when you change version of microsoft office (well
office is not fully compatible with itself), last it's awfully
complicated.

2. Depenmding on what you want to do you have some open--source free
software.

If you need beautifull noneditable documents use TeX output, then
(form your program) compile it to pdf. Learning to TeX is something
like two weeks of work.

If you need ugly editable documents use .csv (comma separated valuse)
format for spreadshets, and txt or rtf for documents. With csv you'll
get the perk that anything will be albe to render is as a spreadsheet
(Exel and Calc, Google Spreadsheets, even some obscure scientific
software).

If you need nice and editable documents use open document format. It's
open (so you'l get specyfiaction, and a lot of free help). They're
also working on ways to make such programs easier to use.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.