This is a migrated thread and some comments may be shown as answers.

Simulate vertical stackpanel in Reporting

4 Answers 135 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 12 Jul 2011, 03:10 PM
Hi,

In my report header I have a number of fields placed vertically.  If there is no data for one or more of these fields I would like the fields with data to move up vertically to take the place of the missing fields i.e. same functionality as a vertically oriented stackpanel.  Each field has a matching label with a different format to the data field (if they all had the same format I could achieve this quite simply in a single textbox): 

Contact: John
Phone: 555-555-5555
Fax: 555-555-55555
Email: john@company.com

(e.g. if there was no Fax number for John then the email row would move up to to the position of the Fax row).

I imagine I could do this in code by positioning the fields manually but I'm hoping there is a better way.

What is the recommended method for achieving this?

Thanks,
Steve

4 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 15 Jul 2011, 02:22 PM
Hi Stephen

If certain report item visibility is set to false the Telerik Reporting engine will move the items below in way to occupy the free space. Thus our suggestion is to set up a conditional formatting for setting the TextBox.Visibility to False with the following formatting rule:

Expression  Operator  Value 
 =IsNull(Null,"")  =""


All the best,
Peter
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Stephen
Top achievements
Rank 1
answered on 15 Jul 2011, 02:54 PM
Hi Peter,

Thanks for your reply.  

I simply tried setting the visibility of the fields (e.g. Phone 555-555-5555 from original post) to false directly in the textbox properties, previewed the report and the result was that the fields are not shown but the fields below do not move up - I'm not sure why they would without doing something else.

What am I missing?!

Thanks,
Steve
0
Peter
Telerik team
answered on 15 Jul 2011, 04:27 PM
Hi Stephen,

Generally if you have other items in the same section/panel they will interfere and stop the items below from moving up. Thus you can nest the stacked items within a Panel item to avoid any interference with any other report items. Check out the attached sample report as well as Design Considerations for Report Item Layout help article.

Kind regards,
Peter
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Stephen
Top achievements
Rank 1
answered on 15 Jul 2011, 04:45 PM
Thanks Peter,

The panel was the missing piece.  I had other fields to the right that were displayed thereby preventing the contact fields from moving up.

Thanks again,
Steve
Tags
General Discussions
Asked by
Stephen
Top achievements
Rank 1
Answers by
Peter
Telerik team
Stephen
Top achievements
Rank 1
Share this question
or