JasperReportのサンプルデモを実行したいので、ファイルをダウンロードしましたが、Jasperreportのドキュメントに従ってWindows 7のコマンドラインに次のように入力すると、次のようになります。
C:\jasperreports-4.7.0\demo\samples\barbecue>ant run
次のエラーが発生しました:
ターゲット「run」はプロジェクト「barbecue」に存在しません。
では、何が問題になるのでしょうか。
::更新::ant –p
CMDを
入力した後、次のようになりました:-
C:\jasperreports-4.7.0\demo\samples\barbecue>ant -p
Buildfile: C:\jasperreports-4.7.0\demo\samples\barbecue\build.xml
Shows how barcodes could be included in reports using the Barbecue component.
Main targets:
clean Deletes all the generated files.
compile Compiles the XML report design and produces the .jasper file.
csv Generates a CSV version of the report by converting the .jrprint
file.
decompile Decompiles a .jasper file into a .jrxml file.
docx Generates a DOCX version of the report by converting the .jrprin
t file.
fill Fills the compiled report design with data and produces the .jrp
rint file.
html Generates an HTML version of the report by converting the .jrpri
nt file.
javac Compiles the java source files of the test application.
jxl Generates an XLS version of the report by converting the .jrprin
t file using the JExcelApi library.
ods Generates an ODS version of the report by converting the .jrprin
t file.
odt Generates an ODT version of the report by converting the .jrprin
t file.
pdf Generates a PDF version of the report by converting the .jrprint
file.
pptx Generates a PPTX version of the report by converting the .jrprin
t file.
print Sends the report in the .jrprint file to the printer.
rtf Generates an RTF version of the report by converting the .jrprin
t file.
test Runs the sample.
view Launches the report viewer to preview the report stored in the .
jrprint file.
viewDesign Launches the design viewer to preview the compiled report design
.
viewDesignXml Launches the design viewer to preview the XML report design.
viewXml Launches the report viewer to preview the generated report store
d in an XML file.
writeApi Generates a .java version of the report by converting the .jrxml
file.
writeApiXml Generates a .jrxml version of the report by executing the API ve
rsion of the report design.
xhtml Generates an XHTML version of the report by converting the .jrpr
int file.
xls Generates an XLS version of the report by converting the .jrprin
t file using the POI library.
xlsx Generates an XLSX version of the report by converting the .jrpri
nt file.
xml Generates an XML version of the report by converting the .jrprin
t file.
xmlEmbed Generates an XML version of the report by converting the .jrprin
t file.
Default target: test
::::: UPDATED2 :::::チャートのデモを
入力ant test
しましたが、問題はまだあります:-
C:\jasperreports-4.7.0\demo\samples\charts>ant test
Buildfile: C:\jasperreports-4.7.0\demo\samples\charts\build.xml
test:
[echo] ===================================
[echo] Charts Sample
[echo] ===================================
clean:
clean-sample:
javac:
javac:
[mkdir] Created dir: C:\jasperreports-4.7.0\demo\samples\charts\build\classe
s
[javac] C:\jasperreports-4.7.0\demo\samples\build.xml:41: warning: 'includea
ntruntime' was not set, defaulting to build.sysclasspath=last; set to false for
repeatable builds
[javac] Compiling 2 source files to C:\jasperreports-4.7.0\demo\samples\char
ts\build\classes
[javac] warning: [options] bootstrap class path not set in conjunction with
-source 1.6
[javac] Note: C:\jasperreports-4.7.0\demo\samples\charts\src\ChartsApp.java
uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 warning
[copy] Copied 5 empty directories to 5 empty directories under C:\jasperrep
orts-4.7.0\demo\samples\charts\build\classes
compile:
compile:
[mkdir] Created dir: C:\jasperreports-4.7.0\demo\samples\charts\build\report
s
[jrc] Compiling 24 report design files.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\MultipleAx
isChartReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\XYBarChart
TimePeriodReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\XYAreaChar
tReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\Pie3DChart
Report.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\StackedBar
3DChartReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\MeterChart
Report.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\XYBarChart
Report.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\StackedAre
aChartReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\Candlestic
kChartReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\HighLowCha
rtReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\XYLineChar
tReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\BubbleChar
tReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\Thermomete
rChartReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\StackedBar
ChartReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\ScatterCha
rtReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\TimeSeries
ChartReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\SubDataset
ChartReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\AreaChartR
eport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\LineChartR
eport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\XYBarChart
TimeSeriesReport.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\GanttChart
Report.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\PieChartRe
port.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\Bar3DChart
Report.jrxml ... OK.
[jrc] File : C:\jasperreports-4.7.0\demo\samples\charts\reports\BarChartRe
port.jrxml ... OK.
test:
[java] net.sf.jasperreports.engine.JRException: java.sql.SQLException: sock
et creation error
[java] at net.sf.jasperreports.engine.util.AbstractSampleApp.getDemoHsq
ldbConnection(AbstractSampleApp.java:158)
[java] at ChartsApp.fill(ChartsApp.java:83)
[java] at ChartsApp.test(ChartsApp.java:63)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
sorImpl.java:57)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:601)
[java] at net.sf.jasperreports.engine.util.AbstractSampleApp.executeTas
k(AbstractSampleApp.java:94)
[java] at net.sf.jasperreports.engine.util.AbstractSampleApp.main(Abstr
actSampleApp.java:179)
[java] at ChartsApp.main(ChartsApp.java:54)
[java] Caused by: java.sql.SQLException: socket creation error
[java] at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
[java] at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)
[java] at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
[java] at org.hsqldb.jdbcDriver.connect(Unknown Source)
[java] at java.sql.DriverManager.getConnection(DriverManager.java:579)
[java] at java.sql.DriverManager.getConnection(DriverManager.java:221)
[java] at net.sf.jasperreports.engine.util.AbstractSampleApp.getDemoHsq
ldbConnection(AbstractSampleApp.java:150)
[java] ... 9 more
BUILD SUCCESSFUL
Total time: 8 seconds
C:\jasperreports-4.7.0\demo\samples\charts>ant run
Buildfile: C:\jasperreports-4.7.0\demo\samples\charts\build.xml
BUILD FAILED
Target "run" does not exist in the project "charts".
Total time: 0 seconds