Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Trying to add an image programmatically
Trying to add an image programmatically [message #59471] Mon, 18 July 2005 14:12 Go to next message
Nathan McKeown is currently offline Nathan McKeownFriend
Messages: 27
Registered: July 2009
Junior Member
Hi,

I am trying to add an image to my report using the example from the BIRT
Deployment page as a reference. Unfortunately I seem to be running into
problems when trying to generate an html report from this. The image is
displayed in the report (provided I view it with IE, not Firefox)
however it shows errors at the bottom of the report:

There are errors on the report page:
+ There are error(s) in Image:null

Error0 : Failed to evaluate C:\Pictures\ifchudran3.jpg(1 time)
detail: Failed to evaluate C:\Pictures\ifchudran3.jpg
illegal character (#1)

This is the code I have to add the image to my report design:

cell.getContent( ).add( image );
image.setSize(DesignChoiceConstants.IMAGE_SIZE_SCALE_TO_ITEM );
image.setImageName(imagePath);
image.setSource(DesignChoiceConstants.IMAGE_REF_TYPE_FILE);
image.setHeight("220px");
image.setWidth("190px");
image.setURI(imagePath);

However, this code seems to through the following output to the console:

18-Jul-2005 15:04:17
org.eclipse.birt.report.engine.executor.ExecutionContext evaluate
SEVERE: illegal character (<inline>#1)
org.mozilla.javascript.EvaluatorException: illegal character (<inline>#1)
at
org.mozilla.javascript.DefaultErrorReporter.runtimeError(Def aultErrorReporter.java:95)
at
org.mozilla.javascript.DefaultErrorReporter.error(DefaultErr orReporter.java:82)
at org.mozilla.javascript.Parser.addError(Parser.java:120)
at org.mozilla.javascript.TokenStream.getToken(TokenStream.java :801)
at org.mozilla.javascript.Parser.peekToken(Parser.java:138)
at org.mozilla.javascript.Parser.statementHelper(Parser.java:65 0)
at org.mozilla.javascript.Parser.statementHelper(Parser.java:11 34)
at org.mozilla.javascript.Parser.statement(Parser.java:616)
at org.mozilla.javascript.Parser.parse(Parser.java:347)
at org.mozilla.javascript.Parser.parse(Parser.java:287)
at org.mozilla.javascript.Context.compileImpl(Context.java:2349 )
at org.mozilla.javascript.Context.compileString(Context.java:13 72)
at org.mozilla.javascript.Context.compileString(Context.java:13 61)
at org.mozilla.javascript.Context.evaluateString(Context.java:1 217)
at org.eclipse.birt.core.script.ScriptContext.eval(ScriptContex t.java:196)
at org.eclipse.birt.core.script.ScriptContext.eval(ScriptContex t.java:187)
at
org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:262)
at
org.eclipse.birt.report.engine.data.dte.DteDataEngine.evalua te(DteDataEngine.java:332)
at
org.eclipse.birt.report.engine.executor.ExecutionContext.eva luate(ExecutionContext.java:327)
at
org.eclipse.birt.report.engine.executor.ImageItemExecutor.ex ecute(ImageItemExecutor.java:111)
at
org.eclipse.birt.report.engine.executor.ReportExecutorVisito r.visitImageItem(ReportExecutorVisitor.java:378)
at
org.eclipse.birt.report.engine.ir.ImageItemDesign.accept(Ima geItemDesign.java:91)
at
org.eclipse.birt.report.engine.executor.GridItemExecutor.exe cute(GridItemExecutor.java:131)
at
org.eclipse.birt.report.engine.executor.ReportExecutorVisito r.visitGridItem(ReportExecutorVisitor.java:342)
at
org.eclipse.birt.report.engine.ir.GridItemDesign.accept(Grid ItemDesign.java:117)
at
org.eclipse.birt.report.engine.executor.ReportExecutor.execu te(ReportExecutor.java:163)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:152)
at
com.scapatech.reporting.data.statcon.ExecuteReport.runReport (ExecuteReport.java:108)
at
com.scapatech.reporting.data.statcon.BuildReport.createRepor t(BuildReport.java:134)
at
com.scapatech.reporting.statistical.StatconSegmentation$Birt ReportRunAction.run(StatconSegmentation.java:343)
at
org.eclipse.hyades.statistical.ui.editor.internal.Statistica lModelGraphViewer$BasicAction.widgetSelected(StatisticalMode lGraphViewer.java:3919)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:89)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :82)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:2773)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2432)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1377)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:254)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:141)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:96)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:335)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:273)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
at org.eclipse.core.launcher.Main.run(Main.java:704)
at org.eclipse.core.launcher.Main.main(Main.java:688)
line 1 column 1 - Warning: inserting missing 'title' element
line 3 column 21 - Error: <inline> is not recognized!
line 3 column 21 - Warning: discarding unexpected <inline>
This document has errors that must be fixed before
using HTML Tidy to generate a tidied up version.
Re: Trying to add an image programmatically [message #1720805 is a reply to message #59471] Thu, 21 January 2016 07:49 Go to previous message
Waseem Farooqui is currently offline Waseem FarooquiFriend
Messages: 1
Registered: January 2016
Junior Member
Its because of the path you are specifying to display. `C:\Pictures\ifchudran3.jpg`
This is not a URI or URL and you are using.
image.setURL( path );
you should use image.setFile(path_to_system_file);
If you want to use setURL or setURI you have to also specift that I am taking the image from the web server.
Previous Topic:Custom ODA DataSet getting ResultSet columns by name not position
Next Topic:Execution time problem
Goto Forum:
  


Current Time: Fri Apr 26 09:24:15 GMT 2024

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

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

Back to the top