Display the width before the height in Woocommerce confirmation email - email

In the woocommerce confirmation email the dimension height come before the width. I need to invert it and have the width before height. I think the output of the information is coming from this action:
// allow other plugins to add additional product information here.
do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text );
How can I do this?

Related

Eureka form, TextAreaRow auto height

Can I configure a TextAreaRow of an Eureka form to fill the available vertical space?
I will have just a few rows above and toolbar at the bottom.
You will have to play with textAreaHeight property values by setting up it initial height depending on device and available bottom space. Check out this pull request https://github.com/xmartlabs/Eureka/pull/416/files to see how it works.
You need to use textAreaHeight attribute to change the height dynamically
using .dynamic(with initial height value).
<<< TextAreaRow(){
$0.tag = tag
$0.placeholder = "PlaceHolder"
$0.textAreaHeight = .dynamic(initialTextViewHeight: 96)
}

Set height and width dynamically for page/section in crystal report

I am using crystal report for printing details. I have two issues while printing.
Set height/width dynamically for section details
I want to change the height and width for the section dynamically through code. This height and width will come from user settings so I need those to be dynamic. When I checked, there is a option to set the section height programmatically but its not working. I am using the below code to set the section height
ReportDocument rd = new ReportDocument();
Section section = rd.ReportDefinition.Sections["Section3"];
section.Height = 1;
When I use this code, it gives me error "System.Runtime.InteropServices.COMException: The section height is not valid."
I also want to set "Gap Between Details" dynamically. Is it possible?
Set page content height dynamically
I want to set the page content height dynamically. We can set the page height and width from Design -> Page setup -> Page options -> Set Horizontal and Vertical values.
What is happening in my case is, I am using crystal report tp print barcodes. When the page height is big, it prints empty barcodes which I dont want. I want to set the page content height based on the number of barcodes I am going to print. How can I do this?
Can anybody help me solve these two issues?
I was finding how to resolve this question. For me, this works:
ReportDocument rd = new ReportDocument();
rd.ReportDefinition.Sections["Section5"].Height = 1000;
Try this, ok?
I added a formula field called AutoHeight and a parameter field called Height then I put this code inside the formula:
Local StringVar height = "";
Local NumberVar i;
For i:=1 to {?#Margin} do (
height := height + Chr(10)+Chr(13)
);
height
The final step is to place my AutoHeight formula in the section I want to control with the property Can grow checked

stretch a textField to a max height in jasper reports

I think this is more of a general issue. I would like to use a textfield that gets dynamic data and doesn't stretch more than a given max height. For instance, I have a textfield that, if it gets text that fits in one line, the textfield will be one line height, and i have other elements under it, that will move up with float positioning. Or, if I want a 3 line max height and if the text exceeds that space, then the rest will be trimmed.
I don't want to use java expressions to trim that text, as it is not always accurate. I am new to jasper and I am trying to know if there is any way to do this. I did a lot of searches, but maybe there is something that i missed, and i hope someone can help me. Thank you
I managed to solve this by extending net.sf.jasperreports.engine.fill.TextMeasurer and overriding initialize() method; also I had to extend net.sf.jasperreports.engine.util.AbstractTextMeasurerFactory and override the createMeasurer() method.
Now, whenever I want to have max # of lines, with no overflow, I add a property to that text field (e.g. maxLines) which is being passed to my custom TextMeasurerFactory. I hope this helped you.
We had a similar problem at work with JASPER Reports 4.5, where we had an invoice with a header and a table. We wanted the header to have dynamic height based on the lengths of certain fields (like address, partner name, etc,), but not more than a critical limit, otherwise the header will push the table and thus making a mess by splitting it across multiple pages. Also, the invoice shouldn't exceed 1 page.
We eventually had to move the header in the background section, where we also put a background for the table consisting of vertical lines (so it will extend to the end of an A4 page) and a white opaque square.
This way, if the header exceeds the max height it will go underneath the table's background, cropping the text. This was the desired effect we were looking for.
Sounds crazy, but it worked ...

How to stretch a text field relative to data width in Jasper Reports

I have a text field followed by a static text field and I am trying to do 2 things with it:
Get the text field to stretch horizontally (not wrap) when text is longer then the field width and
Push the static text field right when the text field to the left of it stretches
Both of the fields are contained within a frame.
I have both fields set to positionType=float and the text field set to stretchWithOverflow=true, which enable text to wrap vertically but not stretch horizontally.
Is it possible to achieve 1 and 2 above? If so How?
Instead of having 2 text fields (dynamic and static), you can have 1 text field with value as $F{Field} + "statix text". This will probably fix your issue. Also, you can set the "width" and "stretch with overflow" properties, as per your requirements.
Well it's bad news!! According to Jaspersoft's documentation on stretching fields it is not possible to stretch the width of a field:
"Usually, the stretching process refers to the height adjustment only.
When stretching report elements, adjusting the width could affect also
the page width and raise unexpected errors at runtime (for instance,
truncated information could be printed out on pages). This is why
stretching an element let its width unchanged, while its height gets
definitely enlarged in order to make room for all information that
have to be displayed." (Jaspersoft documentation [v4.5.0], 2011)
However a solution to the original issue can be found here thanks to #mdahlman
Just select text field and from its textfield properties choose "stretch with overflow" and it will change its height dynamically according to text .enter image description here

Custom field size in Plone 4 using Dexterity

A quickie: how does one specify a custom field size (width and height) in a schemata using Dexterity?
For example, a textarea (schema.Text) width is set to 100%. I'd like to specify a default width and height, to make it more useful.
How does one achieve this? I tried looking into plone.directives.form, but couldn't find anything.
The 100% width is actually coming from public.css, and not anything in Dexterity or z3c.form. If you want to override it, you could do so with your stylesheet, or if it is specific to that particular field, you could specify the "style" attribute in your field schema to supply field-specific inline CSS.