Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » How to get the report "Layout preference" with engine API
How to get the report "Layout preference" with engine API [message #1006821] Sat, 02 February 2013 07:19 Go to next message
donino donino is currently offline donino donino
Messages: 160
Registered: July 2011
Senior Member
Hi,

I would need to check with the report engine API if a report has been set to "auto" or "fixed" (layout preference property).

I found with a IReportRunnable object we can get this:
IReportRunnable reportDesign;
...
reportDesign.getDesignHandle().getDesignHandle().getLayoutPreference();


However this way is deprecated and returns null, it is said here we must use a moduleHandle instead:
reportDesign.getDesignHandle().getModuleHandle().*

This moduleHandle has tons of methods, but not a "getLayoutPreference()" Sad .

Please is there a way to get this property with the report engine API?

Thanks

[Updated on: Sat, 02 February 2013 07:22]

Report message to a moderator

Re: How to get the report "Layout preference" with engine API [message #1006850 is a reply to message #1006821] Sat, 02 February 2013 16:41 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1424
Registered: July 2009
Senior Member

From the designer, reportContext.getDesignHandle().getLayoutPreference() works. What's your BIRT version?

Michael
Actuate – The BIRT Company™

BIRT Developer Center
Check out the new, free BIRT Viewer Toolkit
Re: How to get the report "Layout preference" with engine API [message #1006970 is a reply to message #1006850] Sun, 03 February 2013 06:19 Go to previous messageGo to next message
donino donino is currently offline donino donino
Messages: 160
Registered: July 2011
Senior Member
Thank you Michael,

I use BIRT 4.2.1 both for Runtime / Eclipse Designer

You are right i missed it worked like this in the designer, though we still have an issue with it: as you can see in a script expression of the designer, unlike all others methods this function is not suggested by the code completion, i wonder why? If we try to use it in a java project from a ModuleHandle:

IReportRunnable reportDesign;
...
reportDesign.getDesignHandle().getModuleHandle().getLayoutPreference();
the Java project is refusing to be compiled because this method is unknown in the class ModuleHandle. I probably missed something, it seems to be the only report property that we are not able to retrieve from a "IReportRunnable" object, please could you help?

Thanks!
Re: How to get the report "Layout preference" with engine API [message #1007021 is a reply to message #1006970] Mon, 04 February 2013 00:46 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1424
Registered: July 2009
Senior Member

Try this:

reportDesign.getDesignHandle().getModuleHandle().getDisplayProperty("layoutPreference");


Michael
Actuate – The BIRT Company™

BIRT Developer Center
Check out the new, free BIRT Viewer Toolkit
Re: How to get the report "Layout preference" with engine API [message #1007124 is a reply to message #1007021] Mon, 04 February 2013 09:38 Go to previous messageGo to next message
donino donino is currently offline donino donino
Messages: 160
Registered: July 2011
Senior Member
Great!!! It works! thanks a million Michael, i was struggling with this!!!
Re: How to get the report "Layout preference" with engine API [message #1007136 is a reply to message #1007124] Mon, 04 February 2013 10:23 Go to previous message
Michael Williams is currently offline Michael Williams
Messages: 1424
Registered: July 2009
Senior Member

You're welcome! Glad to help!

Michael
Actuate – The BIRT Company™

BIRT Developer Center
Check out the new, free BIRT Viewer Toolkit
Previous Topic:Persistent variables in BIRT scripts
Next Topic:Where do I put sqljdbc_auth.dll file so that BIRT sees it?
Goto Forum:
  


Current Time: Sun Apr 20 18:13:09 EDT 2014

Powered by FUDForum. Page generated in 0.01780 seconds