Problem with components size
Hi everybody.
I need to design a report in FR that repeat an image x times.
I indicate it the size of the page and the number of columns & rows. It must to fill the page.
I have the next code in the startReport event:
- Set the size of the page (I've set constant values now, but in the application they will be user defined ones)
- Set the number of columns and rows
- Calculate the height and the width of the cell
- Set the size of the band and the number of columns
- Set the size of the picture and its position
So, it prints the page correctly: a page of 150x200 mm
But the images (and the cells) would be of 18.75x20 mm (150/8=18.75 200/10=20)..... but it prints them with a 5x5.5 size.
Why? I can't understand it. What kind of scale is FR using internally?
Thank's for supporting.
I need to design a report in FR that repeat an image x times.
I indicate it the size of the page and the number of columns & rows. It must to fill the page.
I have the next code in the startReport event:
- Set the size of the page (I've set constant values now, but in the application they will be user defined ones)
  alto:= 200;
  ancho:= 150;
  Page1.PaperHeight:= alto;               Â
  Page1.PaperWidth:= ancho;
- Set the number of columns and rows
  filas:= 10;
  columnas:= 8;
- Calculate the height and the width of the cell
  altoFila:= alto / filas;
  anchoColumna:= ancho / columnas;
- Set the size of the band and the number of columns
  MasterData1.ColumnWidth:= anchoColumna;                                                             Â
  MasterData1.Columns:= columnas;     Â
  MasterData1.Height:= altoFila;
- Set the size of the picture and its position
    Picture1.Width:= anchoColumna;
    Picture1.Height:= altoFila;
    Picture1.KeepAspectRatio:= false;
    Picture1.Left:= (anchoColumna / 2) - (Picture1.Width / 2);
    Picture1.Top:= (altoFila / 2) - (Picture1.Height / 2);
So, it prints the page correctly: a page of 150x200 mm
But the images (and the cells) would be of 18.75x20 mm (150/8=18.75 200/10=20)..... but it prints them with a 5x5.5 size.
Why? I can't understand it. What kind of scale is FR using internally?
Thank's for supporting.
Comments
Objects??? coordinates and sizes are set in pixels. Since the ?«Left,?» ?«Top,?» ?«Width,?» and ?«Height?» properties of all objects have the ?«Extended?» type, you can point out non-integer values. The following constants are defined for converting pixels into centimeters and inches:
fr01cm = 3.77953;
fr1cm = 37.7953;
fr01in = 9.6;
fr1in = 96;
For example, a band???s height equal to 5 mm can be set as follows:
Band.Height := fr01cm * 5;
Band.Height := fr1cm * 0.5;
Thank you so much.