cyberdemos Posted January 27, 2011 Share Posted January 27, 2011 Hi all!Is there a way to customize field positioning inside a report unit?I.e. if i have a mandatory field and a read-only field containing its description how can i put the second field on the right side of the first instead on the bottom as default?Thank you very much for your help! Link to comment Share on other sites More sharing options...
mdahlman Posted January 28, 2011 Share Posted January 28, 2011 I think you'll need to include version numbers (3.7 or 4.0?) and maybe a screenshot to be completely clear.But I suspect that the important information for you is this: the input controls display in the order that you add them to the report unit. They don't have inherent positioning information.There could be some interesting enhancements around this. The most obvious is to make it simple to re-order input controls. That's been discussed before, and it's certainly needed. You could also modify the Theme in 4.0 to control how input controls are displayed. But perhaps there is more metadata that could be added to input controls to give you more control over how they get displayed.Regards,Matt Link to comment Share on other sites More sharing options...
cbarlow3 Posted January 28, 2011 Share Posted January 28, 2011 Matt,You're suggesting a way to control controls??? That is so....meta. Carl Link to comment Share on other sites More sharing options...
cyberdemos Posted February 2, 2011 Author Share Posted February 2, 2011 Thank you very much mdahlman.You have exactly answered to my question. I've seen 3.7 version but i'll pass to 4.0 as soon as possible.With 3.7 version is impossible modify report unit layout.As i can see 4.0 version i'll try to modify this meta to create an order input control and, if possible, an horizontal layout between textfiel and their own description fields. As i know domething more i'll update this post.Regards,Cyb. Link to comment Share on other sites More sharing options...
bobtins Posted February 2, 2011 Share Posted February 2, 2011 FWIW, I dug into this a little bit to figure out just how the order of input controls is determined. If the order of the input controls is really bugging you and you don't mind getting your hands dirty, you can change the order using SQL.Hibernate lets you map an ordered list of objects, and report units use this mapping for their input controls. The mapping from report unit to input control is stored in the table "JIReportUnitInputControl", and it has the id for the report unit, the input control, AND an index which determines the order of the input controls.You can update the index (column control_index) to change the order, but because control_index is part of the primary key, you can't just swap one by one because at some point you will have duplicate values.See below for how I swapped the two input controls with a couple update statements.See the attached screen shot for the result--not that useful, but it demonstrates the functionality!Practically, this means that we already have the hooks to do this; we just have to implement a way to change the order of the list in the repository and surface it in the web UI and web services. Code:mysql> desc jireportunitinputcontrol;+------------------+------------+------+-----+---------+-------+| Field | Type | Null | Key | Default | Extra |+------------------+------------+------+-----+---------+-------+| report_unit_id | bigint(20) | NO | PRI | NULL | || input_control_id | bigint(20) | NO | MUL | NULL | || control_index | int(11) | NO | PRI | NULL | |+------------------+------------+------+-----+---------+-------+3 rows in set (0.00 sec)mysql> select * from jireportunitinputcontrol where report_unit_id = 2197;+----------------+------------------+---------------+| report_unit_id | input_control_id | control_index |+----------------+------------------+---------------+| 2197 | 2195 | 0 || 2197 | 2196 | 1 |+----------------+------------------+---------------+2 rows in set (0.00 sec)mysql> update jireportunitinputcontrol set control_index = (3 + control_index) where report_unit_id = 2197;Query OK, 2 rows affected (0.00 sec)Rows matched: 2 Changed: 2 Warnings: 0mysql> select * from jireportunitinputcontrol where report_unit_id = 2197;+----------------+------------------+---------------+| report_unit_id | input_control_id | control_index |+----------------+------------------+---------------+| 2197 | 2195 | 3 || 2197 | 2196 | 4 |+----------------+------------------+---------------+2 rows in set (0.00 sec)mysql> update jireportunitinputcontrol set control_index = (control_index % 2) where report_unit_id= 2197;Query OK, 2 rows affected (0.02 sec)Rows matched: 2 Changed: 2 Warnings: 0mysql> select * from jireportunitinputcontrol where report_unit_id = 2197;+----------------+------------------+---------------+| report_unit_id | input_control_id | control_index |+----------------+------------------+---------------+| 2197 | 2196 | 0 || 2197 | 2195 | 1 |+----------------+------------------+---------------+2 rows in set (0.00 sec) Link to comment Share on other sites More sharing options...
cyberdemos Posted February 3, 2011 Author Share Posted February 3, 2011 Thank you bobtins for your help! Now i'm looking for a way to change report unit layout.. positioning fields as i want as written in first post.... i.e. a mandatory textfield with on its right the read-only description instead bottom... Regards, Cyb. 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