Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to get style of element
dzish
Hi,<br />
<br />
can anybody help me? <br />
<br />
I want to change style of element. I found element and tried in many javascript events<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var style = myElement.getPrivateStyle();
</pre>
but style is always null. Where can I obtain style?
Find more posts tagged with
Comments
mwilliams
Hi dzish,
Are you talking about manually styling an element? Or are you talking about the style sheet?
If manually styling an element, in it's onCreate script, you can access the style with this.getStyle(). Then, you'll have the different style options that can be set, i.e. this.getStyle().styleOption = "styleValue";
dzish
Hi,<br />
<br />
I meant "manually styling an element". But I also forgot to write one essential thing. The report is called from Birt Sample Viewer (BSV).<br />
<br />
My scenario is:<br />
1. I'm generating report in BSV . it's html format with tables <strong class='bbc'>without</strong> page breaks.<br />
2. Then I'm doing export of that report from BSV to pdf. I want this one <strong class='bbc'>with</strong> page breaks. <br />
<br />
For getting format I tried "__format". It was alaways "html" even with export to pdf.<br />
Then I tried "reportContext.getRenderOption()" it returns pdf but only onRender event.<br />
<br />
You can try to generate my example. With straight export to pdf from eclipse "view report as PDF" it's correct. It . With export to pdf through BSV it doesn't work.<br />
<br />
Note:in the example I finally get style of element, but it doesn't change pagebreaks as I wish.
mwilliams
dzish,
What version of BIRT are you using, so I can open/modify the report in the correct version?
dzish
Hi,
I have 2.5.1 and I must use it. I've used workaround. I put to report empty label which is visible in all formats except html. And it has "pagebreak after always".
So in html it is seamless and in other formats it has page breaks.
thank you