For Programmers: Free Programming Magazines  


Home > Archive > Smalltalk > May 2005 > Formatting a spreadsheet file through smalltalk









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Formatting a spreadsheet file through smalltalk
Suresh Kumar

2005-05-09, 3:58 am

Hi All,

We have created a spreadsheet file(compatible with open office and ms
office) using a Smalltalk application.
We would like to change the font and the color of the text, i.e. we have to
write in to the file in a specified format.
How can we do so from the Smalltalk application[VW7.3].

Thanks in Advance,



--
Suresh Kumar


Hans-Martin Mosner

2005-05-09, 3:58 am

"Suresh Kumar" <suresh@ivasystems.com> wrote:
> Hi All,
>
> We have created a spreadsheet file(compatible with open office and ms
> office) using a Smalltalk application.
> We would like to change the font and the color of the text, i.e. we have to
> write in to the file in a specified format.
> How can we do so from the Smalltalk application[VW7.3].

This is pretty independent of Smalltalk.
You did not specify in what format your spreadsheet file is written. If
it's CSV, then as far as I know you can't specify things such as font or
text color. If it's another format, you would need to check how this
format specifies these attributes.

Cheers,
Hans-Martin
jim.thompson@lagosantafe.com

2005-05-09, 4:01 pm


If anyone knows of api for talking to .xls files I'm very interested
also.

I have found some references to using ODBC to get data from them.

Thomas Gagne

2005-05-09, 4:01 pm

Same here. If your company allows it, this sounds like a great open
source contribution.

jim.thompson@lagosantafe.com wrote:
> If anyone knows of api for talking to .xls files I'm very interested
> also.
>
> I have found some references to using ODBC to get data from them.
>

Ian Upright

2005-05-10, 8:58 am

"Suresh Kumar" <suresh@ivasystems.com> wrote:

>Hi All,
>
>We have created a spreadsheet file(compatible with open office and ms
>office) using a Smalltalk application.
>We would like to change the font and the color of the text, i.e. we have to
>write in to the file in a specified format.
>How can we do so from the Smalltalk application[VW7.3].
>
>Thanks in Advance,


There needs to be better API's for OpenOffice to do this sort of thing.. And
then there needs to be better bindings from Smalltalk to C++ to tie into it.
Either way, I'm sure you can hack up OpenOffice a bit to get the job done,
but it might not be pretty or easy.

Ian

---
http://www.upright.net/ian/
Thomas Gagne

2005-05-10, 4:00 pm

I tried looking into that. I wanted to create a filter to convert .xls
files to tab separated files. The API wasn't inspiring.

Ian Upright wrote:
> "Suresh Kumar" <suresh@ivasystems.com> wrote:
>
>
>
>
> There needs to be better API's for OpenOffice to do this sort of thing.. And
> then there needs to be better bindings from Smalltalk to C++ to tie into it.
> Either way, I'm sure you can hack up OpenOffice a bit to get the job done,
> but it might not be pretty or easy.
>
> Ian
>
> ---
> http://www.upright.net/ian/

James Wong

2005-05-10, 4:00 pm

I'm not familiar with Open Office but to access the Microsoft Office
products such as
Word, Excel, Outlook, etc. I'd recommend using the OLE (Object Linking and
Embedding)
interface. Using a custom built OLE wrapper class, I was able to build and
manipulate
Excel spreadsheets, call Word spellcheck, lookup Outlook addresses, etc. for
the programs
written for my commercial clients.

Caveat: I wrote these under VisualAge Smalltalk versions 4.02-6.01 using
IBM's OLE
Automation Object class. I also put a sample MS Word Spell Check example on
D. Pennington's Totally Object Web site:
http://www.totallyobjects.com/vafree.htm

I'm not an expert with VisualWorks, but it appears you could use the
DLLConnect
feature to build a similar OLE Automation class and call the MS OLE DLLs.
I've called
MS DLLs numerous times under VisualAge Smalltalk and it was straight
forward,
especially if you've used MS Visual Studio.

An alternative is to ask a vendor if they would consider developing a
wrapper class
for commerical resale...

James Wong
Logical Answers Inc.
jhwong@LogicalAnswers.com


jim.thompson@lagosantafe.com

2005-05-10, 4:00 pm

I'm looking at

http://msdn.microsoft.com/library/d...siderations.asp

This may be viable.

Thanks for the info on OLE.


James Wong wrote:
> I'm not familiar with Open Office but to access the Microsoft Office
> products such as
> Word, Excel, Outlook, etc. I'd recommend using the OLE (Object

Linking and
> Embedding)
> interface. Using a custom built OLE wrapper class, I was able to

build and
> manipulate
> Excel spreadsheets, call Word spellcheck, lookup Outlook addresses,

etc. for
> the programs
> written for my commercial clients.
>
> Caveat: I wrote these under VisualAge Smalltalk versions 4.02-6.01

using
> IBM's OLE
> Automation Object class. I also put a sample MS Word Spell Check

example on
> D. Pennington's Totally Object Web site:
> http://www.totallyobjects.com/vafree.htm
>
> I'm not an expert with VisualWorks, but it appears you could use the
> DLLConnect
> feature to build a similar OLE Automation class and call the MS OLE

DLLs.
> I've called
> MS DLLs numerous times under VisualAge Smalltalk and it was straight
> forward,
> especially if you've used MS Visual Studio.
>
> An alternative is to ask a vendor if they would consider developing a


> wrapper class
> for commerical resale...
>
> James Wong
> Logical Answers Inc.
> jhwong@LogicalAnswers.com


Marten Feldtmann

2005-05-10, 4:00 pm

I would very like to have a connection to OpenOffice, but the
whole stuff is much more difficult than working with MSWord
or MSExcel.

They go more and more with Java and though OpenOffice is platform
independent they have "strange" unusual interfaces - and they
produce documentation over documentation and most of it is not
really helpful - I think having a Smalltalk browser on top of
OpenOffice would help them much much more.

In general we wrote StarBasic libraries, which we call from our
VA Smalltalk systems - but even here StarBasic is pretty bad
compared against VBA.

I think if one want to start with this stuff, they should have
a look at the Python connection ... pretty much the same should
be possible with Smalltalk - and the Python programmer mentioned,
that all untyped languages are better suited for a wrapper than
typed languages.

Marten

Thomas Gagne schrieb:[color=darkred]
> I tried looking into that. I wanted to create a filter to convert .xls
> files to tab separated files. The API wasn't inspiring.
>
> Ian Upright wrote:
>
btaylor@surewest.net

2005-05-11, 4:02 pm

Suresh,
There are examples for manipulating Excel files in the COM Interface
code that ships with VW. I've used this from VW 7.x on Windows to
populate and format Excel files in the past.
Brett
Suresh Kumar wrote:
> Hi All,
>
> We have created a spreadsheet file(compatible with open office and ms
> office) using a Smalltalk application.
> We would like to change the font and the color of the text, i.e. we

have to
> write in to the file in a specified format.
> How can we do so from the Smalltalk application[VW7.3].
>
> Thanks in Advance,
>
>
>
> --
> Suresh Kumar


Volker Zink

2005-05-13, 4:15 pm

In Squeak 3.7 i have seen an OpenOffice-Importer. Maybe you can port it
to VW and use it.

Volker

Suresh Kumar schrieb:
> Hi All,
>
> We have created a spreadsheet file(compatible with open office and ms
> office) using a Smalltalk application.
> We would like to change the font and the color of the text, i.e. we have to
> write in to the file in a specified format.
> How can we do so from the Smalltalk application[VW7.3].
>
> Thanks in Advance,
>
>
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com