Skip to main content



      Home
Home » Archived » BIRT » Disable default styles
Disable default styles [message #708985] Wed, 03 August 2011 07:18 Go to next message
Eclipse UserFriend
Is it possible to disable the default style created by BIRT has well has the script tag that is generated when the output format is HTML?
For example, every time a report is generated the output includes the following HTML tags:

<style type="text/css">
		.style_0 { font-family: serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; color: black; text-indent: 0em; letter-spacing: normal; word-spacing: normal; text-transform: none; white-space: normal; line-height: normal;}
</style>
<script type="text/javascript">
 //<![CDATA[
   function redirect(target, url){
       if (target =='_blank'){
           open(url);
       }
       else if (target == '_top'){
           window.top.location.href=url;
       }
       else if (target == '_parent'){
           location.href=url;
       }
       else if (target == '_self'){
           location.href =url;
       }
       else{
           open(url);
       }
      }
 //]]>
</script>
<table>
    (...)
</table>


Can this be disabled?
Re: Disable default styles [message #709138 is a reply to message #708985] Wed, 03 August 2011 10:41 Go to previous messageGo to next message
Eclipse UserFriend
Are you using the API or the Viewer? If you are using the API take a
look at some of the html render options here:
http://www.eclipse.org/birt/phoenix/project/notable3.7.php#jump_8

Jason

On 8/3/2011 7:18 AM, Em wrote:
> Is it possible to disable the default style created by BIRT has well has
> the script tag that is generated when the output format is HTML?
> For example, every time a report is generated the output includes the
> following HTML tags:
>
>
> <style type="text/css">
> .style_0 { font-family: serif; font-style: normal; font-variant: normal;
> font-weight: normal; font-size: 10pt; color: black; text-indent: 0em;
> letter-spacing: normal; word-spacing: normal; text-transform: none;
> white-space: normal; line-height: normal;}
> </style>
> <script type="text/javascript">
> //<![CDATA[
> function redirect(target, url){
> if (target =='_blank'){
> open(url);
> }
> else if (target == '_top'){
> window.top.location.href=url;
> }
> else if (target == '_parent'){
> location.href=url;
> }
> else if (target == '_self'){
> location.href =url;
> }
> else{
> open(url);
> }
> }
> //]]>
> </script>
> <table>
> (...)
> </table>
>
>
> Can this be disabled?
>
Re: Disable default styles [message #709151 is a reply to message #709138] Wed, 03 August 2011 11:05 Go to previous messageGo to next message
Eclipse UserFriend
I've looked at it but the closest option to what I want is options.setEnableInlineStyle(true); but I don't want to set the styles inline, I want to completely remove the styles generated by BIRT.
I'm using the API and the desired output that I have in mind is to be able to set something like:
<div class="my_external_stylesheet_class_name">

and not
<div class="style_0">


Can this be archived?

What about the javascript, I don't need it in my page, can't it be disabled so that the output comes in clean HTML?
Re: Disable default styles [message #709199 is a reply to message #709151] Wed, 03 August 2011 11:50 Go to previous messageGo to next message
Eclipse UserFriend
The only way to remove the JavaScript function is to modify the
HTMLEmitter. Comment out fixRedirect( ) function the
HTMLReportEmitter.java class in the start method. I also do not see a
way around the styles unless you modify the emitter. One option you
have is when you create the report and right click on the styles there
is a use css option. You can point to a local style sheet and click the
check box to "Include CSS file at view time(Apply only to HTML format).
This will still produce the styles at the top of the output, but will
change the individual items like the following.

//top of output
<style type="text/css">
..style_2 { font-family: Arial; font-size: small; padding: 0px;
background-color: rgb(186, 202, 226);}
..
..
//a link is automatically placed in the output that points to my
//viewtime css
<link rel="stylesheet" type="text/css"
href="http://localhost:8090/3.7/corporate.css"></link>

//table row with style
<tr class="style_1 HeaderFooter" valign="top" align="center">

The class attribute shows up with two styles. The browser will try to
locate the HeaderFooter style before applying style_1. If it can not
find it the style_1 will be applied.


Jason

On 8/3/2011 11:05 AM, Em wrote:
> I've looked at it but the closest option to what I want is
> options.setEnableInlineStyle(true); but I don't want to set the styles
> inline, I want to completely remove the styles generated by BIRT.
> I'm using the API and the desired output that I have in mind is to be
> able to set something like:
> <div class="my_external_stylesheet_class_name">
> and not
> <div class="style_0">
>
> Can this be archived?
>
> What about the javascript, I don't need it in my page, can't it be
> disabled so that the output comes in clean HTML?
Re: Disable default styles [message #709223 is a reply to message #709199] Wed, 03 August 2011 12:47 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for your reply, it answered my question. I have only one doubt left regarding this issue. I'm using the "Use CSS File.." options from the report designer and I've checked the "Include CSS file at view time" check box but when I set the report to be embedded the external CSS classes are not outputted to the HTML.

If I configure the options like this:
HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFormat(IHTMLRenderOption.OUTPUT_FORMAT_HTML);
options.setOutputStream(output);
options.setEmbeddable(false);

I get this:
http://i55.tinypic.com/1zb8odd.jpg
But if I set the options to be embeddable like this:
HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFormat(IHTMLRenderOption.OUTPUT_FORMAT_HTML);
options.setOutputStream(output);
options.setEmbeddable(true);

I get this:
http://i53.tinypic.com/206292x.jpg

Why aren't the classes present in the embeddable HTML? Is this normal?
Re: Disable default styles [message #709270 is a reply to message #709223] Wed, 03 August 2011 14:08 Go to previous messageGo to next message
Eclipse UserFriend
This may be by design as the link statement is in the header. Can you
open a bugzilla entry for this?

Jason

On 8/3/2011 12:47 PM, Em wrote:
> Thank you for your reply, it answered my question. I have only one doubt
> left regarding this issue. I'm using the "Use CSS File.." options from
> the report designer and I've checked the "Include CSS file at view time"
> check box but when I set the report to be embedded the external CSS
> classes are not outputted to the HTML.
>
> If I configure the options like this:
> HTMLRenderOption options = new HTMLRenderOption();
> options.setOutputFormat(IHTMLRenderOption.OUTPUT_FORMAT_HTML);
> options.setOutputStream(output);
> options.setEmbeddable(false);
> I get this:
>
> But if I set the options to be embeddable like this:
> HTMLRenderOption options = new HTMLRenderOption();
> options.setOutputFormat(IHTMLRenderOption.OUTPUT_FORMAT_HTML);
> options.setOutputStream(output);
> options.setEmbeddable(true);
> I get this:
>
>
> Why aren't the classes present in the embeddable HTML? Is this normal?
>
Re: Disable default styles [message #709963 is a reply to message #709270] Thu, 04 August 2011 10:34 Go to previous messageGo to next message
Eclipse UserFriend
Created Bugzilla entry for this issue: Bug 353895
Re: Disable default styles [message #709996 is a reply to message #709963] Thu, 04 August 2011 10:59 Go to previous message
Eclipse UserFriend
Thanks for posting

On 8/4/2011 10:34 AM, Em wrote:
> Created Bugzilla entry for this issue:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=353895
Previous Topic:Enabling study layout in JavaScript generated axes
Next Topic:How to access the parameters of report in chart script ?
Goto Forum:
  


Current Time: Thu Jul 03 17:57:47 EDT 2025

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

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

Back to the top