cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Height of a datacard

Hi, I have an app sourced from an Excel file on OneDrive. One of the datacards has much more text than the others. I've had to turn Auto height off, as Auto height seems to have a limit that cuts out a lot of the text. Therefore, I've given the datacard a height that is equal to the biggest text feild. The problem now is that the quantity of text for that datacard varies quite a lot, so some searches have an empty white area before the next datacard. Is there any Height code I can use - or any other solution? Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
dinusc
Microsoft
Microsoft

I can't think of another straightforward way of making the field or card size adjustable to the text content. 

Instead of setting the card size to accomodate the largest text, can you try making the corresponding card field scrollable (Overflow = Scroll)? This would allow having smaller cards.

View solution in original post

11 REPLIES 11
dinusc
Microsoft
Microsoft

I can't think of another straightforward way of making the field or card size adjustable to the text content. 

Instead of setting the card size to accomodate the largest text, can you try making the corresponding card field scrollable (Overflow = Scroll)? This would allow having smaller cards.

View solution in original post

Anonymous
Not applicable

This worked - and it also improved the functionality and design of my app in the process! Many thanks! 

Hello Dinusc,

I created a simple SharePoint Form from a custom list and am struggling to adjust the datacard height values - they seem to have a limit set on their height property, and the minimum height allowed is still too tall! I looked for a way to implement your recommended solution (Overflow=Scrollable) but I can't seem to find said property?  Am I missing something?  Where can I set the "Overflow"?

Thanks!

Hi Kbarber,

 

My suggestion was to set the overflow on the label inside the card. This is to ensure that any content can be displayed in the label field that is a part of fixed-size data card.

Capture.PNG


Thanks for the clarification @dinusc. While helpful in its own right, I don't think it will address my issue.  Here is a link to my post in case you're interested in getting more details:

https://powerusers.microsoft.com/t5/General-Discussion/Height-of-datacards-in-SP-List-Custom-Form/m-...

SJacobs
Frequent Visitor

Here's how I resolved this issue:

 

1) Card is only one in its row and WidthFit = True

2) Set Card Height to 0

3) In the data card Text Input control, enter formula for height:

           30 + ((RoundUp(Len(Parent.Default)/100,0) -1) *20)

 

This will effectively give me the AutoHeight feature i was looking for.

 

Explanation of the formula:   30 +((RoundUp(Len(Parent.Default)/100,0) -1) *20)

30 = minimum height

100 = characters per row

20 = height per row

thanks @SJacobs - I'll give this a try soon - seems to be quite a clever workaround

SJacobs
Frequent Visitor

I have had to modify that formula to address the possiblity of null values and linefeed characters within the text.   Blank values are handled by adding 15 if IsBlank returns true.  Linefeed characters is more of a problem.  I searched for Char(10) and added 20 to height if found, but that only works if there is a single linefeed.  I do not know how to count the number of linefeeds within a string.

 

Here's my current version of the formula for height.

 

35 + ((RoundUp(Len(Parent.Default)/100,0) -1) *20) +If(Find(Char(10),Parent.Default)>0,20,0) + If(IsBlank(Parent.Default),15,0)

 

Note: I'm using OpenSans size 13 font. Line Height is set to 1.2

nickduxfield
Responsive Resident
Responsive Resident

I had a situation where I was trying to mimic an editable PDF. I had HTMLText for the DataCardKey's to present nice formatted Questions. No matter how meticulus I was witht he HTML the auto height would fail on one of the many fileds. 

What I did was a bit interesting.

I have a Large list with all the formatted HTML questions in a sharepoint list. 

Title, Body, Height, Part

Body is the HTML, Part is the PartNumber, Height is how big I want the KEY size.

I used simple lookups to pull the correct height for each DataCard. Its a static approach but its solid and the questions wont change once setup. Because the Columns were names Part1,Part2,Part3... I was able to hookup Lookups that refer to the DataField name "Part1". Because of this the same Code applied across all Datacards.

 

Auto height sometimes wont workout esp in HTML text controls.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (45,048)