Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Switch Stylesheet depending on output
Ingo
Hi.
Is it possible to use different style sheets depending on the output format. So for example I want to use a bigger font size when displaying the report via the webviewer than when printing the report to pdf.
Thanks,
Ingo
Find more posts tagged with
Comments
mwilliams
Hi Ingo,
You should be able to grab the output format with:
reportContext.getOutputFormat()
Then, you should be able to change style sheets. If not, you can change individual styles based on this check.
Hope this helps.
Ingo
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="71892" data-time="1294177228" data-date="04 January 2011 - 02:40 PM"><p>
You should be able to grab the output format with:<br />
<br />
reportContext.getOutputFormat()<br /></p></blockquote>
<br />
Hi.<br />
<br />
Thanks. Yeah, I already thought of something like that. The question is when/ where I should switch the css file and even more how to do that. How can I access and exchange the css file reference?<br />
<br />
Or would you suggest a whole different approach for formating the report. When I print the reports to a pdf in my opinion a font-size of 9-10px is enough (for mostly all elements, even charts) but when viewing them via the webviewer a font-size of 12px is much more convinient. How can I set a master font-size? When I set the report font-size not all elements will be affected by this. For example chart titles till use a default font-size of 14. I would like to define for example 2px more than the master size...<br />
<br />
Thanks,<br />
Ingo
mwilliams
Ingo,
Take a look at this devShare post regarding dynamically choosing a CSS file. Maybe it'll help.
Ingo
A great. I wasn't aware of that. That should be sufficent...
Thanks for your help.
Kind regards,
Ingo
mwilliams
As always, not a problem!
Ingo
Hi Michael.<br />
<br />
I finally found some time for testing your solution. In general it works. Great. But I'm still facing some problems...hope you can help ...<br />
<br />
As already discribed before, I have default stylesheet associated with all my reports called black-and-white.css. Before loading the new one which is optimized for printing (black-and-white-print.css) and want to remove the old one. I simply tried to find the included css via findCssStyleSheetHandleByFileName or findIncludedCssStyleSheetHandleByFileName which both returned a handle, but dropping this handle failed with file not found. So I tried to iterate over all stylesheets and drop these. This worked but the styles are still there. In the next step I iterated over all styles of the stylesheet to drop them individually but unfortunatly this did not work either... <br />
<br />
Here are my attempts so far:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
importPackage( Packages.java.io );
importPackage ( Packages.java.util );
importPackage ( Packages.org.eclipse.birt.report.model.api.activity);
pW = new java.io.PrintWriter( new java.io.FileOutputStream( "C:\\mylog.log" ) );
dh = reportContext.getDesignHandle();
styles = dh.getAllStyles();
pW.println("Number of styles: "+styles.size());
var listSheets = dh.getAllCssStyleSheets()
pW.println("Number of stylessheets: "+listSheets.size());
pW.println("StyleSheetRef-0:"+listSheets.get(0));
pW.println("Filename:"+listSheets.get(0).getFileName());
var stylesIterator = listSheets.get(0).getStyleIterator();
while ( stylesIterator.hasNext() ){
var style = stylesIterator.next();
pW.println("Dropping Style:"+style.getName());
//style.drop(); // fails
}
try{
dh.dropCss(listSheets.get(0));
pW.println("Dropped stylesheet");
}
catch(err){
pW.println("Error: " + err);
}
listSheets = dh.getAllCssStyleSheets()
pW.println("Number of stylessheets: "+listSheets.size());
styles = dh.getAllStyles();
pW.println("Number of styles: "+styles.size());
pW.close();
</pre>
<br />
and the corresponding log:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
Number of styles: 31
Number of stylessheets: 1
StyleSheetRef-0:org.eclipse.birt.report.model.api.css.CssStyleSheetHandle@a802d2
Filename:black-and-white.css
Dropping Style:masterpage-header
Dropping Style:masterpage-footer
Dropping Style:report-header
Dropping Style:info-text
Dropping Style:subtitle
Dropping Style:vertical-spacer
Dropping Style:not-available-note
Dropping Style:ReportInfoLabel
Dropping Style:ReportInfo
Dropping Style:ReportInfoNotes
Dropping Style:report
Dropping Style:chart
Dropping Style:chart-title
Dropping Style:chart-legend
Dropping Style:chart-value
Dropping Style:chart-axis
Dropping Style:ChartSpacer
Dropping Style:table
Dropping Style:table-group-header-1
Dropping Style:table-group-header-2
Dropping Style:table-header
Dropping Style:table-header-cell
Dropping Style:table-detail-cell
Dropping Style:table-detail
Dropping Style:table-footer
Dropping Style:nowrap
Dropping Style:thin-full-border-black
Dropping Style:text-red-highlight
Dropping Style:text-orange-highlight
Dropped stylesheet
Number of stylessheets: 0
Number of styles: 31
</pre>
<br />
So my question is: How can I get rid of all information provided by some stylesheet?<br />
<br />
Thanks,<br />
Ingo
mwilliams
So, your new style sheet that you add doesn't replace the styles that remain?
Ingo
Ah okay. They will all be overwritten...that should do it. Right! So, there isn't even a reason to remove the "old" stylesheet since its styles are kept anyway, right?
Thanks again for your great support.
But anyway, since I already have the style handle, how can it be removed? (just curious ;-) )
mwilliams
Try something like:
reportContext.getDesignHandle().findStyle("table-detail").drop();
You'll just have to grab the style name as you currently do and use it in the function above.
Let me know.
Ingo
Hi. I tried <br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>dh.findStyle(style.getName()).drop();</pre>
<br />
in the while loop but I get the following error:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>JavaException: org.eclipse.birt.report.model.api.command.ContentException: The Report Design has no slot (id:cssStyleSheets) defined.</pre>
mwilliams
Is that the entire error? It doesn't seem to be talking about the code I gave you, but it is kinda vague, so it's hard to tell. Let me know if there's more to the error stack.
Ingo
Sorry, I wasn't aware of how to actually get the StackTrace from the err since simply calling printStackTrace did not work...<br />
<br />
Here is my current "try":<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>pW = new java.io.PrintWriter( new java.io.FileOutputStream( "C:\\mylog.log" ) );
dh = reportContext.getDesignHandle();
styles = dh.getAllStyles();
pW.println("Number of styles: "+styles.size());
var listSheets = dh.getAllCssStyleSheets()
pW.println("Number of stylessheets: "+listSheets.size());
pW.println("StyleSheetRef-0:"+listSheets.get(0));
pW.println("Filename:"+listSheets.get(0).getFileName());
try{
var stylesIterator = listSheets.get(0).getStyleIterator();
while ( stylesIterator.hasNext() ){
var style = stylesIterator.next();
pW.println("Dropping Style:"+style.getName());
dh.findStyle(style.getName()).drop();
}
dh.dropCss(listSheets.get(0));
pW.println("Dropped stylesheet");
}
catch(err){
pW.println("An error occurred: " + err);
err.javaException.printStackTrace(pW);
}
listSheets = dh.getAllCssStyleSheets()
pW.println("Number of stylessheets: "+listSheets.size());
styles = dh.getAllStyles();
pW.println("Number of styles: "+styles.size());
pW.close();</pre>
<br />
<br />
and the corresponding output/ stacktrace<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
Dropping Style:highlight-orange
An error occurred: JavaException: org.eclipse.birt.report.model.api.command.ContentException: The Report Design has no slot (id:cssStyleSheets) defined.
org.eclipse.birt.report.model.api.command.ContentException: The Report Design has no slot (id:cssStyleSheets) defined.
at org.eclipse.birt.report.model.util.ContentExceptionFactory.createContentException(ContentExceptionFactory.java:59)
at org.eclipse.birt.report.model.command.AbstractContentCommand.checkBeforeRemove(AbstractContentCommand.java:336)
at org.eclipse.birt.report.model.command.ContentCommand.checkBeforeRemove(ContentCommand.java:288)
at org.eclipse.birt.report.model.command.AbstractContentCommand.remove(AbstractContentCommand.java:311)
at org.eclipse.birt.report.model.api.DesignElementHandle.drop(DesignElementHandle.java:1369)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:247)
at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:119)
at org.mozilla.javascript.gen.c63._c0(/report/method[
@name="
;initialize"]:23)
at org.mozilla.javascript.gen.c63.call(/report/method[
@name="
;initialize"])
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
at org.mozilla.javascript.gen.c63.call(/report/method[
@name="
;initialize"])
at org.mozilla.javascript.gen.c63.exec(/report/method[
@name="
;initialize"])
at org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:282)
at org.eclipse.birt.core.script.ScriptContext.evaluate(ScriptContext.java:154)
at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:740)
at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:669)
at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleScriptInternal(ScriptExecutor.java:61)
at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleScript(ScriptExecutor.java:48)
at org.eclipse.birt.report.engine.script.internal.ReportScriptExecutor.handleInitialize(ReportScriptExecutor.java:44)
at org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesign(EngineTask.java:1722)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:98)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)
at org.eclipse.birt.report.service.ReportEngineService.runAndRenderReport(ReportEngineService.java:920)
at org.eclipse.birt.report.service.BirtViewerReportService.runAndRenderReport(BirtViewerReportService.java:973)
at org.eclipse.birt.report.service.actionhandler.BirtGetPageAllActionHandler.__execute(BirtGetPageAllActionHandler.java:131)
at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:90)
at org.eclipse.birt.report.soapengine.processor.AbstractBaseDocumentProcessor.__executeAction(AbstractBaseDocumentProcessor.java:47)
at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.executeAction(AbstractBaseComponentProcessor.java:143)
at org.eclipse.birt.report.soapengine.processor.BirtDocumentProcessor.handleGetPageAll(BirtDocumentProcessor.java:183)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.process(AbstractBaseComponentProcessor.java:112)
at org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingImpl.getUpdatedObjects(BirtSoapBindingImpl.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)
at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)
at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:126)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:318)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
</pre>
<br />
<br />
hope this helps.<br />
<br />
Thanks.
mwilliams
Comment out the iterator and try putting a specific style in rather than style.getName() and see what happens, make sure the code works to remove the individual style.
Ingo
Hi.
I've tried it but no difference. Same exception as before.
mwilliams
If you didn't do this already, comment out all of your code used to remove the styles and stylesheets and use this code to just remove a particular style that you know exists. I was given this removal snippet by a colleague to have you try and would like to determine that it's definitely the issue.
Ingo
It is exactly the same...attached you can find the report and the css.<br />
<br />
And the corresponding exception:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
Style found: org.eclipse.birt.report.model.api.CssSharedStyleHandle@1375701
An error occurred: JavaException: org.eclipse.birt.report.model.api.command.ContentException: The Report Design has no slot (id:cssStyleSheets) defined.
org.eclipse.birt.report.model.api.command.ContentException: The Report Design has no slot (id:cssStyleSheets) defined.
at org.eclipse.birt.report.model.util.ContentExceptionFactory.createContentException(ContentExceptionFactory.java:59)
at org.eclipse.birt.report.model.command.AbstractContentCommand.checkBeforeRemove(AbstractContentCommand.java:336)
at org.eclipse.birt.report.model.command.ContentCommand.checkBeforeRemove(ContentCommand.java:288)
at org.eclipse.birt.report.model.command.AbstractContentCommand.remove(AbstractContentCommand.java:311)
at org.eclipse.birt.report.model.api.DesignElementHandle.drop(DesignElementHandle.java:1369)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:247)
at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:119)
at org.mozilla.javascript.gen.c4._c0(/report/method[
@name="
;initialize"]:15)
at org.mozilla.javascript.gen.c4.call(/report/method[
@name="
;initialize"])
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
at org.mozilla.javascript.gen.c4.call(/report/method[
@name="
;initialize"])
at org.mozilla.javascript.gen.c4.exec(/report/method[
@name="
;initialize"])
at org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:282)
at org.eclipse.birt.core.script.ScriptContext.evaluate(ScriptContext.java:154)
at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:740)
at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:669)
at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleScriptInternal(ScriptExecutor.java:61)
at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleScript(ScriptExecutor.java:48)
at org.eclipse.birt.report.engine.script.internal.ReportScriptExecutor.handleInitialize(ReportScriptExecutor.java:44)
at org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesign(EngineTask.java:1722)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:98)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)
at org.eclipse.birt.report.service.ReportEngineService.runAndRenderReport(ReportEngineService.java:920)
at org.eclipse.birt.report.service.BirtViewerReportService.runAndRenderReport(BirtViewerReportService.java:973)
at org.eclipse.birt.report.service.actionhandler.BirtGetPageAllActionHandler.__execute(BirtGetPageAllActionHandler.java:131)
at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:90)
at org.eclipse.birt.report.soapengine.processor.AbstractBaseDocumentProcessor.__executeAction(AbstractBaseDocumentProcessor.java:47)
at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.executeAction(AbstractBaseComponentProcessor.java:143)
at org.eclipse.birt.report.soapengine.processor.BirtDocumentProcessor.handleGetPageAll(BirtDocumentProcessor.java:183)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.process(AbstractBaseComponentProcessor.java:112)
at org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingImpl.getUpdatedObjects(BirtSoapBindingImpl.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)
at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)
at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:126)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:318)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
</pre>
mwilliams
Is the attached report one that I can run? Or does it use your database that I don't have access to?
Ingo
there is only one label in the report. No datasource, no dataset ... thus you should be able to run it out of the box.
mwilliams
I checked the canDrop() value on the style handle and got "false" returned. I will try to look into this more. Worst case, we have a bug to log. I'll let you know.
mwilliams
The style isn't an individual style added to the report, that's why we're having an issue dropping the style individually. You just need to drop the style sheet like we had done before and then set the style of the elements in your report to "" with something like the following statement:
reportContext.getDesignHandle().findElement("mylabel").setStyleName("");
See if that gets rid of the style that you're seeing not go away. Let me know.
Ingo
Hi.
Okay, so maybe I should define styles in the report directly in the future...anyway, the solution you suggested worked fine although it is a bit annoying to iterate over many elements to remove the style from the report...but I can live with that.
Thanks,
Ingo