Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 6:09 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Mental exercise!
PostPosted: January 31st, 2005, 7:55 am 
Offline

Joined: November 3rd, 2004, 12:58 pm
Posts: 230
Location: Australia
Hello to all
I am in the middle of this project and everything is cool....until now...

My client have several excel spreadsheets and he ask me if it is possible that Opus 4.0 reads a particular "cell" in the spreadsheet and present the information on a text field inside opus.

Therefore, the mental exercise here is to see if this is possible: Can Opus 04, using scripting, go and read a particular "cell" on a particular excel spreadsheet and present the result inside Opus???

This is a BIG S.O.S to all the Opus users out there!

German

_________________
German Silva
Senior Web & Multimedia Developer
E-solutions Inc
Pro version 8.10 user


Top
 Profile  
 
 Post subject:
PostPosted: January 31st, 2005, 11:25 am 
Offline
User avatar

Joined: October 25th, 2004, 10:33 am
Posts: 257
Location: UK
Opus: Pro 8
OS: Windows 7 Professional x64
System: Dell XPS15 i7x4 2.1Ghz 6GB 128GB SSD
In theory you can access an excel spreadsheet as a database, so you could make it work that way.


Top
 Profile Visit website  
 
 Post subject: Thanks but nop
PostPosted: January 31st, 2005, 12:07 pm 
Offline

Joined: November 3rd, 2004, 12:58 pm
Posts: 230
Location: Australia
Hi Dave,
I have tried this approach but without success!
It must be a way to script a command to copy the content of a cell and paste it into a text variable in opus...
Keep thinking....
German

_________________
German Silva
Senior Web & Multimedia Developer
E-solutions Inc
Pro version 8.10 user


Top
 Profile  
 
 Post subject:
PostPosted: January 31st, 2005, 4:05 pm 
Offline

Joined: October 25th, 2004, 12:27 pm
Posts: 526
Location: Digital Workshop
Hi,

Thank you for your enquiry.

I don't think it is possible to retrieve the contents of a specific cell via an ODBC connection, but you should be able to narrow down to the required cell using the GetRecordAt() function (to select the row) and field name (to select the column).

For example, if your Excel worksheet contained the following data:

Image

and you wanted to display the contents of cell A4 in a text box, you could use the following script actions:

Code:
var db = new Database("FILEDSN=C:\\Documents and Settings\\Rgarrett\\Desktop\\contacts.dsn;") //replace this with the path to your DSN file
var RecSet = db.ExecuteSQL("SELECT * FROM [Sheet1$];") //selects all records from the worksheet
RecSet.GetRecordAt(3) //focusses on the third row of data (which is actually the fourth row of the worksheet as the field names are not counted)
result = RecSet.Name //focusses on the first column of data


Now simply create a publication variable named 'result' and insert it into a text box. Preview the publication and the contents of cell A4 (which in this case would be "Camilla Johnson") should be displayed.

I hope this helps. Please do not hesitate to contact me if you have any further queries.

Kind regards,

_________________
Robin Garrett
Digital Workshop Technical Support


Top
 Profile Visit website  
 
 Post subject: spot on!
PostPosted: February 1st, 2005, 6:10 am 
Offline

Joined: November 3rd, 2004, 12:58 pm
Posts: 230
Location: Australia
Spot on Robin!

Thank you very much.
German

_________________
German Silva
Senior Web & Multimedia Developer
E-solutions Inc
Pro version 8.10 user


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 36 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group