z7g / birt-functions-lib Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/birt-functions-lib
Automatically exported from code.google.com/p/birt-functions-lib
I am using the latest eclipse version "reporting-juno" (and yes I know there is
no mention of Birt 4.2 being supported, however ...)
I have installed from
http://svn.codespot.com/a/eclipselabs.org/birt-innovent-update/2.5.2/ and are
successfully using the "CustomFunctions.BindParameters(reportContext)", but
DisplayParameters() functions fails throwing the following exception.
Caused by: java.lang.NoSuchMethodError:
org.eclipse.birt.report.engine.api.script.IReportContext.getParameterDisplayText
(Ljava/lang/String;)Ljava/lang/String;
at innovent.birt.functions.DisplayParameters.execute(DisplayParameters.java:99)
PS. THANKS FOR THE FANTASTIC UTILITY. I both provided me with the features I
required right now, and demonstrated how to go about extending BIRT.
The full exception stack is as follows:
The following items have errors:
ReportDesign (id = 1):
- There are errors evaluating script
"CustomFunctions.DisplayParameters(reportContext)":
org.eclipse.birt.report.engine.api.script.IReportContext.getParameterDisplayText
(Ljava/lang/String;)Ljava/lang/String; (Element ID:1)
birt.core.JavascriptCommonError ( 1 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: There are errors
evaluating script "CustomFunctions.DisplayParameters(reportContext)":
org.eclipse.birt.report.engine.api.script.IReportContext.getParameterDisplayText
(Ljava/lang/String;)Ljava/lang/String; (Element ID:1)
at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.addException(ScriptExecutor.java:244)
at org.eclipse.birt.report.engine.script.internal.ReportScriptExecutor.handleBeforeFactory(ReportScriptExecutor.java:122)
at org.eclipse.birt.report.engine.api.impl.EngineTask.startFactory(EngineTask.java:1915)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:100)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)
at org.eclipse.birt.report.service.ReportEngineService.runAndRenderReport(ReportEngineService.java:937)
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(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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.GeneratedMethodAccessor67.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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:755)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
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:128)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:384)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:598)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:486)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.eclipse.jetty.server.Server.handle(Server.java:350)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:900)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:954)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:851)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:606)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538)
at java.lang.Thread.run(Unknown Source)
Caused by: org.eclipse.birt.core.exception.CoreException: There are errors
evaluating script "CustomFunctions.DisplayParameters(reportContext)":
org.eclipse.birt.report.engine.api.script.IReportContext.getParameterDisplayText
(Ljava/lang/String;)Ljava/lang/String;
at org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:295)
at org.eclipse.birt.core.script.ScriptContext.evaluate(ScriptContext.java:154)
at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:781)
at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:710)
at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleScriptInternal(ScriptExecutor.java:117)
at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleScript(ScriptExecutor.java:104)
at org.eclipse.birt.report.engine.script.internal.ReportScriptExecutor.handleBeforeFactory(ReportScriptExecutor.java:114)
... 60 more
Caused by: java.lang.NoSuchMethodError:
org.eclipse.birt.report.engine.api.script.IReportContext.getParameterDisplayText
(Ljava/lang/String;)Ljava/lang/String;
at innovent.birt.functions.DisplayParameters.execute(DisplayParameters.java:99)
at org.eclipse.birt.core.script.functionservice.impl.ScriptFunction.execute(ScriptFunction.java:146)
at org.eclipse.birt.core.script.functionservice.impl.CategoryWrapper$1.call(CategoryWrapper.java:67)
at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)
at org.mozilla.javascript.gen.c111._c0(/report/method[@name="beforeFactory"]:1)
at org.mozilla.javascript.gen.c111.call(/report/method[@name="beforeFactory"])
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
at org.mozilla.javascript.gen.c111.call(/report/method[@name="beforeFactory"])
at org.mozilla.javascript.gen.c111.exec(/report/method[@name="beforeFactory"])
at org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:290)
... 66 more
Original issue reported on code.google.com by [email protected]
on 20 Sep 2012 at 3:04
If the value to be wrapped is a null value, then an error is thrown.
Original issue reported on code.google.com by [email protected]
on 3 Aug 2010 at 6:35
What steps will reproduce the problem?
1. Define a report parameter that allows multiple values. When bound to a
dataset, the default input form adds a "null" value to the list.
2. Add the report parameter to the SQL query of a dataset, e.g. "where 0=0 /*
and id in ($rpStudents ) */"
3. Explicitly select the null value in the list
What is the expected output? What do you see instead?
Expected: Successful report
Instead: Failed (or partial) report, logs show a NullPointerException
What version of the product are you using? On what operating system?
birt-functions-lib: 2.5.2.1
Birt: 3.7.1
OS: Windows 7 (but not relevant)
Please provide any additional information below.
The problem arises because, in the above case, Birt passes an array with one
element, but this element is null. The code does not check for elements of the
array being null, as shown below (line 259):
for (Object subParamObject : paramObjectArray) {
if (addParameterBinding(odaDataSetHandle,
newParamIndex, subParamObject)) {
subsb.append(sep);
......
In fact, if multiple values are selected, and the null value is included, the
exception is still thrown. This happens for normal as well as cascading
parameters that allow multi-selection.
The fix is to simply add in a null check, e.g.
for (Object subParamObject : paramObjectArray) {
if (subParamObject != null) {
if (addParameterBinding(odaDataSetHandle,
newParamIndex, subParamObject)) {
subsb.append(sep);
......
Original issue reported on code.google.com by [email protected]
on 28 Nov 2011 at 4:03
## Sorry, posted this issue also innovent main project, please kill it there.
BIRT 2.5.2 / Eclipse 3.5.2
What steps will reproduce the problem?
1. Create report with Classic Models Sample DB
2. Create following query in a data set:
select CLASSICMODELS.EMPLOYEES.EMPLOYEENUMBER,
CLASSICMODELS.EMPLOYEES.OFFICECODE,
CLASSICMODELS.EMPLOYEES.JOBTITLE
from CLASSICMODELS.EMPLOYEES
where 0 = 0
/* BIND and CLASSICMODELS.EMPLOYEES.JOBTITLE in ($multiJobtitle) */
3. Create a MultiSelect Parameter (see attached pic
(multiSelectJobTitleParam.jpg) for details)
4. Create a simple visual table component showing the cols: EMPLYEENUMBER,
OFFICECODE, JOBTITLE.
5. Switch to Script view and select the dataset recently created. Write
into beforeOpen method: CustomFunctions.BindParameters(reportContext);
6. Preview report and specify the parameter "Sales Rep" or any other
entries via dialogue.
What is the expected output? What do you see instead?
Excepted output: if the multi select parameters are processed rightly, only
selected JOBTITLE rows should be shown.
Instead: All entries are shown like the IN statement is not watched.
What version of the product are you using? On what operating system?
BIRT 2.5.2 / Eclipse 3.5.2 / WINXP SP3 / birt.functions.lib_2.5.1.1.jar
Please provide any additional information below.
In the logs, it seems the SQL code is processed right:
18.03.2010 11:36:38 innovent.birt.functions.BindParameters bindParameters
INFO: ResolveSQLParameters, translated query = select
CLASSICMODELS.EMPLOYEES.EM
PLOYEENUMBER,
CLASSICMODELS.EMPLOYEES.OFFICECODE,
CLASSICMODELS.EMPLOYEES.JOBTITLE
from CLASSICMODELS.EMPLOYEES
where 0 = 0
and CLASSICMODELS.EMPLOYEES.JOBTITLE in (?)
But I think the parameter association fails and the IN statement looses its
sense.
I hope I have not miswatched something.
Original issue reported on code.google.com by [email protected]
on 18 Mar 2010 at 10:53
Attachments:
styleHdl needs to be checked for null in setSeriesFont.
Original issue reported on code.google.com by [email protected]
on 18 Jan 2011 at 4:22
The TextWrap function is wrapping the text only if it has spaces in the word.
E.g. test test test test test
If my word has no spaces, the TextWrap function is simply truncating the data.
E.g. testtesttesttest
Is this the expected behavior of the function or a bug?
Original issue reported on code.google.com by [email protected]
on 5 Aug 2010 at 1:23
No steps, this is an enhancement gathered from a client site for those who
are not comfortable with Javascript syntax coming from another development
environment, or not programmers at all.
Original issue reported on code.google.com by [email protected]
on 21 May 2010 at 11:58
If you use TextWrap as documented passing a String it works.
CustomFunctions.TextWrap(dataSetRow["comments"], "15");
But if you pass the value as a number it gets cast to a Float and then fails:
CustomFunctions.TextWrap(dataSetRow["comments"], 15);
FAILS
Original issue reported on code.google.com by [email protected]
on 3 Aug 2010 at 6:34
Trying to append a library item causes a problem in 2.5.2.
Need to use elementFactory to create a new element to add.
Original issue reported on code.google.com by [email protected]
on 21 May 2010 at 9:17
What steps will reproduce the problem?
1. Create a report from classic Models table payments with date field
2. Add the following statement in data set
select CLASSICMODELS.PAYMENTS.CUSTOMERNUMBER,
CLASSICMODELS.PAYMENTS.CHECKNUMBER,
CLASSICMODELS.PAYMENTS.PAYMENTDATE,
CLASSICMODELS.PAYMENTS.AMOUNT
from CLASSICMODELS.PAYMENTS
WHERE 0=0
/* BIND AND CLASSICMODELS.PAYMENTS.PAYMENTDATE >= $payment_date */
3. Create a table from data set
4. create report parameter of type date
5. Run in preview and input date value say 05/15/2005
What is the expected output? What do you see instead?
The expected result would be to execute the query with date condition, but
it throws exception. see attached error.png
What version of the product are you using? On what operating system?
Birt 2.3.2, birt function lib 2.3.2, Windows XP
Please provide any additional information below.
Attached report design file to reproduce the issue.
Original issue reported on code.google.com by [email protected]
on 15 May 2010 at 1:14
Attachments:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.