jpclerc Posted January 13, 2011 Share Posted January 13, 2011 Hello,Thank you for your help Matt :-)I have open in ireport 3.7.6 "/reports/samples/SalesByMonth"I have found the use of "LoggedInUser" (Parameter class : com.jaspersoft.jasperserver.api.metadata.user.domain.User)But I have the error :Java.land.ClassNotFoundException : com.jaspersoft.jasperserver.api.metadata.user.domain.UserI have fetch the use of ths parameter in the query but I guess that the syntax should beselect ...from ..where tab.col = '$P{LoggedInUser}.getFullName()'So I do and I have ther error :1. Parameter type not supported in query : LoggedInUser class com.jaspersoft.jasperserver.api.metadata.user.domain.User Thank you for your help Link to comment Share on other sites More sharing options...
jpclerc Posted January 13, 2011 Author Share Posted January 13, 2011 Pour complèter ma demande ....soory ... to add somthong for my topic LoggedInUser.getFullName() is the fullnamebut what is the "shotname", the login onlyfor exemple JP / Monsieur Jean-PaulLoggedInUser.getFullName() = "Monsieur Jean-Paul"How can I do to retrieve only "JP" Link to comment Share on other sites More sharing options...
tkavanagh Posted January 13, 2011 Share Posted January 13, 2011 It seems you want the shortname by which you mean the login user name (ie the string the user uses for logging in to the system), it should be: LoggedInUser.getUsername() Link to comment Share on other sites More sharing options...
Gaby38 Posted January 13, 2011 Share Posted January 13, 2011 I think there is a good explanation of "loggedinuser properties" in the tutorial about cascading input controls. It seems to me that you can get not only the fullname but other properties like the user id. If you have the user id, you can get all other fields in the JIUser table in the metadatabase jasperserver Link to comment Share on other sites More sharing options...
tkavanagh Posted January 13, 2011 Share Posted January 13, 2011 Also, if you want to see all of the classes and methods, you can download the Public API Javadoc. This can be found from the "releases" menu item. Look for the most current: version 3.7.1.File name is: jasperserver-ce-3.7.0-public-api.zipIt hasn't changed between 3.7.0 and 3.7.1. Link to comment Share on other sites More sharing options...
Gaby38 Posted January 17, 2011 Share Posted January 17, 2011 In fact you cannot write : where tab.col = '$P{LoggedInUser}.getFullName()'You have to define another parameter $P{FullName} initialized through its default value to $P{LoggedInUser}.getFullName()' and use it in where clause Link to comment Share on other sites More sharing options...
jpclerc Posted January 29, 2011 Author Share Posted January 29, 2011 Gaby38Wrote: In fact you cannot write : where tab.col = '$P{LoggedInUser}.getFullName()' You have to define another parameter $P{FullName} initialized through its default value to $P{LoggedInUser}.getFullName()' and use it in where clause Merci beaucoup .... Link to comment Share on other sites More sharing options...
rajesh.sm Posted October 28, 2013 Share Posted October 28, 2013 Hi, i have created the same. please find below jrxml file. i am getting empty report only. i not getting loggedinUserName. please advice me<?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="report7" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="c1202fd9-44f4-42c6-a3c2-45c21bc60347"><property name="ireport.zoom" value="1.0"/><property name="ireport.x" value="0"/><property name="ireport.y" value="0"/><parameter name="LoggedInUser" class="com.jaspersoft.jasperserver.api.metadata.user.domain.User" isForPrompting="false"/><parameter name="Username" class="java.lang.String" isForPrompting="false"><defaultValueExpression><![CDATA[$P{LoggedInUser}.getUsername()]]></defaultValueExpression></parameter><background><band splitType="Stretch"/></background><title><band height="76"><textField><reportElement uuid="b128f89e-0122-47be-a02e-e76026359414" x="22" y="21" width="364" height="20"/><textElement/><textFieldExpression><![CDATA[$P{Username}]]></textFieldExpression></textField></band></title><columnHeader><band height="50"><staticText><reportElement uuid="6749d95a-5d66-49af-840a-d3afb0347883" x="268" y="26" width="100" height="20"/><textElement/><text><![CDATA[Test]]></text></staticText></band></columnHeader><summary><band height="130" splitType="Stretch"><staticText><reportElement uuid="4a30d70a-23b5-4fa1-a80f-c2add14714d2" x="240" y="42" width="100" height="20"/><textElement/><text><![CDATA[Test]]></text></staticText></band></summary></jasperReport>is there anything i am missing. still my report is empty. Link to comment Share on other sites More sharing options...
amine.benyoussef Posted November 6, 2014 Share Posted November 6, 2014 Salut,J'utilise IReport 5.5 et JasperServer 5.1 et je ne comprend pas comment passer en parametre le login de la personne qui affiche ce rapport. Comment faire ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now