Skip to main content



      Home
Home » Archived » BIRT » CSS applied to HTML at runtime
CSS applied to HTML at runtime [message #258506] Tue, 16 October 2007 12:54 Go to next message
Eclipse UserFriend
I'm referencing a BIRT CSS file, per the BIRT World article--works
great! Now my client says they want to provide a CSS file themselves
that applies to the rendered HTML. Two questions then:

1) How can I reference a CSS file in my rendered HTML?

2) How can I parameterize the name of this CSS file prior to rendering?

Thanks,

-jeff
Re: CSS applied to HTML at runtime [message #258614 is a reply to message #258506] Wed, 17 October 2007 11:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Jeff,

If you have the same styles defined in two css sheets and have linked to
one you can swap it out using some script. Lets assume you have
corporate.css and a personal.css style sheets in your resource folder
and you have linked to the corporate.css in you report and applied
styles to various items. You can create a parameter and use similar
code to the following to swap it out in the beforeFactory script.

if( params["styleparm"].value == 2 ){
sshandlelist
=reportContext.getReportRunnable().designHandle.getDesignHan dle().getAllCssStyleSheets().get(0);

reportContext.getReportRunnable().designHandle.getDesignHand le().dropCss(sshandlelist);
reportContext.getReportRunnable().designHandle.getDesignHand le().addCss( "personal.css");
}


Jason

Jeff Ramsdale wrote:
> I'm referencing a BIRT CSS file, per the BIRT World article--works
> great! Now my client says they want to provide a CSS file themselves
> that applies to the rendered HTML. Two questions then:
>
> 1) How can I reference a CSS file in my rendered HTML?
>
> 2) How can I parameterize the name of this CSS file prior to rendering?
>
> Thanks,
>
> -jeff
Re: CSS applied to HTML at runtime [message #258626 is a reply to message #258614] Wed, 17 October 2007 12:32 Go to previous messageGo to next message
Eclipse UserFriend
I think I created confusion in my effort to prevent it--I apologize. The
issue is that in addition to referencing a CSS file within the design I
need to reference another client-provided CSS file in the rendered HTML.
The fact that my design references a CSS file really has nothing to do
with my need for the HTML to reference CSS, I only meant to convey that
I understood the design-time use of CSS.

So the real need is for my HTML to reference CSS and I haven't seen yet
how to do this. Is it possible?

Jeff

Jason Weathersby wrote:
> Jeff,
>
> If you have the same styles defined in two css sheets and have linked to
> one you can swap it out using some script. Lets assume you have
> corporate.css and a personal.css style sheets in your resource folder
> and you have linked to the corporate.css in you report and applied
> styles to various items. You can create a parameter and use similar
> code to the following to swap it out in the beforeFactory script.
>
> if( params["styleparm"].value == 2 ){
> sshandlelist
> =reportContext.getReportRunnable().designHandle.getDesignHan dle().getAllCssStyleSheets().get(0);
>
> reportContext.getReportRunnable().designHandle.getDesignHand le().dropCss(sshandlelist);
>
> reportContext.getReportRunnable().designHandle.getDesignHand le().addCss( "personal.css");
>
> }
>
>
> Jason
>
> Jeff Ramsdale wrote:
>> I'm referencing a BIRT CSS file, per the BIRT World article--works
>> great! Now my client says they want to provide a CSS file themselves
>> that applies to the rendered HTML. Two questions then:
>>
>> 1) How can I reference a CSS file in my rendered HTML?
>>
>> 2) How can I parameterize the name of this CSS file prior to rendering?
>>
>> Thanks,
>>
>> -jeff
Re: CSS applied to HTML at runtime [message #258636 is a reply to message #258626] Wed, 17 October 2007 14:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Jeff,

Can you give an example of something that would use the customer
supplied css. BTW with the Text control you can put in any HTML/script
you want.

Jason

Jeff Ramsdale wrote:
> I think I created confusion in my effort to prevent it--I apologize. The
> issue is that in addition to referencing a CSS file within the design I
> need to reference another client-provided CSS file in the rendered HTML.
> The fact that my design references a CSS file really has nothing to do
> with my need for the HTML to reference CSS, I only meant to convey that
> I understood the design-time use of CSS.
>
> So the real need is for my HTML to reference CSS and I haven't seen yet
> how to do this. Is it possible?
>
> Jeff
>
> Jason Weathersby wrote:
>> Jeff,
>>
>> If you have the same styles defined in two css sheets and have linked
>> to one you can swap it out using some script. Lets assume you have
>> corporate.css and a personal.css style sheets in your resource folder
>> and you have linked to the corporate.css in you report and applied
>> styles to various items. You can create a parameter and use similar
>> code to the following to swap it out in the beforeFactory script.
>>
>> if( params["styleparm"].value == 2 ){
>> sshandlelist
>> =reportContext.getReportRunnable().designHandle.getDesignHan dle().getAllCssStyleSheets().get(0);
>>
>> reportContext.getReportRunnable().designHandle.getDesignHand le().dropCss(sshandlelist);
>>
>> reportContext.getReportRunnable().designHandle.getDesignHand le().addCss( "personal.css");
>>
>> }
>>
>>
>> Jason
>>
>> Jeff Ramsdale wrote:
>>> I'm referencing a BIRT CSS file, per the BIRT World article--works
>>> great! Now my client says they want to provide a CSS file themselves
>>> that applies to the rendered HTML. Two questions then:
>>>
>>> 1) How can I reference a CSS file in my rendered HTML?
>>>
>>> 2) How can I parameterize the name of this CSS file prior to rendering?
>>>
>>> Thanks,
>>>
>>> -jeff
Re: CSS applied to HTML at runtime [message #258660 is a reply to message #258636] Wed, 17 October 2007 16:59 Go to previous messageGo to next message
Eclipse UserFriend
What I need to do is import a CSS file in the HTML. And I would do that
from the <head> tag, so I don't think a Text control will help. The name
of the CSS file could be hard-coded but preferably would be passed in
somehow.

The client should be able to write whatever CSS they want for the
outputted report. They have no visibility to the BIRT design file and
don't care about it, so the point at which they can modify the look of
the report is through CSS that applies to the HTML.

-jeff

Jason Weathersby wrote:
> Jeff,
>
> Can you give an example of something that would use the customer
> supplied css. BTW with the Text control you can put in any HTML/script
> you want.
>
> Jason
>
> Jeff Ramsdale wrote:
>> I think I created confusion in my effort to prevent it--I apologize.
>> The issue is that in addition to referencing a CSS file within the
>> design I need to reference another client-provided CSS file in the
>> rendered HTML. The fact that my design references a CSS file really
>> has nothing to do with my need for the HTML to reference CSS, I only
>> meant to convey that I understood the design-time use of CSS.
>>
>> So the real need is for my HTML to reference CSS and I haven't seen
>> yet how to do this. Is it possible?
>>
>> Jeff
>>
>> Jason Weathersby wrote:
>>> Jeff,
>>>
>>> If you have the same styles defined in two css sheets and have linked
>>> to one you can swap it out using some script. Lets assume you have
>>> corporate.css and a personal.css style sheets in your resource folder
>>> and you have linked to the corporate.css in you report and applied
>>> styles to various items. You can create a parameter and use similar
>>> code to the following to swap it out in the beforeFactory script.
>>>
>>> if( params["styleparm"].value == 2 ){
>>> sshandlelist
>>> =reportContext.getReportRunnable().designHandle.getDesignHan dle().getAllCssStyleSheets().get(0);
>>>
>>> reportContext.getReportRunnable().designHandle.getDesignHand le().dropCss(sshandlelist);
>>>
>>> reportContext.getReportRunnable().designHandle.getDesignHand le().addCss( "personal.css");
>>>
>>> }
>>>
>>>
>>> Jason
>>>
>>> Jeff Ramsdale wrote:
>>>> I'm referencing a BIRT CSS file, per the BIRT World article--works
>>>> great! Now my client says they want to provide a CSS file themselves
>>>> that applies to the rendered HTML. Two questions then:
>>>>
>>>> 1) How can I reference a CSS file in my rendered HTML?
>>>>
>>>> 2) How can I parameterize the name of this CSS file prior to rendering?
>>>>
>>>> Thanks,
>>>>
>>>> -jeff
Re: CSS applied to HTML at runtime [message #258687 is a reply to message #258660] Thu, 18 October 2007 09:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Jeff,

You can use the tag libs and specify anything you want in the <head>,
but I am not certain how you will apply the style to the emitted html.
You may be able to do with some script. You may also want to look at
the JSP fragments that make up the viewer and the styles that are used.

Jason

Jeff Ramsdale wrote:
> What I need to do is import a CSS file in the HTML. And I would do that
> from the <head> tag, so I don't think a Text control will help. The name
> of the CSS file could be hard-coded but preferably would be passed in
> somehow.
>
> The client should be able to write whatever CSS they want for the
> outputted report. They have no visibility to the BIRT design file and
> don't care about it, so the point at which they can modify the look of
> the report is through CSS that applies to the HTML.
>
> -jeff
>
> Jason Weathersby wrote:
>> Jeff,
>>
>> Can you give an example of something that would use the customer
>> supplied css. BTW with the Text control you can put in any
>> HTML/script you want.
>>
>> Jason
>>
>> Jeff Ramsdale wrote:
>>> I think I created confusion in my effort to prevent it--I apologize.
>>> The issue is that in addition to referencing a CSS file within the
>>> design I need to reference another client-provided CSS file in the
>>> rendered HTML. The fact that my design references a CSS file really
>>> has nothing to do with my need for the HTML to reference CSS, I only
>>> meant to convey that I understood the design-time use of CSS.
>>>
>>> So the real need is for my HTML to reference CSS and I haven't seen
>>> yet how to do this. Is it possible?
>>>
>>> Jeff
>>>
>>> Jason Weathersby wrote:
>>>> Jeff,
>>>>
>>>> If you have the same styles defined in two css sheets and have
>>>> linked to one you can swap it out using some script. Lets assume
>>>> you have corporate.css and a personal.css style sheets in your
>>>> resource folder and you have linked to the corporate.css in you
>>>> report and applied styles to various items. You can create a
>>>> parameter and use similar code to the following to swap it out in
>>>> the beforeFactory script.
>>>>
>>>> if( params["styleparm"].value == 2 ){
>>>> sshandlelist
>>>> =reportContext.getReportRunnable().designHandle.getDesignHan dle().getAllCssStyleSheets().get(0);
>>>>
>>>> reportContext.getReportRunnable().designHandle.getDesignHand le().dropCss(sshandlelist);
>>>>
>>>> reportContext.getReportRunnable().designHandle.getDesignHand le().addCss( "personal.css");
>>>>
>>>> }
>>>>
>>>>
>>>> Jason
>>>>
>>>> Jeff Ramsdale wrote:
>>>>> I'm referencing a BIRT CSS file, per the BIRT World article--works
>>>>> great! Now my client says they want to provide a CSS file
>>>>> themselves that applies to the rendered HTML. Two questions then:
>>>>>
>>>>> 1) How can I reference a CSS file in my rendered HTML?
>>>>>
>>>>> 2) How can I parameterize the name of this CSS file prior to
>>>>> rendering?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> -jeff
Re: CSS applied to HTML at runtime [message #258722 is a reply to message #258687] Thu, 18 October 2007 13:05 Go to previous messageGo to next message
Eclipse UserFriend
Hmmm...

I'm using the ReportEngine to run and render to a file--not using tags
or the viewer or anything. Sounds like I might have a feature request on
my hands. Can you confirm before I head over to Bugzilla?

-jeff

Jason Weathersby wrote:
> Jeff,
>
> You can use the tag libs and specify anything you want in the <head>,
> but I am not certain how you will apply the style to the emitted html.
> You may be able to do with some script. You may also want to look at
> the JSP fragments that make up the viewer and the styles that are used.
>
> Jason
>
> Jeff Ramsdale wrote:
>> What I need to do is import a CSS file in the HTML. And I would do
>> that from the <head> tag, so I don't think a Text control will help.
>> The name of the CSS file could be hard-coded but preferably would be
>> passed in somehow.
>>
>> The client should be able to write whatever CSS they want for the
>> outputted report. They have no visibility to the BIRT design file and
>> don't care about it, so the point at which they can modify the look of
>> the report is through CSS that applies to the HTML.
>>
>> -jeff
Re: CSS applied to HTML at runtime [message #258763 is a reply to message #258722] Thu, 18 October 2007 16:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Jeff,

I would probably see this as an enhancement request as well.
Can you explain a little more on how you would like it to work?

Jason

Jeff Ramsdale wrote:
> Hmmm...
>
> I'm using the ReportEngine to run and render to a file--not using tags
> or the viewer or anything. Sounds like I might have a feature request on
> my hands. Can you confirm before I head over to Bugzilla?
>
> -jeff
>
> Jason Weathersby wrote:
>> Jeff,
>>
>> You can use the tag libs and specify anything you want in the <head>,
>> but I am not certain how you will apply the style to the emitted html.
>> You may be able to do with some script. You may also want to look at
>> the JSP fragments that make up the viewer and the styles that are used.
>>
>> Jason
>>
>> Jeff Ramsdale wrote:
>>> What I need to do is import a CSS file in the HTML. And I would do
>>> that from the <head> tag, so I don't think a Text control will help.
>>> The name of the CSS file could be hard-coded but preferably would be
>>> passed in somehow.
>>>
>>> The client should be able to write whatever CSS they want for the
>>> outputted report. They have no visibility to the BIRT design file and
>>> don't care about it, so the point at which they can modify the look
>>> of the report is through CSS that applies to the HTML.
>>>
>>> -jeff
Re: CSS applied to HTML at runtime [message #259524 is a reply to message #258763] Thu, 25 October 2007 13:10 Go to previous messageGo to next message
Eclipse UserFriend
Hi Jason,

Sorry--it slipped my mind that you'd asked for a response here...

So I'm producing HTML reports--table-based with text, no charts. In my
application I'm also generating some reports via XSLT, so BIRT isn't
involved. The customer would like to provide their own CSS for the XSLT
reports and want the same CSS to apply to the BIRT reports in order to
maintain a common style for all their reports--the user has no idea
which reports are generated from XSLT and which are from BIRT.

Since BIRT generates the HTML itself I have no way (that I know of) to
ensure that an external CSS file is imported by the resulting HTML file.
This enhancement would provide the ability import a designated CSS file
in the outputted HTML. As I'm embedding the report engine I could pass
the CSS file reference in via a RenderOption or AppContext property and
the existence of this property could result in the proper import being
added to the HTML.

-jeff

Jason Weathersby wrote:
> Jeff,
>
> I would probably see this as an enhancement request as well.
> Can you explain a little more on how you would like it to work?
>
> Jason
>
> Jeff Ramsdale wrote:
>> Hmmm...
>>
>> I'm using the ReportEngine to run and render to a file--not using tags
>> or the viewer or anything. Sounds like I might have a feature request
>> on my hands. Can you confirm before I head over to Bugzilla?
>>
>> -jeff
Re: CSS applied to HTML at runtime [message #361415 is a reply to message #259524] Fri, 28 March 2008 15:05 Go to previous message
Eclipse UserFriend
Hi Jeff,
I am responding to this email very late as in BIRT 2.3 we have an
enhancement scheduled, which shoudl fulfil some of your requirements.

Check out bugzilla
https://bugs.eclipse.org/bugs/show_bug.cgi?id=216361

--Rima Kanguri

"Jeff Ramsdale" <jeff.ramsdale@gmail.com> wrote in message
news:ffqin1$nln$1@build.eclipse.org...
> Hi Jason,
>
> Sorry--it slipped my mind that you'd asked for a response here...
>
> So I'm producing HTML reports--table-based with text, no charts. In my
> application I'm also generating some reports via XSLT, so BIRT isn't
> involved. The customer would like to provide their own CSS for the XSLT
> reports and want the same CSS to apply to the BIRT reports in order to
> maintain a common style for all their reports--the user has no idea
> which reports are generated from XSLT and which are from BIRT.
>
> Since BIRT generates the HTML itself I have no way (that I know of) to
> ensure that an external CSS file is imported by the resulting HTML file.
> This enhancement would provide the ability import a designated CSS file
> in the outputted HTML. As I'm embedding the report engine I could pass
> the CSS file reference in via a RenderOption or AppContext property and
> the existence of this property could result in the proper import being
> added to the HTML.
>
> -jeff
>
> Jason Weathersby wrote:
> > Jeff,
> >
> > I would probably see this as an enhancement request as well.
> > Can you explain a little more on how you would like it to work?
> >
> > Jason
> >
> > Jeff Ramsdale wrote:
> >> Hmmm...
> >>
> >> I'm using the ReportEngine to run and render to a file--not using tags
> >> or the viewer or anything. Sounds like I might have a feature request
> >> on my hands. Can you confirm before I head over to Bugzilla?
> >>
> >> -jeff
Previous Topic:Problems with dynamic text and formating as HTML field
Next Topic:How to use additional CSS properties like border-collapse, table-layout, etc.
Goto Forum:
  


Current Time: Fri Jul 18 15:47:31 EDT 2025

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

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

Back to the top