CMDBuild Forum

Report Attributes in Widgets

Hello, Great product, im new to it, but loving it, its solving so many of my issues

I can hard code report attributes using a widget. My reports pick this up and process it perfectly well

But what i really want it to a have a report based on the card im looking at.

How can i return a varible ( like the ID of the card) on to Jasper iReport.

Thanks

Hello,

you have to define a "parameter" field in iReport (to manage the Card Id), and then specify the parameter value in the report widget parameters.

 

Here are some notes to define and use CMDBuild parameters in IReport:

 * AVAILABLE FORMATS FOR JRPARAMETER NAME
 * reference: "name.class.attribute"
 * lookup: "name.lookup.lookuptype"
 * simple: "name"
 * 
 * REQUIRED PARAMETERS
 * By default all custom parameters (with prompt flag set to true) are required.
 * Set a parameter's property with name="required" and value="false" to override.
 * 
 * Note: Reference or lookup parameters will always be integers while simple params will match original parameter class.

 

To specify the parameter value in the report widget you can use this syntax: {client:Id} (see the example in the Administrator Manual page 22)

 

CMDBuild Team

Hi, 

 
Thanks for this, but im still not able to do it, let me explain some more.
 
1, Ive created a blank report in Ireport.
2, created a parameter called "CardID" and set it to required, and an integer
3, created a new report in CMDBuild using the new report
4, i add a new widget to a card, selecting the new report.
5, it picks up the parameter of CardID, i assign it the value of {client:Id}
6, go back to data management mode.
7, go to the card, and click the new report widget button
8, it asks me to enter the CardID - without defaulting to anything.
 
so...
 
9, i enter something and submit
10, it displays the report
 
but the issue its its not picking up the {client:id} that i think i should.
 
Does my parameter in iReport need to be special?
 
Thanks again.
 
Hi Andrew,
the attribute Id is a reserved value and you cant use it like this...
The meaning of the prefix client is that you need to have the variable you specified editable in the card in which you have the widget. So: {client:Id} needs that Id is editable in that moment, which is clearly impossible.
 

Hi Again, 

 
Ive set it to {server:id} and its worked fine.
 
Thanks for your help.

Previously Andrew wrote:

Hi Again, 
 
Ive set it to {server:id} and its worked fine.
 
Thanks for your help.



Hi Andrew and CMDbuild team i tried many times to pass the {Client:Code} wich is modifiable field but i have nothing so as first
1- i create report and set the parameter "Use as a prompt"   "java.lang;String"
2- when i finish i import the report in cmdbuild
3- i create the widget by specifying my repport, he detects the parameter (ParamClient) i set the value to {Client:Code}
4- after that when i try it in the management mode i have nothing ( a widget but i must enter a string to open the repport )


Thanks

 

be careful, its all case sensitive!

 
use:
{client:Code}
and it works fine.
{server:Code} should be fine too...the difference is that server reads what was last saved, and client reads on textbox thats on the screen - even without saving.
 
i use {server:Id} to get the record ID, then i use this as a param in my report that goes in the SQL query.
(the report displays the service catalouge for a given service, with related systems)
 
Again, this is a great program - it just has a personality.

Hi all

Can anyone tell me is there any attribute of currently logged in user giving Full name like 'Konstantin Trushin'. I have found only {user:id} that gives 22 and {user:name} that gives 'trushin' - login name. Is there

one for full description