Skip to main content



      Home
Home » Archived » BIRT » Adding elements to HTML head in report item presentation
Adding elements to HTML head in report item presentation [message #829489] Mon, 26 March 2012 07:07 Go to next message
Eclipse UserFriend
Looking at IReportItemPresentation and ReportItemPresentationBase, it doesn't seem possible to emit something in the head of HTML report when the item is present. Is this correct?

From quick googling it seems that <style> tags in body work on all major browsers, still making things valid, if possible, seems better Smile
Re: Adding elements to HTML head in report item presentation [message #829655 is a reply to message #829489] Mon, 26 March 2012 11:51 Go to previous messageGo to next message
Eclipse UserFriend
Actually, this turned out to be a problem Sad

When I just add <style> tag, it's missing in Firefox completely; when I try to add it to head using Javascript, BIRT seems to try to escape it somewhere and mess things up. From MyItemPresentation.onRowSets I return a string which ends like this:
$j('<style type="text/css"> ... lots of css rules ... </style>').appendTo('head');
</script>
<input type="text" class="param" name="DTParam" id="DateTimePickerItem_2"/>
<script>$j('#DateTimePickerItem_2').datetimepicker({dateFormat: 'yy-mm-dd', timeFormat: 'hh:mm:ss.l', showSecond: true, autoSize: true})
</script>

and still have the same in HTMLPageLM.layout(), according to debugger. But when I view source of the resulting report in FireFox, I see the same except for the closing style tag: there is <\/style> there instead.

1. Any reason you know of for this to happen?
2. Can I see the precise source of the page emitted by BIRT, so I can check if it's Firefox's fault?
Re: Adding elements to HTML head in report item presentation [message #830049 is a reply to message #829655] Tue, 27 March 2012 01:35 Go to previous messageGo to next message
Eclipse UserFriend
Duh. That's correct behavior: http://www.herongyang.com/JavaScript/Browser-Escape-Script-Tag-in-String-Literal.html Still need to figure out why the styles don't get applied...

And finally, it turns out that fitting several CSS rules on one line using ";" doesn't work, " " is needed instead.

[Updated on: Tue, 27 March 2012 02:05] by Moderator

Re: Adding elements to HTML head in report item presentation [message #830762 is a reply to message #830049] Tue, 27 March 2012 23:03 Go to previous messageGo to next message
Eclipse UserFriend
Do the styles get applied if you use /preview (Preview in HTML) instead
of the WebViewer?

Jason

On 3/27/2012 1:35 AM, Alexey Romanov wrote:
> Duh. That's correct behavior:
> http://www.herongyang.com/JavaScript/Browser-Escape-Script-Tag-in-String-Literal.html
> Still need to figure out why the styles don't get applied...
Re: Adding elements to HTML head in report item presentation [message #830795 is a reply to message #830762] Wed, 28 March 2012 00:06 Go to previous message
Eclipse UserFriend
As I've said, the problem was that I was constructing the style tag incorrectly Smile
Previous Topic:Performance is better with firefox
Next Topic:Scripted Data Source and custom ODA data source: advantages and disadvantages
Goto Forum:
  


Current Time: Sun Jul 13 10:57:41 EDT 2025

Powered by FUDForum. Page generated in 0.03858 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top