TOPIC: More control on report
#1307
More control on report 1 Year, 7 Months ago
I'm trying to print an ID Card using Suneido Report but with no success.
The code I'm using is something like:
Code:


Params(#
(Grid
(
(
(Horz
(Text font: (name: StopD size: 22) "Techimp")
Hskip
(Text font: (name: StopD size: 14) "Impianti s.r.l.")
span: 2)
)
((Hline span: 2))
(
(Vert
(Horz nome_cognome) 
(Horz (Text "N. matr. ") matricola)

(foto)
)
)
border: 1
width: 4818
)
)



but I have no control on how to place text and image with more precision.
Any suggestion?
 
 
#1308
Re:More control on report 1 Year, 7 Months ago
Grid is quite limited.

Try using nested Horz and Vert along with x: and y: positioning.
(See Users Manual > Reports > Containers)

For example:

Code:

Params(#(Vert
    (Horz
        (Text "Techimp")
        (Text "Impianti s.r.l." x: 2)
        )
    (Hline width: 4320 xstretch: 0 y: 1)
    (Text "myname" y: 1.5)
    (Horz
        (Text "N. matr. " x: 2)
        (Text "matricola")
        y: 3)
    ))



Which produces:



Note: x and y are in inches, but Hline width is in twips (inches * 1440)
 
 
Last Edit: 2009/01/22 17:41 By andrew.
 
andrew
 
#1310
Re:More control on report 1 Year, 7 Months ago
Hi,
thanks for reply, but the problem is this one: I would like to have Text "Nominativo:" and follow to be vertically top aligned to the top edge of the picture.

One more requirement is to have a rectangular box drawn around the card but I was not able to reproduce it with a fixed size (ID Card size).
 
 
#1312
Re:More control on report 1 Year, 7 Months ago
You just have to play around till you get what you want. It can be tricky.

Here is something closer to your example:

Code:

#(Rect height: 3300 width: 4500,
    (Vert
        (Horz
            (Text "Techimp" font: (name: Arial, size: 16, weight: 700))
            (Hskip .5)
            (Text "Impianti s.r.l." font: (name: Arial, size: 16, weight: 700))
            )
        (Hline width: 4000 xstretch: 0)
        (Horz
            (TopAlign
                (Image "C:UsersandrewDesktopexportIMG_2514.JPG"))
            Hskip
            (TopAlign (Vert
                (Vskip .4)
                (Text "Nominativo:")
                (Text "Andrew McKinlay" font: (name: Arial, size 13, weight: 700))
                Vskip
                (Text "Matricola:")
                (Text 1)
                ))
            )
        )
    )


 
 
Last Edit: 2009/01/23 20:04 By andrew.
 
andrew
 
#1315
Re:More control on report 1 Year, 7 Months ago
Tnx Andrew, but it doesn't work with Rect and TopAling (which is not documented :).
Using Rect I got the error in picture:


The code is:
Code:


Output:(Rect height: 3300 width: 4500
(Vert
(Horz
(Text font: (name: StopD size: 22) "Techimp ")
(Text font: (name: StopD size: 14) "Impianti s.r.l.")
)
(Text 'Via Stentinello, 9 C.da Targia - 96100 SIRACUSA (SR)' font: (name: Arial size: 8))
(Text 'P.IVA: 01236070890 - Tel.: 0931 751411' font: (name: Arial size: 6))
(Hline width: 4320 xstretch: 0 y: 0)
(Horz
foto
Hskip
(Vert
(Horz (Text 'N. Badge: ') badge_rep)
(Vskip height: .08)
nome_cognome
(Horz (Text 'Nato a: ' font: (name: Arial size: 8)) nascita_comune)
(Horz (Text 'Mansione: ' font: (name: Arial size: 8)) mansione)
(Horz (Text 'Matricola: ' font: (name: Arial size: 8)) matricola_rep)
(Horz (Text 'Valido dal: ' font: (name: Arial size: 8))
valido_dal
(Text 'al: ' font: (name: Arial size: 8))
valido_al
)
)
)
)
)



Using (TopAlign foto) with foto: Field_image
{
Prompt: 'Foto'
Format: (Image width: 1440)
}

the image is not displayed at all.