Calculate length, width and height of a product - magento

I have the following problem. I want to get the product price calculated through the lengt, width and height.
The length and width are calculated through a csv-file, but not the height. The height should be priced for each 5cm( till 10cm +0€, till 15cm +5€, till 20cm +10€ etc.).
I have tried some different things, but never reached my goal. My next idea is, that the height is calculated by two areas: the first would be a dropdown menu, where the customer can select ranges like in the example above. The second would be a text field, where the customer can write the wanted cm value. The problem is, that the customer can select e.g. "till 10cm +0€" in the dropdown and then writes e.g. 25cm. So he would get the wanted value for free.
My question: Is there a way to connect those two areas and limit the text field to the chosen dropdown range (e.g. dropdown: till 20cm +10€ -> text field limit: customer can write anything between 16 and 20cm). Or are there any better and simpler?
I thank you very much in advance for your answers.
Best Regards,

The idea would be to use options of product.
A configuration part must be done in back office for each product where you want to set the height. In my idea there are two options : the exact height (if you need it for order) and a dropdown that will not be displayed but that contains the prices range. For this dropdown, you use a pattern like you said (till 20cm or <20 as it would not be display I would use a pattern easy to parse with JS).
On front, you hide this select and when a client enters a value for the height, you set the undisplayed select with the correct values range and retrieve the price to display to the user all in JavaScript.

Related

Oracle Apex - Display Item as a Percentage

I'm trying to show a text field item as a percentage, issue is that there are several queries depending on this item (it refreshes reports based on the value).
Right now I have decimal values in there (1 = 100% , 0.5 = 50% and so on).
But the customer is asking to show this item as a percentage (50% when I have 0.5).
Does anyone know how to achieve this?
PS: The #col_name#% approach doesn't work well for this case.
Thanks
One way to solve this is to have the a 2nd item.
Suppose the base item is P1_COMMISSION and that is the value stored in the database - I suppose that would be a value between 0 and 1. Create another item called P1_COMMISSION_PCT which is displays the percent value. If this is a form item, this item would not have a database columns as source.
Make P1_COMMISSION hidden
Add a computation after the form initialisation to calculate the P1_COMMISSION_PCT based on P1_COMMISSION
Add a dynamic action on change of P1_COMMISSION_PCT to recalculate the value of P1_COMMISSION
One option is to
set current item to be hidden (so that you wouldn't see 1 or 0.5 as its values, but other objects would still be able to use it) and
create a new, display only item, whose source would be current item, but properly formatted, e.g.
TO_CHAR(TO_NUMBER(:P1_COL_NAME) * 100) || '%'

Indicators in a matrix

I'm trying to add some indicators into a matrix to show an increase or decrease from the previous year
This is my design view
And this is how it's viewed in the report
I would obviously like my up and down arrows to appear in the currently empty columns. Also I'm wondering if there is a way of deleting the first empty column after 2014/15 as there is no year to compare it to.
SSRS supports a function called Previous, which will be useful in your scenario. Assuming that the name of your column group is "Fiscal", the difference of two years can be calculated as
=Count(Fields!IDNUMBER.Value) - Previous(Count(Fields!IDNUMBER.Value), "Fiscal")
Because you can't know the range of the numbers in advance, I suggest to use a "numeric" expression like
=Sign(Count(Fields!IDNUMBER.Value) - Previous(Count(Fields!IDNUMBER.Value), "Fiscal"))
for the indicator, so the ranges can be defined by single values -1, 0 and 1:
To hide the first indicator column, right-click the column header in design view and click Column Visibility..., then in the cnfiguration dialog specify to hide based on an expression like
=IsNothing(Previous(Fields!Fiscal.Value, "Fiscal"))
Here's a screenshot of my design view:

SSRS Scope with Row and Column groups issues

I'm trying to get percentage calculated for my tablix and have problem on very last column, which is outside of Column Group, can't make it work, I can't use Dataset as I have a filter on tablix level. Pic below illustrates all my setup. I Understand if you stay inside the box then you have all right scopes, curious if I can do any right click and see what scope is ??)
I need somehow to get value =1837 to use in pink boxes.
I tried to digest error message and tried all combo but not helps
Is this doable?
You can refer to your very last column which is outside the groups and the deatils with the following expression. Lets say your Total from YTD is in Textbox1. Then you can refer to this textbox (because its outside the detail rows):
=ReportItems!Textbox1.Value 'Result: 1837
But a better way to calculate the percentage in the pink boxes would be the following expression (this expression comes in the pink box):
=Sum(Fields!YTDDetail.Value, "TurnDays") / Sum(Fields!YTDDetail.Value, "Dataset")
This way you are dividing the grouped sum with the whole sum, which should result in your percentage if you format the output of the texbox as Number > Percentage.

Cut off space between two fields in dynamics CRM

I've two fields on account form, one is two option(checkbox) and other is text box. As par my requirements, I've to not show the label of the checkbox but show them as simple fields without caption. I am done with it but stuck in a problem that it create a huge space between two fields, as shown in following screenshot. I would like to hear from your side to resolve this problem.
You could try this:
Set the tab to two columns, settings the first column around 5-10% (experiment with the value)
put the checkboxes in the first section, the other fields in the second one
set the first section to have 1 pixels for label width (instead of default 115)
I'm not sure how it would turn out, and would probably need some tweaking (to account for different form/window widths) but you might accomplish something close to what you need.
Another approach would be to build a custom HTML webresource, put it in an IFRAME as the only form element, and rebuild the form from scratch as you like... but it's probably best left as a last-est resort
You can convert the section from 2 columns to 4 columns, span the textbox field to 3 columns. This will reduce the checkbox field columns to 25% and textbox to 75%
This is the maximum we can do in supported way.

Hide some charts and show other in one report

I have a report with 24 charts, one for each hour of the day. The user can choose to show one, a couple, or all the charts, based on a drop down. The drop down is tied to a parameter that allows multiple values. See below:
The problem is that if the user chooses one or a few hours from the drop down, all the charts show, and the one(s) chosen give data while the others say "no data available".
Currently for each chart I've added the following to show data if the value was chosen in the drop down:
=Switch(Parameters!HOURINPUT.Value(0) = "0", false)
Is there a way to hide the charts that the user did not choose from the drop down?
It would look nicer to hide the chart and see only the ones chose than have a blank box that says "no data available" in them.
UPDATE:
More than one parameter.
Assuming that the only differences between the charts are the hour of the day specified, then I suggest:
Add a new dataset to the report with values 0 to 23 as selected in the entered HOURINPUT parameter - something like: with cte as (select 0 n union all select n+1 n from cte where n < 23) select n report_hour from cte where n in (#HOURINPUT)
Add a new tablix to the report, with a single detail cell only, bound to your new dataset.
Move one of the existing graphs into the new table's detail cell so that it becomes a subreport, replacing all hard-coded time references in the graph with references to the report_hour value from the new dataset.
You can then remove the other 23 graphs.
In addition to ensuring that graphs are only displayed for the times selected, this should also simplify future maintenance of the report, since any changes required to a graph will only have to be entered onto the one graph (instead of all 24).

Resources