B4J Library jJasperReports Library

Situ LLC

Active Member
Licensed User
Thanks to share
Caused by: java.io.FileNotFoundException: C:\PREC72~1\JASPER~1\Objects\RepName.jrxml ( The system cannot find the specified file)
I was able to runt the test , I couldn't create these mentioned files missing, something else is missing , there are more examples and literature ?
Thanks
 

Juan Marrero

Active Member
Licensed User
Longtime User
You have to create the reports (.jrxml) with tools like Tibco Jaspersoft Studio. I use Tibco Jaspersoft Studio Community Edition.
 

Situ LLC

Active Member
Licensed User
Thnks
 

Juan Marrero

Active Member
Licensed User
Longtime User
hi
problem with arabic characters in export pdf
solved??
I looked into old private messages and at least I solved it using DejaVu font. I first tried with Arial but didn't worked. Only worked with DejaVu. It's included in versions newer than 1.20.
 

behnam_tr

Active Member
Licensed User
Longtime User
I looked into old private messages and at least I solved it using DejaVu font. I first tried with Arial but didn't worked. Only worked with DejaVu. It's included in versions newer than 1.20.

thanks i test DejaVu font and is ok in pdfexport
but i want to use other fonts,any other truetype fonts

sample and font attached
 

Attachments

  • testJasper.zip
    125.1 KB · Views: 266

Juan Marrero

Active Member
Licensed User
Longtime User
thanks i test DejaVu font and is ok in pdfexport
but i want to use other fonts,any other truetype fonts

sample and font attached
In theory any fonts that support Arabic symbols (characters) should work. Since I live in Puerto Rico (US Territory) I don't know any fonts (outside DejaVu) that support Arabic characters (or any other language that is not Spanish or English). I will download your testJasper.zip file and I will try to look into it.
 

Juan Marrero

Active Member
Licensed User
Longtime User
On a quick review, DejaVu fonts are inside jasperreports-fonts-6.0.0.jar. So I'm guessing if it's possible to include your font into a jar, I could add it to the library.
 

behnam_tr

Active Member
Licensed User
Longtime User
On a quick review, DejaVu fonts are inside jasperreports-fonts-6.0.0.jar. So I'm guessing if it's possible to include your font into a jar, I could add it to the library.

thanks for help....
i could add other font that support persian or arabic characters
and Now pdfExport Is Ok for B Titr Font .that is a trueType Font
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
For addind Your TrueType Fonts

1..open jasperreports-fonts-6.0.0.jar Wiht 7-zip software

2.add your fonts to >> net/sf/jasperreports/fonts

3.open fonts.xml with notepad and add this codes
B4X:
<fontFamily name="B Titr">
        <normal>net/sf/jasperreports/fonts/myfonts/BTitr.ttf</normal>
        <bold>net/sf/jasperreports/fonts/myfonts/BTitr.ttf</bold>
        <italic>net/sf/jasperreports/fonts/myfonts/BTitr.ttf</italic>
        <boldItalic>net/sf/jasperreports/fonts/myfonts/BTitr.ttf</boldItalic>
        <pdfEncoding>Identity-H</pdfEncoding>
        <pdfEmbedded>true</pdfEmbedded>
        <exportFonts>
            <export key="net.sf.jasperreports.html">'B Titr', Arial, Helvetica, sans-serif</export>
            <export key="net.sf.jasperreports.xhtml">'B Titr', Arial, Helvetica, sans-serif</export>
        </exportFonts>
        
    </fontFamily>

4.Open and edit "jasperreports_extension.properties" file and add this line code
B4X:
net.sf.jasperreports.extension.simple.font.families.myfonts=net/sf/jasperreports/fonts/fonts.xml

5.in iReport software set label font property like attached image (I'm Using iReport 5.2.0)

6.Done.
 

Attachments

  • help pdffont set.png
    218.7 KB · Views: 231

focus330

Member
Licensed User
Longtime User
HI
I created some reports with TIBCO. One of them has a picture ( a png image ). Exporting this report as Report Template the app exports also the image.
Calling GasperViewer from b4j i have this error :
net.sf.jasperreports.engine.JRException: Byte data not found at: flower1.png.
What means ? What is wrong ?
Thanks
 

Juan Marrero

Active Member
Licensed User
Longtime User
Did you put flower1.png at the same level as your report?
 

Situ LLC

Active Member
Licensed User
I have the same ..
 

Juan Marrero

Active Member
Licensed User
Longtime User
I have the same ..
I don't recall if the example provided have the SQLite Button. In that button's code there is an example of how to include pictures in the report. In early versions of the library you had to put it at the same level as the report but now you can specify where the picture is (I totally forgot about that).
B4X:
    Dim jasper As JasperReports
    Dim report As JasperReport
    Dim print As JasperPrint
    Dim conn As JasperConnection
   
    jasper.InitializeParameters
    report = jasper.CompileXML(File.Combine(File.DirApp, "sqlite_test.jrxml"))
    jasper.AddParameter("realPath", File.Combine(File.DirApp, "cherry.jpg"))
    conn = jasper.getConnectionSQLite(File.Combine(File.DirApp, "jasperTest.db"))
    print = jasper.Print(report, jasper.parameters, conn)
    jasper.JasperViewer(print, True)

I created a Parameter called realPath as String.

In the image properties (under Image Tab) in Expression I selected the parameter "realpath". Please click on the "Form+Pencil" button to enter Expression Editor to select the Parameter.
 

Situ LLC

Active Member
Licensed User
Thanks
 

Xfood

Expert
Licensed User
Good morning,
sorry, these links to download the additional libraries are no longer active, I can't download the libraries,
could someone make available a zip file with all the necessary libraries?
Thanks a lot to everyone
 

Juan Marrero

Active Member
Licensed User
Longtime User
Good morning,
sorry, these links to download the additional libraries are no longer active, I can't download the libraries,
could someone make available a zip file with all the necessary libraries?
Thanks a lot to everyone
You sure? They worked for me.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…