excel sheet template

G

gk

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 ?
 
J

Joshua Cranmer

gk said:
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 ?
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.
 
G

gk

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.


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.
 
J

Joshua Cranmer

gk said:
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.

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.
 
J

jb

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top