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)
Scheduling BIRT reports using batch files
chaitanya1
Hi <br />
<br />
I am trying to schedule my BIRT reports using batch fiels.I created runRepoert batch file with following lines:<br />
<strong class='bbc'><br />
C:\birt-runtime\birt-runtime-2_6_1\ReportEngine\genReport.bat -m runrender-o <br />
"c:\birt-runtime\birt-runtime-2_6_1\ReportEngine\samples\output.pdf" -f pdf<br />
"C:\birt-runtime\birt-runtime-2_6_1\ReportEngine\samples\hello_world.rptdesign"</strong><br />
<br />
when i am trying to run the commands from command window :<br />
C:\birt-runtime\birt-runtime-2_6_1\ReportEngine>genReport.bat -m runrender-o<br />
<br />
following error is coming:<br />
<br />
<br />
<strong class='bbc'><br />
C:\birt-runtime\birt-runtime-2_6_1\ReportEngine>ECHO off<br />
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/birt/repo<br />
rt/engine/api/ReportRunner<br />
Caused by: java.lang.ClassNotFoundException: org.eclipse.birt.report.engine.api.<br />
ReportRunner<br />
at java.net.URLClassLoader$1.run(Unknown Source)<br />
at java.security.AccessController.doPrivileged(Native Method)<br />
at java.net.URLClassLoader.findClass(Unknown Source)<br />
at java.lang.ClassLoader.loadClass(Unknown Source)<br />
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)<br />
at java.lang.ClassLoader.loadClass(Unknown Source)<br />
at java.lang.ClassLoader.loadClassInternal(Unknown Source)<br />
Could not find the main class: org.eclipse.birt.report.engine.api.ReportRunner.<br />
Program will exit.<br />
C:\birt-runtime\birt-runtime-2_6_1\ReportEngine></strong><br />
<br />
where to find to Report runner class .Pls help me.When I schedule this runreport batch file through windows scheduler nothing is created :no HTML nor PDF .I tried for both.pls help me.<br />
<br />
Thanks in advance<br />
chaiatnya.
Find more posts tagged with
Comments
mwilliams
Hi chaiatnya,
Are you sure that the BIRT runtime is in your classpath?
chaitanya1
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="71582" data-time="1292943325" data-date="21 December 2010 - 07:55 AM"><p>
Hi chaiatnya,<br />
<br />
Are you sure that the BIRT runtime is in your classpath?<br /></p></blockquote>
<br />
<br />
<br />
Hi williams,<br />
Thanks for ur reply.<br />
Actually I downloaded again the birt-runtime engine_2_6_1 freshly.<br />
Now I created the batch file as follows:<br />
<br />
<strong class='bbc'>Set BIRT_HOME=C:\birt-runtime\birt-runtime-2_6_1\<br />
C:\birt-runtime\birt-runtime-2_6_1\ReportEngine\genReport.bat -m runrender-o <br />
"c:\birt-runtime\birt-runtime-2_6_1\ReportEngine\samples\output.pdf" -f pdf<br />
"C:\birt-runtime\birt-runtime-2_6_1\ReportEngine\samples\hello_world.rptdesign"</strong><br />
<br />
<br />
When I am trying to run this batch file it is showing as follows and I am geeting one folder named workspace in the folder where runreport batch file is located.<br />
<br />
<br />
<strong class='bbc'><br />
C:\birt-runtime\birt-runtime-2_6_1\ReportEngine>Set BIRT_HOME=C:\birt-runtime\bi<br />
rt-runtime-2_6_1\<br />
<br />
C:\birt-runtime\birt-runtime-2_6_1\ReportEngine>C:\birt-runtime\birt-runtime-2_6<br />
_1\ReportEngine\genReport.bat -m runrender-o<br />
<br />
C:\birt-runtime\birt-runtime-2_6_1\ReportEngine>ECHO off<br />
Dec 28, 2010 12:14:53 PM org.eclipse.birt.report.engine.api.impl.ReportEngineHel<br />
per openReportDesign<br />
SEVERE: C:\birt-runtime\birt-runtime-2_6_1\ReportEngine\runrender-o not found!<br />
Dec 28, 2010 12:14:53 PM org.eclipse.birt.report.engine.api.ReportRunner runAndR<br />
enderReport<br />
SEVERE: The design file runrender-o can not be found.<br />
org.eclipse.birt.report.engine.api.EngineException: The design file runrender-o<br />
can not be found.<br />
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReport<br />
Design(ReportEngineHelper.java:113)<br />
at org.eclipse.birt.report.engine.api.impl.ReportEngine.openReportDesign<br />
(ReportEngine.java:295)<br />
at org.eclipse.birt.report.engine.api.ReportRunner.runAndRenderReport(Re<br />
portRunner.java:189)<br />
at org.eclipse.birt.report.engine.api.ReportRunner.execute(ReportRunner.<br />
java:162)<br />
at org.eclipse.birt.report.engine.api.ReportRunner.main(ReportRunner.jav<br />
a:121)</strong><br />
<br />
<br />
I am totally confused with the process.Pls Pls help me out in this<br />
Thanks in advance<br />
Chaitanya
trivedi
Hi Chaitanya,
You are not specifying the *.rptdesign file name. BIRT is looking for it & throws an error.
Example:-
C:\birt-runtime\birt-runtime-2_6_1\ReportEngine\genReport.bat -f PDF samples\hello_world.rptdesign
this should run.
Basically problem is in paths and how you can make BIRT read your design file. Try deifferent combinations of path.
Good Luck.
Jitu
chaitanya1
<blockquote class='ipsBlockquote' data-author="'trivedi'" data-cid="71792" data-time="1293697424" data-date="30 December 2010 - 01:23 AM"><p>
Hi Chaitanya,<br />
<br />
You are not specifying the *.rptdesign file name. BIRT is looking for it & throws an error.<br />
<br />
Example:- <br />
<br />
C:\birt-runtime\birt-runtime-2_6_1\ReportEngine\genReport.bat -f PDF samples\hello_world.rptdesign<br />
<br />
this should run.<br />
<br />
Basically problem is in paths and how you can make BIRT read your design file. Try deifferent combinations of path. <br />
<br />
Good Luck.<br />
<br />
Jitu<br /></p></blockquote>
<br />
hiii<br />
<br />
Thank you very much Jitu<br />
Now I am getting both pdf and html formats of that sample report hello_world.rptdesign.<br />
But onething,<br />
when i am trying for my reports which is having jdbc connection,it is running but giving the following error :<br />
<br />
My batch file is :<br />
Set BIRT_HOME=C:\birt-runtime\birt-runtime-2_6_1\<br />
C:\birt-runtime\birt-runtime-2_6_1\ReportEngine\genReport.bat -f HTML workspace\date_diff.rptdesign<br />
<br />
<br />
when i am trying for my reports which is having jdbc connection,it is running but giving the following error :<br />
I copied the required jar file for that jdbc connection in ReportEngine\plugins\jdbcfolder\jarfile.<br />
But still i ma getting this error.<br />
<br />
<br />
<br />
<br />
<strong class='bbc'><br />
C:\birt-runtime\birt-runtime-2_6_1\ReportEngine>Set BIRT_HOME=C:\birt-runtime\bi<br />
rt-runtime-2_6_1\<br />
<br />
C:\birt-runtime\birt-runtime-2_6_1\ReportEngine>C:\birt-runtime\birt-runtime-2_6<br />
_1\ReportEngine\genReport.bat -f HTML workspace\date_diff.rptdesign<br />
<br />
C:\birt-runtime\birt-runtime-2_6_1\ReportEngine>ECHO off<br />
Dec 31, 2010 5:34:10 PM org.eclipse.birt.data.engine.odaconsumer.Driver createNe<br />
wDriverHelper<br />
SEVERE: Cannot get ODA data source driver helper.<br />
org.eclipse.datatools.connectivity.oda.consumer.helper.OdaHelperException: Unabl<br />
e to load or instantiate the custom ODA driver class. (org.eclipse.birt.report.d<br />
ata.oda.jdbc.OdaJdbcDriver) ;<br />
java.lang.ClassNotFoundException: org.eclipse.birt.report.data.oda.jdbc.OdaJdbcD<br />
river<br />
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaDriver.load<br />
DriverInstance(OdaDriver.java:231)<br />
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaDriver.init<br />
(OdaDriver.java:177)<br />
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaDriver.<ini<br />
t>(OdaDriver.java:93)<br />
at org.eclipse.birt.data.engine.odaconsumer.Driver.createNewDriverHelper<br />
(Driver.java:97)<br />
at org.eclipse.birt.data.engine.odaconsumer.DriverManager.getDriverHelpe<br />
r(DriverManager.java:111)<br />
at org.eclipse.birt.data.engine.odaconsumer.DriverManager.getNewDriverHe<br />
lper(DriverManager.java:100)<br />
at org.eclipse.birt.data.engine.odaconsumer.ConnectionManager.openConnec<br />
tion(ConnectionManager.java:150)<br />
at org.eclipse.birt.data.engine.executor.DataSource.newConnection(DataSo<br />
urce.java:222)<br />
at org.eclipse.birt.data.engine.executor.DataSource.open(DataSource.java<br />
:210)<br />
at org.eclipse.birt.data.engine.impl.DataSourceRuntime.openOdiDataSource<br />
(DataSourceRuntime.java:208)<br />
at org.eclipse.birt.data.engine.impl.QueryExecutor.openDataSource(QueryE<br />
xecutor.java:406)<br />
at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(Quer<br />
yExecutor.java:316)<br />
at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQue<br />
ry.java:448)<br />
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.produceQuer<br />
yResults(PreparedDataSourceQuery.java:190)<br />
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(Pre<br />
paredDataSourceQuery.java:178)<br />
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute(Prepared<br />
OdaDSQuery.java:145)<br />
at org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.exec<br />
ute(DataRequestSessionImpl.java:617)<br />
at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(<br />
DteDataEngine.java:152)<br />
at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(Ab<br />
stractDataEngine.java:265)<br />
at org.eclipse.birt.report.engine.executor.ExecutionContext.executeQuery<br />
(ExecutionContext.java:1876)<br />
at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuer<br />
y(QueryItemExecutor.java:80)<br />
at org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(Tab<br />
leItemExecutor.java:62)<br />
at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicat<br />
eItemExecutor.execute(SuppressDuplicateItemExecutor.java:43)<br />
at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportIt<br />
emExecutor.execute(WrappedReportItemExecutor.java:46)<br />
at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReport<br />
ItemExecutor.execute(LocalizedReportItemExecutor.java:34)<br />
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layout<br />
Nodes(HTMLBlockStackingLM.java:65)<br />
at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPage<br />
LM.java:90)<br />
at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.lay<br />
out(HTMLReportLayoutEngine.java:99)<br />
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAnd<br />
RenderTask.java:180)<br />
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRe<br />
nderTask.java:77)<br />
at org.eclipse.birt.report.engine.api.ReportRunner.runAndRenderReport(Re<br />
portRunner.java:222)<br />
at org.eclipse.birt.report.engine.api.ReportRunner.execute(ReportRunner.<br />
java:162)<br />
at org.eclipse.birt.report.engine.api.ReportRunner.main(ReportRunner.jav<br />
a:121)<br />
Caused by: java.lang.ClassNotFoundException: org.eclipse.birt.report.data.oda.jd<br />
bc.OdaJdbcDriver<br />
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(Bundl<br />
eLoader.java:506)<br />
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.<br />
java:422)<br />
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.<br />
java:410)<br />
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(De<br />
faultClassLoader.java:107)<br />
at java.lang.ClassLoader.loadClass(Unknown Source)<br />
at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.<br />
java:338)<br />
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleH<br />
ost.java:232)<br />
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(Abs<br />
tractBundle.java:1197)<br />
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaDriver.load<br />
DriverInstance(OdaDriver.java:208)<br />
... 32 more</strong><br />
<br />
<br />
Thank in advance<br />
<br />
Chaitanya
trivedi
Hi Chaitanya,
put your JDBC Driver in the following folder:-
<install path>/ReportEngine/plugins/org.eclipse.birt.report.data.oda.jdbc_2.5.1.v20090821/drivers/
this should solve the error !