Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Exporting Data from SWT to Spreadsheat (e.g. Excel)
Exporting Data from SWT to Spreadsheat (e.g. Excel) [message #439164] Tue, 06 July 2004 11:56 Go to next message
Eclipse UserFriend
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 #439165 is a reply to message #439164] Tue, 06 July 2004 12:12 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin ScheglovFriend
Messages: 555
Registered: July 2009
Senior Member
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?

--
SY, Konstantin.
Advanced Eclipse SWT Designer (http://www.swt-designer.com)


Konstantin Scheglov,
Google, Inc.
Re: Exporting Data from SWT to Spreadsheat (e.g. Excel) [message #439174 is a reply to message #439165] Tue, 06 July 2004 14:47 Go to previous messageGo to next message
Eclipse UserFriend
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 #439189 is a reply to message #439174] Tue, 06 July 2004 18:49 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
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
Re: Exporting Data from SWT to Spreadsheat (e.g. Excel) [message #439218 is a reply to message #439189] Wed, 07 July 2004 15:34 Go to previous message
Eclipse UserFriend
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
Previous Topic:Reverse Tree Viewer
Next Topic:Tableviewer, Content-, Labelprovider - Question
Goto Forum:
  


Current Time: Fri Apr 26 06:02:58 GMT 2024

Powered by FUDForum. Page generated in 0.02912 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top