Jump to content
Changes to the Jaspersoft community edition download ×

use loggedInUser in Dataset of JasperReport


Rabinarayan

Recommended Posts

Hi,

 

I am able to use LoggedInUser in iReport.It can show the loggedInUserName in a textbox, but I want to use this in a dataset of ireport. When I call it in DataSet it ask me for setting/assigning a default value to this.

 

How can I assign a default value to this object.

 

Can anybody help me out this.

 

Rabinarayan

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

If you want to use LoggedInUser in a subdataset, you'll have to explicitly declare it and propagate the value:

Code:

<subDataset name="myDataset">
<!-- subdataset param -->
<parameter name="LoggedInUser" class="com.jaspersoft.jasperserver.api.metadata.user.domain.User"/>
...
</subDataset>
...
<!-- main report param -->
<parameter name="LoggedInUser" class="com.jaspersoft.jasperserver.api.metadata.user.domain.User"/>
...
<datasetRun subDataset="myDataset">
<datasetParameter name="LoggedInUser">
<datasetParameterExpression>$P{LoggedInUser}</datasetParameterExpression>
</datasetParameter>
</datasetRun>

 

HTH,

Lucian

Link to comment
Share on other sites

  • 8 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...