| Custom CSS classes for links [message #363005] |
Wed, 04 June 2008 16:30  |
Eclipse User |
|
|
|
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 #363085 is a reply to message #363081] |
Mon, 09 June 2008 16:48  |
Eclipse User |
|
|
|
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?
>
|
|
|
Powered by
FUDForum. Page generated in 0.05657 seconds