Reputation: 1220
I'm willing to use JasperReports in .Net.
I used IKVM.net to build DLLs needed for this, and translated a sample app.
But I get a NotImplementedExeption in C# (the equivalent code in Java works perfectly)
JasperPrint print = JasperFillManager.fillReport(jasperFileDialog.FileName, null, new JREmptyDataSource());
The method or operation is not implemented.
See stack trace below
Notes: IKVM version: 0.40.0.1 http://sourceforge.net/projects/ikvm/files/ikvm/0.40.0.1/ikvmbin-0.40.0.1.zip/download
Exception Stack Trace
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()
Upvotes: 2
Views: 3945
Reputation: 8266
Usually the class not found exception occurs when the Jasper Reports jar depends on another jar. For example if the jasperreport.jar
uses another jar like log4net.jar
, you first need to convert the dependent jar to dll. Then used the converted dll for linking during the conversion of the jasperreport. I had the same problem when converting Apache POI to dll.
Upvotes: 1