Crystal Report conversion from cm to inches - crystal-reports-xi

In my crystal report I have column values for width and height. I wanted them to be in inches. when I searched how to convert, I came across changing the settings in regional language etc. Even after doing all those it did not reflect changes.
Can anyone please help?
I am new to crystal report.

1 cm = 0.15500030984252 in
what you could do is create 2 formulas, one for width and another for height , then do the conversion inside and replace your field for this formulas on their respective columns. For example, WidthConverted(your width field*0.155) and HeightConverted(your height field * 0.155)

I figured out 1 Inch = 1440 Twips
For example if an object has Width = 4725 and Height = `1455'
Then its dimensions in inches are W = 3.28 and H = 1.01

Related

Dynamically find a value in between a range of Values in Google Sheets

In google sheets, I have a data set that identifies historical pricing multiplyers for a product in certain size ranges. I'm using square inches in this case. The data is set up in a table like this:
Data set
What I've done is create a formula that allows me to specify any width, height and quantity, find the current square inches, then find the corresponding price for this specific sized product based on where it falls on the range of sizes that I've provided in the data set.
For example, if the square inches equals 150, the price for this size is .6 (or 60 cents) per square inch. (90)
I've already solved this. This is the formula I have:
=(A10*B10)*C10)*(filter(C2:C6,A2:A6<=((A10*B10)*C10),B2:B6>((A10*B10)*C10))
In this example, A10 = height, B10 = width, and C10 = quantity
So, like I said, this works just fine. My problem is that a product with a square inch value of 105 will ultimately have the same cost per square inch as a product with a square inch value of 214. It's only after it crosses the 250 square inch threshold that my cost per square inch will change.
Is there a way to dynamically find the appropriate multiplyer, so that, for instance, a square inch value of 175, would have a multiplyer between .8 and .6 since it falls in the middle of 100 square inches and 250 square inches?
I will try to assume that you have some kind of calculator for calculating coefficients.
If value of the area in C13 then in A16:C17 we can get the calculate range. Put in to A16
=ARRAY_CONSTRAIN(OFFSET(A2:C6,MATCH(C13,A2:A6,1)-2,0),2,3)
After that we can calculate part of price
=IF(ISNUMBER(A16),C16-(C16-C17)*(C13-A17)/(B17-A17),C17)
One formula solution
=VLOOKUP(C13,B2:C6,2)-
(VLOOKUP(C13,B2:C6,2)-VLOOKUP(C13,A2:C6,3))*
(C13-VLOOKUP(C13,A2:C6,1))/
(VLOOKUP(C13,A2:C6,2)-VLOOKUP(C13,A2:C6,1))
The best solution is use a TREND. It's very clear.
=TREND(
OFFSET(B2,MATCH(C13,B2:B3)-1,1,2,1),
OFFSET(B2,MATCH(C13,B2:B3)-1,0,2,1),
C13
)
My sample
References
VLOOKUP
ARRAY_CONSTRAIN
OFFSET
TREND
I trust you'll forgive me if I don't explain the math involved, but this formula should produce the result you want:
=(A10*B10*C10)*(VLOOKUP(A10*B10*C10,A2:C6,3,TRUE)+(((A10*B10*C10)-VLOOKUP(A10*B10*C10,A2:A6,1,TRUE))*(ABS(VLOOKUP(A10*B10*C10,A2:C6,3,TRUE)-INDEX(C2:C6,MATCH(VLOOKUP(A10*B10*C10,A2:C6,3,TRUE),C2:C6,0)-1))/(VLOOKUP(A10*B10*C10,A2:B6,2,TRUE)-VLOOKUP(A10*B10*C10,A2:A6,1,TRUE)))))

Calculate real TQRMemo Height on QuickReport

I have several memos with different font on QuickReport. Now I'd like to know the most bottom point for all (for set some shape below). How? If I calculate TextHeight for each and multiple by lines count (aMemo.ParentReport.TextHeight(aMemo.Font, 'W') * aMemo.Lines.Count), results are not correctly - QuickReport print lines like with strange height and position of my shape for some fonts are too high or too low.
Ok, I got it. TextHeight cannot be call from QuickReport, but from Printer.Canvas. Then divide it by Y-Resolution for printer, next divide by 254 and multiple by 96. Result will be round and this is real value of Height of text in TQRMemo. All values are not accessible before print from QuickReport. It's very "smart" to return not real values based on same properties like during printing by component (by TQuickRep.TextHeight method).

How to set the label count for X axis in LineChartView?

In my data, I have hundreds of values for the x-axis, but I want to show only 6 or 7 of them at equal intervals so that my whole range of x-axis values are covered, but I am facing an issue as I am not able to show a limited number of values on the x-axis . I tried these
lineChartView.xAxis.spaceMin = 4
lineChartView.xAxis.spaceMax = 7
lineChartView.xAxis.xOffset = 6
lineChartView.xAxis.labelCount = 6
, but it is not working .Here is my screenshot for the display
The axis property granularity is used to specify the minimum interval between axis values. The default value is 1. Currently in my app i have it set to 0.5 to force all values to be displayed, but I only have 10 or so on the chart at once.
chartView.xAxis.granularity = 0.5
Perhaps setting this to a higher value will help you.

Relation between Pixels and Points in blackberry

I need to know the relation between points and pixels and how it affects different BB 7.0 and lower version devices.
I have a project which parses values of width and height of components to be displayed in points and I have converted them into pixels and shown on different devices using the following formula.
fldwidth = fldwidth*Display.getWidth()/100
fldheight = fldheight*Display.getHeight()/100
where initially the values of fldwidth and fldheight has pt values in decimal.
Am I correct
A point is, by definition, 1/72 of an inch - see Wikipedia Point_(typography)
The size of pixel is dependent on the screen resolution on the device. Just to be clear, this is resolution normally stated in dots per inch (dpi). This is not the common usage for the term resolution which is the pixel height and width of the screen. People use resolution in this way incorrectly. Resolution is the density of dots on the screen, not the number of pixels on the screen.
The point here is that there is NO relationship between the number of pixels displayed on the screen with the number of pixels that are required for a point. You can not use the conversion that you are attempting.
To determine the number of pixels that match 1 point, you must get the resolution of the screen. BB provides two methods for this:
Display.getHorizontalResolution();
Display.getVerticalResolution();
Fortunately, these will give you the same value on all BBOS (Java) devices, as all BBOS devices have the same vertical and horizontal resolution.
The value supplied is the number of pixels in one metre. So all you need to do is determine how many 1/72s of an inch there are in 1 metre, divide one of these values by that number, and then you have the number of pixels in a point.
Because of integer arithmetic, when doing this calculation, I would multiply by the point size you are trying to achieve before doing the division. For example:
int pixelSizeReqd = pointSizeReq *
Display.getHorizontalResolution() / pointsInOneMetre;
And by the way, just call Display.getHorizontalResolution() once and reuse the returned value. I am not sure about getHorizontalResolution(), but I do know that some Display methods, for example, getHeight() and getWdith() are 'expensive' so should be avoided if possible. The value is not going to change anyway!
Update following this comment:
Can you explain in an example . Suppose I got a device 8520 (320x240 resolution) i have a point (say 57pt) what would be its corresponding pixel value as per your formula ... int pixelSizeReqd = pointSizeReq * Display.getHorizontalResolution() / pointsInOneMetre
Answer:
Note that the 8520 has a screen size of 320 x 240. That is not its screen resolution for the purposes of this discussion. Got that?
You want a size of 57 points. So the calculation is:
int pixelSizeReqd = 57 * Display.getHorizontalResolution() / pointsInOneMetre;
You shouldn't replace Display.getHorizontalResolution() with a figure - it will be different on different devices and there is no need for you to try to fix this value for yourself.
How many points are there in 1 metre? You can do the math, convert a 1/72 inch into metres and then divide 1 metre by this. Or you can type into Google "how many points in a meter" and get the answer 2,834.64567. We don't need the accuracy, so we just use integer arithmetic to give us this:
int pixelSizeReqd = 57 * Display.getHorizontalResolution() / 2834;
Job done - that wasn't too hard was it?

How can I know the line number of editfield of blackberry

I would like to know the line number in EditField while I am typing some text in this component.
Get the width of the edit field. (int returned) (e.g. 320 px)
Get the font width of your current text. Font class have getAdvance() method that accepts the string parameter (int returned) (e.g. 650 px)
if string width > edit field width you can divide string width and edit width and on the other step get the modulo of it. (here you will get 2 as division and 10 will be yr modulo. That means you have filled two lines + in third line you are having characters that can be fit into 10 px.
I hope it will solve your problem, but be careful if you use any long words, the module had never been tested with long words but I fear about result's accuracy with long words.

Resources