poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Andrews <pythonadd...@yahoo.com>
Subject Re: Problem with Cell formatting at columns level
Date Wed, 18 Jan 2006 09:31:10 GMT
I tried four times to attach the code and each  time the message was rejected as spam. So,
I have uploaded the zip file  to rapidshare and you will need to go there to download it.
  
  You should get a zip file. Simply unzip it into a separate folder and  then look at the
read me file. That will tell you what extra archives  you need to download and where to get
them. It alos explains how the  OLE code works. Sorry to say that it focuses on formulae as
that is  what we were discussing on the borard at the time but it does show you  how OLE could
be used to solve the problem you are facing.
  
  Good luck.
  
  Anyway, the link to Rapdishar is:
  
  http://rapidshare.de/files/11274740/Excel_OLE.zip.html
  
  This will open up a screen from whcih you can select how to download  the file. Look to
the bottom of the third column in the table that  appear in the middle of the page and click
on the button that says  'Free'.
  
  You may be prompted to enter a security code into a box, if so do this  and then click on
the Start Download button. This should cause the  system to download the file to you.

Madhav Sadhu <madhav.sadhu@saama.com> wrote:  Thanks Anthony,

If you have the class which you mentioned please pass it to me. It will be
of great help.

Thanks
Madhav

----- Original Message -----
From: "Anthony Andrews" 

To: "POI Users List" 

Sent: Tuesday, January 17, 2006 12:31 PM
Subject: Re: Problem with Cell formatting at columns level


> Sorry to say that I do not, no.
>
>   I also use JExcel and it works in the same way, you apply the formatting
to the cell and not the column.
>
>   The only other option I could think of is OLE. It is NOT for the
fainthearted, in fact Microsoft advise against using it to 'drive'  Excel.
Their argument is that Excel relies on interacting with the user  to resolve
problems and OLE does not support this, that there are  problems with
multi-threaded access to the application and so on.  However, if you are
prepared for the work then there is a possible  course of action open to
you.
>
>   When IBM wrote the Eclipse platform originally, they included the SWT
or Standard Widget Toolkit. One of the packages built into the SWT is  an
OLE package that does allow you to take full control over Excel. If  you
have ever written an Excel macro - using VBA - you will know just  what I am
talking about. A long time ago, I wrote a very simple class  that
demonstrated how to use the OLE package but it is not, I must  emphasise, a
trivial task. What you are actually doing is executing VBA  commands. Just
to give you some idea, this is VBA -  Columns("A:A").Select - it is the
command that selects all of the cells  in column A. To automate this using
OLE you would obtain what is called  an OLEAutomation object that refers to
the worksheet, use this to  obtain another OLEAutomation object for the
Columns entity and then use  this to execute the select command. It can be
quite labour intensive as  you need to work your way through the Excel
Object Model to find just  the
>  property/method you need.
>
>   If you wish, I will try to look out that class and let you have it but
I can offer no guarantees. You will also need to obtain the archive for  the
SWT and ensure that this is included on your classpath but that is  easy
enough to do. Of course, if you use Eclipse as your development
environment, then you have most of the tools you need.
>
>
>
> Madhav Sadhu  wrote:  Hi Anthony,
>
> Thanks for the quick reply.
>
> I tried this approach before and it works, but the issue is, I need to
serve
> this xls over the web to the client browser.
> This will increase the download time and network traffic if I create a
huge
> XLS file with blank rows and send it across the web.
> User might end up using 10 rows, whereas I have to send a file with
> 65000(this is the maximun number that is alowed in xls I guess) rows.
>
> Are you aware of any licensed tools which will allow to set formatting at
> Column level (No JNI wrappers over COM components since my environment is
> linux) ?
>
> Thanks
> Madhav
>
>
> ----- Original Message -----
> From: "Anthony Andrews"
>
> To: "POI Users List"
>
> Sent: Tuesday, January 17, 2006 12:02 PM
> Subject: Re: Problem with Cell formatting at columns level
>
>
> > As far as I am aware, there is no way to apply a  format to a column -
> that is too all of the cells in a column - using a  single command. What
you
> will have to do is add blank cells to the  column in question; perhaps
> surprisingly, it is possible to set the  format for Blank cells. That
should
> ensure that the format of the cells  in the column is set ready for your
> users to enter data.
> >
> >   I have to admit however, that I have not tried this myself but I
believe
> it will work.
> >
> > Madhav Sadhu  wrote:  Hello,
> >
> > I need to format the entire column of an excel. Currently, the only way
I
> > can do it is by assigning a format to all the cells. However, for my
> > requirement, I  need to create a blank excel sheet with the columns
> > formatted, so that when users use that excel to fill in data, they donot
> do
> > need to worry about putting the data in a proper format.
> >
> > I had posted this in the bug list and sent an email also on the same but
> > could not get any help. Any help in this matter is greatley appreciated.
> >
> > Thanks
> > Madhav
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> > Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> > The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
> >
> >
> >
> >
> >
> > ---------------------------------
> > Yahoo! Photos
> >  Got holiday prints? See all the ways to get quality prints in your
hands
> ASAP.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>
>
>
>
>
>
>
> ---------------------------------
> Yahoo! Photos - Showcase holiday pictures in hardcover
>  Photo Books. You design it and we'll bind it!


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/






		
---------------------------------
Yahoo! Photos – Showcase holiday pictures in hardcover
 Photo Books. You design it and we’ll bind it!
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message