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)
Help please - Adding Label to design programatically than can not be changed in designer
qos
Hello,
I would like to know if there is a way I can add LabelItem to a report design programatically that can not be droped or edited in Birt RCP Designer by end users.
Can anyone help me please?
Thanks in advance
Find more posts tagged with
Comments
JasonW
You can use the DE API to add a label to a report, but where do you want to call it from?
Jason
qos
Hello Jason,
Glad to hear from you.
I know how to add a label programatically using DE API. What I really need is a report item that can not be changed in rcp designer, e.g. , I add a label (programatically) to the report that has blank background and black characters. I don't want end users that will design the remaning report layout to be able to change that label. Made myself clear?....
I will problably need to create a custom item due to other characteristics, this would solve my problem?
Thank you
Teresa
JasonW
That is a tough one. Even if you create a custom report item, they could always open up the xml and change values.
Jason
qos
Hello Jason,
Yes, that is a good point and I had already thought about that but my end users probably don't know how to change the xml, not being able to change in designer would be a first blocker... But if it is not possible at all tell me and I will try to think of another solution ...
Thank you
JasonW
I think you could use the report item extensions to prevent the label from being edited, but I do not think you can prevent them from deleting it. This would make a good enhancement request if you want to log it in bugzilla.
Jason
qos
Hello Jason,
Just to keep you updated:
I have created a custom item that outputs as a preformated HTML so there is no way my end-users can change its presentation, which is the most important for me. The contents come from data source so I will have no problem with that also.
Regarding to deleting I will have to validate at runtime if the item was removed.
I've followed de RotatedText sample, the only thing I couldn't achieve is WYSIWYG because I didn't find a provider for Html. Do I have to do it as an image?....
Thank you!!
JasonW
If you look at the getOutputType method in that example it is set to image you should be able to use:
OUTPUT_AS_HTML_TEXT
And then return a String containing the HTML in the onRowSets method.
Jason
qos
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="72350" data-time="1295365147" data-date="18 January 2011 - 08:39 AM"><p>
If you look at the getOutputType method in that example it is set to image you should be able to use:<br />
OUTPUT_AS_HTML_TEXT<br />
And then return a String containing the HTML in the onRowSets method.<br />
<br />
Jason<br /></p></blockquote>
<br />
Yes, I've done that successfully to achieve "WhatYouGet" but "WhatYouSee" is in the example as an image, using IReportItemImageProvider instead of IReportItemLabelProvider. What should I use to "see" in the designer what I "get" in preview ?...<br />
<br />
On "onRowSets" I am returning something like <br />
<br />
"<div><span style=\"background: white; font-family: calibri; font-size:8pt; color: #939393\">"+ text +" </span> </div>";
JasonW
In the plugin.xml remove:
<reportItemFigureUI
class="org.eclipse.birt.sample.reportitem.rotatedtext.RotatedTextFigureUI">
</reportItemFigureUI>
and add this:
<reportItemLabelUI
class="org.eclipse.birt.sample.reportitem.rotatedtext.RotatedTextLabelUI">
</reportItemLabelUI>
This will just use the text. If you do not like this approach and you want to keep it as a figure modify RotatedTextFigure to draw text instead of an image.
Jason
qos
Yes, that's what I have now but it only returns text, html formatting is not possible.
It's not a big question for now, only wanted to know if there was a simple way to do it.
Thank you for your help and atention.
JasonW
Right now the extension only supports figures, labels and images I believe.
Jason