Home » Developer & Programmer » Forms » OLE2 problem (forms 6i, windows xp)
OLE2 problem [message #401783] Wed, 06 May 2009 07:24 Go to next message
kris312566
Messages: 9
Registered: May 2009
Location: Mumbai
Junior Member
Hi,

I am using forms 6i and ole2 to generate excel file from forms but which is specific to microsoft office i want that report to be open standard, means whether or not there is microsoft office installed in that machine which ever spread sheet application on the machine it should use that.

thank you in advance.
Re: OLE2 problem [message #401852 is a reply to message #401783] Wed, 06 May 2009 11:50 Go to previous messageGo to next message
TonyJaa
Messages: 50
Registered: May 2009
Member
Hi,

Have you try HOST('path of the .xls'); it will open the .xls with the default program associated. No ?

Re: OLE2 problem [message #401915 is a reply to message #401852] Wed, 06 May 2009 23:37 Go to previous messageGo to next message
kris312566
Messages: 9
Registered: May 2009
Location: Mumbai
Junior Member
this command will open that generated excel file but my problem is something like this,

application := OLE2.CREATE_OBJ('Excel.Application');
OLE2.SET_PROPERTY(application, 'Visible', 'True');
workbooks := OLE2.GET_OBJ_PROPERTY(application, 'Workbooks');
workbook := OLE2.GET_OBJ_PROPERTY(workbooks, 'Add');
worksheets := OLE2.GET_OBJ_PROPERTY(workbook, 'Worksheets');

this code will open microsoft excel and generate xls file, but suppose instead of microsoft office there is open office or lotus notes then this code will give an error

i want to make sure that what spreadsheet application the machine got report must get generated

please help....

Re: OLE2 problem [message #401961 is a reply to message #401915] Thu, 07 May 2009 02:50 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Then write the output as a 'cvs' and open it directly.

David
Re: OLE2 problem [message #401987 is a reply to message #401783] Thu, 07 May 2009 03:54 Go to previous messageGo to next message
kris312566
Messages: 9
Registered: May 2009
Location: Mumbai
Junior Member
i can do that, but then i wont be able use functions like bold, change font size and other spreadsheet functions.

if you can give me any sample code that will be very helpful.

thenks in advance...
Re: OLE2 problem [message #402153 is a reply to message #401987] Thu, 07 May 2009 21:09 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
My gut feeling is "get real". Writing code SPECIFICALLY for one spreadsheet is enough. To have to handle all different types of spreadsheets sounds as though you need a spreadsheet version of 'rtf' and I don't know whether that exists.

You will need to look in the registry to find the application associated with 'xls' or 'csv' and then use code specifically for each spreadsheet. The latter is outside the scope of this forum.

David
Re: OLE2 problem [message #402170 is a reply to message #402153] Thu, 07 May 2009 23:42 Go to previous messageGo to next message
kris312566
Messages: 9
Registered: May 2009
Location: Mumbai
Junior Member
Thank you for the support, i know one format which is known RTF for spreadsheet that is 'SYLK' but i dont know how to code for that

thanks anyways
Re: OLE2 problem [message #402711 is a reply to message #402170] Tue, 12 May 2009 02:48 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Googling 'how to code sylk' returned http://en.wikipedia.org/wiki/SYmbolic_LinK_(SYLK) among others.

David
Previous Topic: Migration forms 4.5 to 10gR2
Next Topic: field initial value property and sequences
Goto Forum:
  


Current Time: Fri Sep 20 10:34:31 CDT 2024