• Ireport 4.7 with openkm 5.1.8

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #18535  by ahmed
 
hi every one, please forgive my bad english
i want to add report - to my openkm app using Ireport 4.7, first i install the font using command
Code: Select all
 sudo aptitude install msttcorefonts
then i upgrade the jasper report jar file using maven from jasperreport-3.6.jar to jasperreport-4.7.jar
third i built simple report with Ireport, the source code is below

i test the report in Ireport Preview and it work fine without error but when i add the user_report.jrxml to openkm it's show empty result. please can any one give me help or show me what the wrong step i did.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="report1" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="9a2a3c3a-e3d0-47f4-bf04-eb794654cd40">
	<property name="ireport.zoom" value="1.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<queryString>
		<![CDATA[select * from okm_user]]>
	</queryString>
	<field name="usr_id" class="java.lang.String"/>
	<field name="usr_name" class="java.lang.String"/>
	<field name="usr_password" class="java.lang.String"/>
	<field name="usr_email" class="java.lang.String"/>
	<field name="usr_mobile" class="java.lang.String"/>
	<field name="usr_active" class="java.lang.String"/>
	<field name="main_department" class="java.lang.Integer"/>
	<field name="main_role" class="java.lang.Integer"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band height="79" splitType="Stretch"/>
	</title>
	<pageHeader>
		<band height="35" splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band height="61" splitType="Stretch">
			<staticText>
				<reportElement uuid="987f4055-10eb-41ca-9e92-384807537bbd" x="10" y="2" width="100" height="20"/>
				<textElement/>
				<text><![CDATA[usr_name]]></text>
			</staticText>
			<staticText>
				<reportElement uuid="7cf62c0a-0c43-4272-8fcf-8e639b363697" x="199" y="2" width="100" height="20"/>
				<textElement/>
				<text><![CDATA[usr_email]]></text>
			</staticText>
			<staticText>
				<reportElement uuid="064c3fc5-4829-4c44-88f3-e02a9bc327fc" x="414" y="0" width="100" height="20"/>
				<textElement/>
				<text><![CDATA[usr_mobile]]></text>
			</staticText>
		</band>
	</columnHeader>
	<detail>
		<band height="125" splitType="Stretch">
			<textField>
				<reportElement uuid="32d818e0-6152-445a-98fc-2ac304ad0768" x="10" y="10" width="100" height="20"/>
				<textElement/>
				<textFieldExpression><![CDATA[$F{usr_name}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="698d1c1e-dd63-4d94-841f-1dfebfda864e" x="199" y="10" width="100" height="20"/>
				<textElement/>
				<textFieldExpression><![CDATA[$F{usr_email}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="581ea87c-b1d7-4439-bacf-0e998e33fc85" x="414" y="10" width="100" height="20"/>
				<textElement/>
				<textFieldExpression><![CDATA[$F{usr_mobile}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band height="45" splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band height="51" splitType="Stretch">
			<textField>
				<reportElement uuid="12caccc9-9e16-443f-a38d-4a29e4755a29" x="199" y="17" width="100" height="20"/>
				<textElement/>
				<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
		</band>
	</pageFooter>
	<summary>
		<band height="42" splitType="Stretch"/>
	</summary>
</jasperReport>
 #18541  by jllort
 
Any error in server.log ? which is your OS and you're using default database or other ?
 #18580  by ahmed
 
i solve the problem, but i want to use Groovy code to call function from OoenKM like Main.get().getWorkSpace().getUser() , please can give me example of how to do that, because i used the file example File:registred_uesr.jrxml from openKM wiki but whe i try to convert to pdf there is exception msg tell me "image read fail" . so please i need example of using groovy in jasper report with openkm
 #18596  by jllort
 
This is only available from frontend Main.get().getWorkSpace().getUser(), any package under com.openkm.frontend is not available from jasper, scripting etc.... Take a look at scripting you can have some ideas from there http://wiki.openkm.com/index.php/Scripting. What do you want do doing with user id ?

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.