2009-12-30 44 views
1

我愿意在.Net中使用JasperReports。JasperReports in .Net over IKVM

我使用IKVM.net为此构建所需的DLL,并翻译了一个示例应用程序。

但我得到在C#中NotImplementedExeption(在Java中的等价代码工作完全)

JasperPrint print = JasperFillManager.fillReport(jasperFileDialog.FileName, null, new JREmptyDataSource()); 

的方法或操作未实现。

见下


注意堆栈跟踪: IKVM版本:0.40.0.1 http://sourceforge.net/projects/ikvm/files/ikvm/0.40.0.1/ikvmbin-0.40.0.1.zip/download


异常堆栈跟踪

 
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(Map parameterValues) 
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(Map parameterValues, JRDataSource ds) 
    at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JasperReport jasperReport, Map parameters, JRDataSource dataSource) 
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperReport jasperReport, Map parameters, JRDataSource dataSource) 
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(String sourceFileName, Map parameters, JRDataSource dataSource) 
    at Jasper.Net.Form1.ExportButton_Click(Object sender, EventArgs e) in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\Jasper.Net\Jasper.Net\Form1.cs:line 39 
    at System.Windows.Forms.Control.OnClick(EventArgs e) 
    at System.Windows.Forms.Button.OnClick(EventArgs e) 
    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) 
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) 
    at System.Windows.Forms.Control.WndProc(Message& m) 
    at System.Windows.Forms.ButtonBase.WndProc(Message& m) 
    at System.Windows.Forms.Button.WndProc(Message& m) 
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 
    at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 
    at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) 
    at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) 
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) 
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) 
    at System.Windows.Forms.Application.Run(Form mainForm) 
    at Jasper.Net.Program.Main() in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\Jasper.Net\Jasper.Net\Program.cs:line 18 
    at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) 
    at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) 
    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() 
    at System.Threading.ThreadHelper.ThreadStart_Context(Object state) 
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
    at System.Threading.ThreadHelper.ThreadStart() 
+0

尝试使用反射器检查生成的dll中的方法定义/声明 – A9S6

+0

您的堆栈跟踪不会显示NotImplementedExeption来自何处。没有这些信息就无法回答。 – Horcrux7

+0

你有没有得到这个工作? – FlappySocks

回答

0

当Jasper Reports jar依赖于另一个jar时,通常没有发现异常。例如,如果jasperreport.jar使用另一个类似log4net.jar的jar,则首先需要将相关jar转换为dll。然后在转换jasperreport期间使用转换后的dll进行链接。将Apache POI转换为dll时遇到同样的问题。