Patch level : 12.0 1086

Files correlati     : ci1300ab.rep ci1300bb.rep ci1300a.rep ci1300a.msk ci1300b.rep ci1.exe

Commento        :

Aggiunti report per beneficiario alla stampa ore per risorsa/attrezzatura

aggiunto logo del beneficiario

sintassi da mettere nel prescript del campo immagine :
LOGO_BENEF
#THIS !

L'Id dell'immagine deve essere LOGO+<codice tipo lavoro>
This commit is contained in:
Alessandro Bonazzi 2021-10-14 17:59:01 +02:00
parent c9e9b2ba47
commit c93ec50c0d

View File

@ -1166,30 +1166,32 @@ void TBook::draw_image(const TReport_rct& rect, const char* filename, const char
{
TReport_rct new_rect(rect);
if (resize && *resize)
if (resize && *resize && filename && *filename)
{
TImage* img = _images.image(filename);
switch (resize[0])
if (img != nullptr)
{
case 'N':
new_rect.set_width(img->width());
new_rect.set_height(img->height());
break;
case 'X':
switch (resize[0])
{
long ratio = long((double(img->height()) / double(img->width())) * 100000.0);
case 'N':
new_rect.set_width(img->width());
new_rect.set_height(img->height());
break;
case 'X':
{
long ratio = long((double(img->height()) / double(img->width())) * 100000.0);
short old_ysize = rect.height();
long new_ysize = rect.width() * ratio / 100000L;
TReport_size s(rect.width(), (new_ysize * lpi()) / cpi());
TReport_pnt o(rect.left(), rect.top() + ((old_ysize - new_ysize) * cpi())/ (2 * lpi()));
TReport_pnt o(rect.left(), rect.top() + ((old_ysize - new_ysize) * cpi()) / (2 * lpi()));
new_rect.set(o, s);
}
break;
case 'Y':
case 'Y':
{
long ratio = long((double(img->width()) / double(img->height())) * 100000.0);
long ratio = long((double(img->width()) / double(img->height())) * 100000.0);
short old_xsize = rect.width();
long new_xsize = rect.height() * ratio / 100000L;
TReport_size s((new_xsize * cpi()) / lpi(), rect.height());
@ -1198,8 +1200,9 @@ void TBook::draw_image(const TReport_rct& rect, const char* filename, const char
new_rect.set(o, s);
}
break;
default:
break;
default:
break;
}
}
}
define_frame(new_rect);