Conversions among units
Hello,
I am developing a new grid component which is a TppStretchable descendant. I
have to show my own grid on the report.
I would like to draw every objects in screen pixels. So I have to calculate
the available page height and width in screen pixels. I use the next code:
FRealPageHeight:= ppToScreenPixels(PrintPosRect.Bottom - PrintPosRect.Top,
utMMThousandths, pprtVertical, nil);
but the result is too small, only 89 pixels. How can I correctly resolve the
unit conversions among the different units? How can I determine the units of
the different objects? For example: What is the actual unit of the
PrintPosRect in the previous code? I used the 'utMMThousandths' but it is
perhaps wrong.
Yours sincerelly,
Robert Makra
MIS Consulting Inc
Hungary
I am developing a new grid component which is a TppStretchable descendant. I
have to show my own grid on the report.
I would like to draw every objects in screen pixels. So I have to calculate
the available page height and width in screen pixels. I use the next code:
FRealPageHeight:= ppToScreenPixels(PrintPosRect.Bottom - PrintPosRect.Top,
utMMThousandths, pprtVertical, nil);
but the result is too small, only 89 pixels. How can I correctly resolve the
unit conversions among the different units? How can I determine the units of
the different objects? For example: What is the actual unit of the
PrintPosRect in the previous code? I used the 'utMMThousandths' but it is
perhaps wrong.
Yours sincerelly,
Robert Makra
MIS Consulting Inc
Hungary
This discussion has been closed.
Comments
The PrintPosRect is not the size of the page being used, it is used to
define the vertical position of the band that is being generated. I would
suggest using the PageDef property of the TppPage object to find this value.
Using the ppToScreenPixels routine to convert from microns to screen pixels
should work correctly. If you would like to see the conversion code, take a
look at the ppUtils.pas file.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
My interpretation was wrong, sorry. So I have to show my grid on detail band
and I tried to calculate the position of detail band in screen pixels.But
the result of height is 89 pixels only (the width is wrong, too). I don't
know why.
FRealBandHeight:= ppToScreenPixels(PrintPosRect.Bottom - PrintPosRect.Top,
utMMThousandths, pprtVertical, nil);
In the example I tried to convert from micron to screen pixels. But I don't
know the current unit of PrintPosRect. Is it in micron or printer pixels or
screen pixels, etc.? Or is it always in Report.Unit? I tried all the
possibility but the result is always really strange. Could you help me
determine the band width and heigth in screen pixels, please?
Best regards,
Robert Makra
MIS Consulting Inc.
Hungary
PrintPosRect is in microns. For an example, check ppMemo.pas, the method
CalcSpaceUsed.
--
Nard Moseley
Digital Metaphors Corporation
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com