OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

[Solved] Mistake in the Developer's Guide?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
satabau
General User
General User


Joined: 12 Mar 2012
Posts: 34

PostPosted: Mon May 28, 2012 8:01 am    Post subject: [Solved] Mistake in the Developer's Guide? Reply with quote

I was here http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Conditional_Formats
and I just copied the example
Code:

// get the conditional format object of the cell range
 com.sun.star.table.XCellRange xCellRange = xSheet.getCellRangeByName("A1:B10");
 com.sun.star.beans.XPropertySet xPropSet = (com.sun.star.beans.XPropertySet)
     UnoRuntime.queryInterface(com.sun.star.beans.XPropertySet.class, xCellRange);
 com.sun.star.sheet.XSheetConditionalEntries xEntries =
     (com.sun.star.sheet.XSheetConditionalEntries) xPropSet.getPropertyValue("ConditionalFormat");

but I have this
java.lang.ClassCastException: com.sun.star.uno.Any cannot be cast to com.sun.star.sheet.XSheetConditionalEntries
Where's the problem?
Thank you


Last edited by satabau on Thu May 31, 2012 7:55 am; edited 1 time in total
Back to top
View user's profile Send private message
satabau
General User
General User


Joined: 12 Mar 2012
Posts: 34

PostPosted: Thu May 31, 2012 7:54 am    Post subject: Reply with quote

Code:
 
     XPropertySet xPropSet = (XPropertySet)
          UnoRuntime.queryInterface(XPropertySet.class, xCellRange);
     Object obj= xPropSet.getPropertyValue("ConditionalFormat");
     XSheetConditionalEntries xEntries =   (XSheetConditionalEntries)
           UnoRuntime.queryInterface(XSheetConditionalEntries.class, obj);
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group