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)
  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

  • gordkgordk St.Catherines On. Canada.
    edited 10:16AM
    Programmers manual Creating a report.

    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;
  • edited 10:16AM
    Tomorrow I'll try it.

    Thank you so much.
  • edited 10:16AM
    It worked fine. Thank's

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.