Jump to content
We've recently updated our Privacy Statement, available here ×

muhannad_

Members
  • Posts

    2
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Posts posted by muhannad_

  1. I was able to use jasperreports from an ASP.NET (C#) application using JNI4NET as a bridge between .NET & JAVA (works two ways), I performed a load test simulating multiple concurrent users through Apache Jmeter & the performance is very good, only the very first call takes some time for the initialization between the two environments to happen.

    here is what I did:

    1)using iReport designer, I built & compiled my report to .jasper file.
    2)created a JAVA project in Eclipse referencing jasperreports JAR, the project reads records from a JDBC connection & fills the jasper template generating a PDF.
    3)downloaded jni4net-0.8.6.0-bin from (http://jni4net.sourceforge.net/)
    4)in Eclipse, export your project as a JAR file to be referenced from within JNI4NET.
    5)use the generateProxies tool that comes with the package to generate a proxy for the JAVA class you directly reference from within .NET, several samples are provided within the package, for example in my project I had several classes, one for generating a chart, one for reading from a database, but only one was called directly from .NET to generate a PDF as in below:

    create an XML file to be used by the generateProxy tool:

    <TargetDirJvm>workjvm</TargetDirJvm>
    <TargetDirClr>workclr</TargetDirClr>

    <ClassPath Path="work/jbridge.jar"/> <!-- my Eclipse project exported to JAR-->
    <ClassPath Path="lib/jasperreports-4.5.0.jar"/>
    <!-- ....................-->

    <JavaClass TypeName="reports.GeneratePDF"/> <!-- the JAVA class that will be directly invoked from within .NET, no need to generate proxies for other indirect classes-->


    you can see examples on how to call this tool passing the XML file as a parameter in JNI4NET/samples package.

×
×
  • Create New...