Skip to main content



      Home
Home » Archived » BIRT » Custom CSS classes for links
Custom CSS classes for links [message #363005] Wed, 04 June 2008 16:30 Go to next message
Eclipse UserFriend
Hi,

I'm trying to change the style of links in my generated BIRT report using
custom classes and tags such as a:visited and a:hover. I came across
defect 218182 (which asks for exactly what I need) which is closed as
WONTFIX because apparently there is support for this already implemented.
Can someone point me towards some material that described how to do this?
Or, provide brief steps in a post?

Thanks
Re: Custom CSS classes for links [message #363020 is a reply to message #363005] Thu, 05 June 2008 13:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Paul,

If you are using the viewer, in the webcontent folder of the viewer
plugin you can change the style.css to modify the hyperlink styling.
For example
Add theses two lines above the .BirtViewer_Body class.


A:link {color: #FF0000; text-decoration: none}
A:visited {color: #00FF00; text-decoration: none}
..BirtViewer_Body
{
margin:0px;
}

Jason


Paul wrote:
> Hi,
>
> I'm trying to change the style of links in my generated BIRT report
> using custom classes and tags such as a:visited and a:hover. I came
> across defect 218182 (which asks for exactly what I need) which is
> closed as WONTFIX because apparently there is support for this already
> implemented. Can someone point me towards some material that described
> how to do this? Or, provide brief steps in a post?
>
> Thanks
>
>
Re: Custom CSS classes for links [message #363027 is a reply to message #363020] Thu, 05 June 2008 18:35 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

There is another enhancement in bugzilla
https://bugs.eclipse.org/bugs/show_bug.cgi?id=216361

- The UI mockups attached to the bug describes the steps to use this
feature.
- As part of this change we allow user to define styles in external CSS
and apply at view time. The styles are not converted to BIRT styles,
hence all the CSS styles are supported.
Note: This is only supported for HTML output

- This feature is available in BIRT 2.3 RC2

--Rima
Re: Custom CSS classes for links [message #363081 is a reply to message #363020] Mon, 09 June 2008 14:57 Go to previous messageGo to next message
Eclipse UserFriend
Hi Jason,

I'm not using the viewer. We're using BIRT generate HTML reports. Is it
possible to specify this in the editor?
Re: Custom CSS classes for links [message #363082 is a reply to message #363027] Mon, 09 June 2008 15:04 Go to previous messageGo to next message
Eclipse UserFriend
I take it there is no work around for BIRT 2.2.2? Moving up to BIRT 2.3
right now is not an option
Re: Custom CSS classes for links [message #363085 is a reply to message #363081] Mon, 09 June 2008 16:48 Go to previous message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Paul,

If you are using the API, one possible solution is to set the embedded
flag to true and add your psuedo style to the output. Here is a very
crude example.:

public void runReport() throws EngineException
{

IReportEngine engine=null;
EngineConfig config = null;

try{

config = new EngineConfig( );

config.setBIRTHome(" C:\\birt\\birt-runtime-2_2_1\\birt-runtime-2_2_1\\ReportEngi ne ");
config.setLogConfig("c:/temp/test", Level.FINEST);
Platform.startup( config );
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine = factory.createReportEngine( config );
}catch( Exception ex){
ex.printStackTrace();
}

IReportRunnable design = null;
//Open the report design
design = engine.openReportDesign("Reports/customers.rptdesign");



//Create task to run and render the report,
IRunAndRenderTask task = engine.createRunAndRenderTask(design);


HTMLRenderOption options = new HTMLRenderOption();
FileOutputStream fso=null;
try{
String pca = "<Style> a:link {color: #FF0000} a:visited {color:
#00FF00} </style>\r\n";
fso = new FileOutputStream(new File("c:/test/testpsuedo.html"), true);
fso.write(pca.getBytes());
}catch (Exception e){
e.printStackTrace();
}
options.setOutputStream(fso);
options.setEmbeddable(true);
options.setOutputFormat("html");
options.setImageDirectory("images");


task.setRenderOption(options);
task.run();

task.close();

try{
fso.flush();
fso.close();
}catch(Exception e){
e.printStackTrace();
}

engine.destroy();
Platform.shutdown();
System.out.println("Finished");
}

Jason

Paul wrote:
> Hi Jason,
>
> I'm not using the viewer. We're using BIRT generate HTML reports. Is it
> possible to specify this in the editor?
>
Previous Topic:design guideline
Next Topic:How to prevent SQL injection?
Goto Forum:
  


Current Time: Sun Nov 09 17:49:33 EST 2025

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

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

Back to the top