Exporting Data from SWT to Spreadsheat (e.g. Excel) [message #439164] |
Tue, 06 July 2004 11:56 |
Eclipse User |
|
|
|
Originally posted by: friederich.kupzog.de
Dear SWT users,
currently i am working on the task to export some table contents
(statistics) out of my swt application. The task is simply to allow the
user to work with the statistics using other programs (Word, Excel etc.)
Well, it is easy to write a tab text file that can be imported into
Excel. It was also easy (using one of the swt snippets) to copy a text
into the clipboard and insert it into Word. So, the basic functionality
is provided. But I would like to make it more comfortable.
Has anyone got some experience with
- generating an Excel Document (using OLE?)
- putting table data into the clipboard so that it is
properly inserted into an Excel document
(in my case the whole table becomes one cell)
and could me some hints what to read/where to start?
Thanks a lot in advance
Friederich
--
Friederich Kupzog
Elektronik & Software
Neusser Str. 5-7
50670 Köln
Tel 0241 160696-1
Fax 0221 726670
www.kupzog.de/fkmk
|
|
|
|
Re: Exporting Data from SWT to Spreadsheat (e.g. Excel) [message #439174 is a reply to message #439165] |
Tue, 06 July 2004 14:47 |
Eclipse User |
|
|
|
Originally posted by: friederich.kupzog.de
Hello Konstantin,
how to do that? Using TextTransfer and putting a csv-text in it?
(I think my main problem is that I have no experience in using the
clipboard)
Thanks,
Friederich
Konstantin Scheglov wrote:
> Friederich Kupzog <friederich@kupzog.de> wrote:
>
>
>> - generating an Excel Document (using OLE?)
>
> http://jakarta.apache.org/poi/
>
>
>> - putting table data into the clipboard so that it is
>> properly inserted into an Excel document
>> (in my case the whole table becomes one cell)
>
> May be put in clipboard in CSV format?
>
--
Friederich Kupzog
Elektronik & Software
Neusser Str. 5-7
50670 Köln
Tel 0241 160696-1
Fax 0221 726670
www.kupzog.de/fkmk
|
|
|
|
Re: Exporting Data from SWT to Spreadsheat (e.g. Excel) [message #439218 is a reply to message #439189] |
Wed, 07 July 2004 15:34 |
Eclipse User |
|
|
|
Originally posted by: friederich.kupzog.de
Hello,
sorry, it seems the error is somewhere else. Yes, using tabs and
newlines is how it works, but I did already so and i just found out: it
worked before :-(
I watched someone trying the paste feature in Excel and in that
particular case (as I recognise now) it did not work - whatever unusual
he did....
So, in fact the problem does not exist.
Nevertheless, thanks for all answers
Friederich
Veronika Irvine wrote:
> If you use TextTransfer, Excel expects a new line after every row and
> columns separated by a tab
>
> e.g.
>
> public static void main (String [] args) {
> Display display = new Display ();
> Shell shell = new Shell (display);
> Clipboard cb = new Clipboard(display);
> TextTransfer textTransfer = TextTransfer.getInstance();
> String textData = "10\t29\t33\n47\t556757\t62342424\n";
> cb.setContents(new Object[]{textData}, new Transfer[]{textTransfer});
> cb.dispose();
> shell.open ();
> while (!shell.isDisposed ()) {
> if (!display.readAndDispatch ()) display.sleep ();
> }
> display.dispose ();
> }
>
> "Friederich Kupzog" <friederich@kupzog.de> wrote in message
> news:ccee0f$vhh$1@eclipse.org...
>
>>Hello Konstantin,
>>
>>how to do that? Using TextTransfer and putting a csv-text in it?
>>(I think my main problem is that I have no experience in using the
>>clipboard)
>>
>>Thanks,
>>
>>Friederich
>>
>>Konstantin Scheglov wrote:
>>
>>>Friederich Kupzog <friederich@kupzog.de> wrote:
>>>
>>>
>>>
>>>>- generating an Excel Document (using OLE?)
>>>
>>> http://jakarta.apache.org/poi/
>>>
>>>
>>>
>>>>- putting table data into the clipboard so that it is
>>>> properly inserted into an Excel document
>>>> (in my case the whole table becomes one cell)
>>>
>>> May be put in clipboard in CSV format?
>>>
>>
>>
>>--
>>Friederich Kupzog
>>Elektronik & Software
>>Neusser Str. 5-7
>>50670 Köln
>>Tel 0241 160696-1
>>Fax 0221 726670
>>www.kupzog.de/fkmk
>
>
>
--
Friederich Kupzog
Elektronik & Software
Neusser Str. 5-7
50670 Köln
Tel 0241 160696-1
Fax 0221 726670
www.kupzog.de/fkmk
|
|
|
Powered by
FUDForum. Page generated in 0.02912 seconds