Hello List,
I try to use the
ERJasperReport framework in a small WebObjects Application.
In contrast to the example provided by Kieran, which uses Ajax, my App runs as classical WO app.
Steps I have done.
-
I created a fetch spec in the
EOModell and checked the results in a “normal” WO Page with a display group and table -> works fine -> fetch spec is OK ;)
-
I created a simple (test) report which should show the same data as shown in the normal
WOPage
-
I created a
WOLongResponsePage and implemented the _task and _future pieces similar to the
CCAjaxLongResponsePage from the Example
Running the Report leads to a PDF-File of 0 KB :-(((
So I added the
ERJasperReports sources to my Eclipse project to nail down the potentially issue.
During some debug sessions yesterday I found… Nothing :-(((
-
Every part gets created correctly
-
No Exceptions were thrown
-
All debug logs (of
ERJasperReport and JasperReport itself) are looking OK
So my hope are now you guys :-)) Maybe I have missed something in the implementation…
That’s my implementation of the long response page
public
class
CreateReportPage extends
WOLongResponsePage {
// UI Status message
public String
statusMessage;
private
Callable _task;
private
ERXFutureTask<Callable> _future;
private
String statusStr;
public
CreateReportPage(WOContext context) {
super(context);
setRefreshInterval( 5);
// Reload page every five seconds
statusStr
= "Creating report PDF";
statusMessage
= statusStr;
// Initial status message
}
public String
finishedPercentage() {
String result = "0%";
if(null
!= _future)
{
Double percentComplete = _future.percentComplete();
if (percentComplete
!= null)
{
long
userPercentComplete = Math.round(percentComplete.doubleValue() * 100.0d);
if (userPercentComplete
< 1) {
userPercentComplete = 1;
}
if (userPercentComplete
> 100) {
userPercentComplete = 100;
}
result = userPercentComplete + "%";
}// if
}// if
return result;
}
/**
* Overridden to give some feedback that progress is being made.
*/
public
void
appendToResponse(
WOResponse aResponse,
WOContext aContext)
{
statusMessage
= statusStr
+ "..." +
this.finishedPercentage()
+ " complete";
super.appendToResponse(aResponse,
aContext);
}
public Object
performAction()
{
if
(null ==
_task)
{
com.cgi.cgiPitma.Session
ses = (com.cgi.cgiPitma.Session)session();
String
userName = ses.selReportUser();
EOFetchSpecification
fetchSpec = EOFetchSpecification.fetchSpecificationNamed("JasperRepFS",
P_User_KBF_Antw.ENTITY_NAME);
NSMutableDictionary<String, Object> bindings =
new
NSMutableDictionary<String, Object>();
bindings.takeValueForKey(userName,
"userName");
fetchSpec =
fetchSpec.fetchSpecificationWithQualifierBindings(bindings);
_task
= new
ERJRFetchSpecificationReportTask(fetchSpec,
"Auswertung2.jasper");
_future
= new
ERXFutureTask<Callable>(_task);
// This is where we hand off the task to our executor service to run
// it in a background thread
ERXExecutorService.executorService().execute(_future);
}// if
return
null;
}
}
And that’s the Debug log I get when running the report. The percent complete is
allways 10%...
Apr 10 09:22:54
cgiPitma[53183] DEBUG NSLog
- Waiting for requests...
Apr 10 09:23:26
cgiPitma[53183] WARN
er.extensions.eof.ERXModelGroup
- Clearing previous class descriptions
Apr 10 09:23:26
cgiPitma[53183] WARN
er.extensions.eof.ERXModelGroup
- The EOModel 'erprototypes' has an empty connection dictionary.
Apr 10 09:23:26
cgiPitma[53183] WARN
er.extensions.eof.ERXModelGroup
- The EOModel 'erprototypes' has an empty connection dictionary.
Apr 10 09:23:28
cgiPitma[53183] DEBUG NSLog
- Using JDBCPlugIn 'PostgresqlPlugIn' for JDBCAdaptor@1196438616
Apr 10 09:23:28
cgiPitma[53183] DEBUG NSLog
- Using JDBCPlugIn 'PostgresqlPlugIn' for JDBCAdaptor@2017995693
Apr 10 09:23:28
cgiPitma[53183] DEBUG NSLog
- connecting with dictionary: {plugin = "PostgresqlPlugIn"; username = "cgiPitma"; driver = "org.postgresql.Driver"; password =
"<password deleted for log>"; URL = "" class="SpellE">jdbc:postgresql://localhost:5432/cgiPitma"; }
Apr 10 09:23:29
cgiPitma[53183] DEBUG NSLog
- fetching JDBC Info with JDBCContext@1378384728
Apr 10 09:23:29
cgiPitma[53183] DEBUG NSLog
- connecting with dictionary: {plugin = "PostgresqlPlugIn"; username = "cgiPitma"; driver = "org.postgresql.Driver"; password =
"<password deleted for log>"; URL = "" class="SpellE">jdbc:postgresql://localhost:5432/cgiPitma"; }
Apr 10 09:23:30
cgiPitma[53183] DEBUG NSLog
- === Begin Internal Transaction
Apr 10 09:23:30
cgiPitma[53183] DEBUG NSLog
- evaluateExpression: <com.webobjects.jdbcadaptor.PostgresqlExpression: "SELECT t0.id, t0.name FROM
P_User t0" withBindings: >
Apr 10 09:23:31
cgiPitma[53183] DEBUG NSLog
- 1 row(s) processed
Apr 10 09:23:31
cgiPitma[53183] DEBUG NSLog
- === Commit Internal Transaction
Apr 10 09:23:52
cgiPitma[53183] DEBUG jasperreports.ERJRFetchSpecificationReportTask
- Starting JasperReportTask: jasperreports.ERJRFetchSpecificationReportTask@2d0c94a7
Apr 10 09:23:52
cgiPitma[53183] DEBUG NSLog
- === Begin Internal Transaction
Apr 10 09:23:52
cgiPitma[53183] DEBUG NSLog
- evaluateExpression: <com.webobjects.jdbcadaptor.PostgresqlExpression: "SELECT t0.antwWert, t0.antwort, t0.comment, t0.id, t0.p_Kreis_Block_FrageID, t0.p_UserID
FROM P_User_KBF_Antw t0 INNER JOIN
P_Kreis_Block_Frage T2 ON t0.p_Kreis_Block_FrageID = T2.id INNER JOIN
P_User T1 ON t0.p_UserID = T1.id INNER JOIN P_Frage T5 ON T2.p_FrageID = T5.id INNER JOIN
P_Themenblock T4 ON T2.p_ThemenblockID = T4.id INNER JOIN
P_Themenkreis T3 ON T2.p_ThemenkreisID = T3.id WHERE T1.name = ?::varchar(50) ORDER BY T3.name ASC, T4.name ASC, T5.frageID ASC"
withBindings: 1:"testDPa"(name)>
Apr 10 09:23:53
cgiPitma[53183] DEBUG NSLog
- 60 row(s) processed
Apr 10 09:23:53
cgiPitma[53183] DEBUG NSLog
- === Commit Internal Transaction
Apr 10 09:23:56
cgiPitma[53183] DEBUG jasperreports.ERJRUtilities
- InputFileName :
Apr 10 09:23:56
cgiPitma[53183] DEBUG jasperreports.ERJRUtilities
- /D:/Projekte/Eclipse/Workspace/cgiPitma/build/cgiPitma.woa/Contents/Resources/Auswertung2.jasper
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.ExtensionsEnvironment
- Instantiating extensions registry class net.sf.jasperreports.extensions.DefaultExtensionsRegistry
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Loading registries for cache key er.extensions.appserver.ERXApplication$AppClassLoader@a383118
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.engine.util.JRLoader
- Found resource jasperreports_extension.properties at jar:file:/D:/Projekte/wonder/Frameworks/Reporting/ERJasperReports/Libraries/jasperreports-4.7.0.jar!/jasperreports_extension.properties in
classloader sun.misc.Launcher$AppClassLoader@6d6f0472
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.engine.util.JRLoader
- Found resource jasperreports_extension.properties at jar:file:/D:/Projekte/wonder/Frameworks/Reporting/ERJasperReports/Libraries/jasperreports-fonts-4.7.0.jar!/jasperreports_extension.properties in
classloader sun.misc.Launcher$AppClassLoader@6d6f0472
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.engine.util.JRLoader
- Found resource jasperreports_extension.properties at jar:file:/D:/Projekte/wonder/Frameworks/Reporting/ERJasperReports/Libraries/jasperreports-javaflow-4.7.0.jar!/jasperreports_extension.properties in
classloader sun.misc.Launcher$AppClassLoader@6d6f0472
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Loading JasperReports extension properties resource jar:file:/D:/Projekte/wonder/Frameworks/Reporting/ERJasperReports/Libraries/jasperreports-4.7.0.jar!/jasperreports_extension.properties
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating registry of type net.sf.jasperreports.governors.GovernorExtensionsRegistryFactory for property
net.sf.jasperreports.extension.registry.factory.governor
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating extensions registry for governor using factory class net.sf.jasperreports.governors.GovernorExtensionsRegistryFactory
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating registry of type net.sf.jasperreports.components.headertoolbar.HeaderToolbarParameterContributorExtensionFactory for property
net.sf.jasperreports.extension.registry.factory.headertoolbar
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating extensions registry for headertoolbar using factory class net.sf.jasperreports.components.headertoolbar.HeaderToolbarParameterContributorExtensionFactory
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating registry of type net.sf.jasperreports.data.DefaultDataAdapterServiceExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.data.adapter.services
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating extensions registry for data.adapter.services using factory class net.sf.jasperreports.data.DefaultDataAdapterServiceExtensionsRegistryFactory
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating registry of type net.sf.jasperreports.web.util.JacksonMappingExtensionsRegistryFactory for property
net.sf.jasperreports.extension.registry.factory.jackson.mapping
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating extensions registry for jackson.mapping using factory class net.sf.jasperreports.web.util.JacksonMappingExtensionsRegistryFactory
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating registry of type net.sf.jasperreports.components.ComponentsExtensionsRegistryFactory for property
net.sf.jasperreports.extension.registry.factory.components
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating extensions registry for components using factory class net.sf.jasperreports.components.ComponentsExtensionsRegistryFactory
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating registry of type net.sf.jasperreports.extensions.DefaultExtensionsRegistryFactory for property
net.sf.jasperreports.extension.registry.factory.default
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating extensions registry for default using factory class net.sf.jasperreports.extensions.DefaultExtensionsRegistryFactory
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating registry of type net.sf.jasperreports.repo.DefaultRepositoryExtensionsRegistryFactory for property
net.sf.jasperreports.extension.registry.factory.repository
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating extensions registry for repository using factory class net.sf.jasperreports.repo.DefaultRepositoryExtensionsRegistryFactory
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating registry of type net.sf.jasperreports.util.CastorMappingExtensionsRegistryFactory for property
net.sf.jasperreports.extension.registry.factory.castor.mapping
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating extensions registry for castor.mapping using factory class net.sf.jasperreports.util.CastorMappingExtensionsRegistryFactory
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Loading JasperReports extension properties resource jar:file:/D:/Projekte/wonder/Frameworks/Reporting/ERJasperReports/Libraries/jasperreports-fonts-4.7.0.jar!/jasperreports_extension.properties
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating registry of type net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.simple.font.families
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating extensions registry for simple.font.families using factory class net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Loading JasperReports extension properties resource jar:file:/D:/Projekte/wonder/Frameworks/Reporting/ERJasperReports/Libraries/jasperreports-javaflow-4.7.0.jar!/jasperreports_extension.properties
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating registry of type net.sf.jasperreports.governors.GovernorExtensionsRegistryFactory for property
net.sf.jasperreports.extension.registry.factory.governor
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating extensions registry for governor using factory class net.sf.jasperreports.governors.GovernorExtensionsRegistryFactory
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating registry of type net.sf.jasperreports.components.headertoolbar.HeaderToolbarParameterContributorExtensionFactory for property
net.sf.jasperreports.extension.registry.factory.headertoolbar
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating extensions registry for headertoolbar using factory class net.sf.jasperreports.components.headertoolbar.HeaderToolbarParameterContributorExtensionFactory
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating registry of type net.sf.jasperreports.data.DefaultDataAdapterServiceExtensionsRegistryFactory for property net.sf.jasperreports.extension.registry.factory.data.adapter.services
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating extensions registry for data.adapter.services using factory class net.sf.jasperreports.data.DefaultDataAdapterServiceExtensionsRegistryFactory
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating registry of type net.sf.jasperreports.web.util.JacksonMappingExtensionsRegistryFactory for property
net.sf.jasperreports.extension.registry.factory.jackson.mapping
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating extensions registry for jackson.mapping using factory class net.sf.jasperreports.web.util.JacksonMappingExtensionsRegistryFactory
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating registry of type net.sf.jasperreports.components.ComponentsExtensionsRegistryFactory for property
net.sf.jasperreports.extension.registry.factory.components
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating extensions registry for components using factory class net.sf.jasperreports.components.ComponentsExtensionsRegistryFactory
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating registry of type net.sf.jasperreports.extensions.DefaultExtensionsRegistryFactory for property
net.sf.jasperreports.extension.registry.factory.default
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating extensions registry for default using factory class net.sf.jasperreports.extensions.DefaultExtensionsRegistryFactory
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating registry of type net.sf.jasperreports.repo.DefaultRepositoryExtensionsRegistryFactory for property
net.sf.jasperreports.extension.registry.factory.repository
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating extensions registry for repository using factory class net.sf.jasperreports.repo.DefaultRepositoryExtensionsRegistryFactory
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating registry of type net.sf.jasperreports.util.CastorMappingExtensionsRegistryFactory for property
net.sf.jasperreports.extension.registry.factory.castor.mapping
Apr 10 09:23:56
cgiPitma[53183] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry
- Instantiating extensions registry for castor.mapping using factory class net.sf.jasperreports.util.CastorMappingExtensionsRegistryFactory
Apr 10 09:23:59
cgiPitma[53183] DEBUG net.sf.jasperreports.engine.fill.JRBaseFiller
- Fill 1: created for Auswertung2
Thanks in advance for your help!!
Kind regards
Dominik Paulmichl
| Senior Consultant | Test&Quality Services
CGI Deutschland Ltd. & Co. KG
Spixstraße 22 | 81541 München | Germany
email@hidden
| de.cgi.com
Unsere Pflichtangaben gemäß § 35a GmbHG / §§ 161, 125a HGB finden Sie unter
de.cgi.com/pflichtangaben.