sotto la minaccia di un coccodrillo (prima aveva i baffi ed era più simpatico Ghigno)Si si , e adesso che è pentito di ciò che ha fatto, si è vestito da bambino per farsi perdonare :P :P :P :P :P :P
ciao raga
sotto la minaccia di un coccodrillo (prima aveva i baffi ed era più simpatico ;D)....
ottima iniziativa, per completare il tutto potreste anche scrivere qualcosa in proposito sul wiki :P
Senta Lei, lasci fare questo lavoro a chi lo sa fare e chi lo fa da anni...non tutti possono dire di scrivere sul wiki copn la tenacia e la rottura di balle con cui lo dico io....pivello!!!si infatti si vedono i risultati....... forse è meglio che vai in pensione :P
@Ceskho
Grazie che mi hai sistemato il wiki.
Per MilioSe mi dici dovè il codice..Penso fosse rivolto am me :D
si in effetti multicell faceva la stessa cosa ma una sola cella per riga, in pratica sulla stessa riga non si potevano mettere più celle e bisognava andare a capo.Esatto, inoltre se fosse possibile inserire più celle nella stessa riga, i rettangoli verrebbero con altezze diverse.
A meno che non siamo riusciti a settare bene multicell
PRIVATE $lasthmulti AS Integer
PUBLIC SUB Cell2(w AS Float, OPTIONAL h AS Float = 0, OPTIONAL txt AS String = "", OPTIONAL border AS Variant = FALSE, OPTIONAL ln AS Integer = 0, OPTIONAL align AS String = "", OPTIONAL fill AS Boolean = FALSE, OPTIONAL slink AS String = "")
DIM k, x, y, ws, dx, wmax, wlink AS Float
DIM s, op, txt2 AS String
'Output a cell
k = $k
IF (w = 0) THEN w = $w - $rMargin - $x
s = ""
IF (IsBoolean(border)) THEN
IF (fill OR border) THEN
op = IIf(fill, IIf(border, "B", "f"), "S")
s = _stringFloat($x * k, "0.00") & " " &
_stringFloat(($h - $y) * k, "0.00") & " " &
_stringFloat(w * k, "0.00") & " " &
_stringFloat(- h * k, "0.00") & " re " & op & " "
END IF
ELSE IF (IsString(border)) THEN
x = $x
y = $y
IF (InStr(border, "L")) THEN
s &= _stringFloat(x * k, "0.00") & " " &
_stringFloat(($h - y) * k, "0.00") & " m " &
_stringFloat(x * k, "0.00") & " " &
_stringFloat(($h - (y + h)) * k, "0.00") & " l S "
END IF
IF (InStr(border, "T")) THEN
s &= _stringFloat(x * k, "0.00") & " " &
_stringFloat(($h - y) * k, "0.00") & " m " &
_stringFloat((x + w) * k, "0.00") & " " &
_stringFloat(($h - y) * k, "0.00") & " l S "
END IF
IF (InStr(border, "R")) THEN
s &= _stringFloat((x + w) * k, "0.00") & " " &
_stringFloat(($h - y) * k, "0.00") & " m " &
_stringFloat((x + w) * k, "0.00") & " " &
_stringFloat(($h - (y + h)) * k, "0.00") & " l S "
END IF
IF (InStr(border, "B")) THEN
s &= _stringFloat(x * k, "0.00") & " " &
_stringFloat(($h - (y + h)) * k, "0.00") & " m " &
_stringFloat((x + w) * k, "0.00") & " " &
_stringFloat(($h - (y + h)) * k, "0.00") & " l S "
END IF
END IF
IF (txt <> "") THEN
SELECT CASE align
CASE "R"
dx = w - $cMargin - ME.GetStringWidth(txt)
CASE "C"
dx = (w - ME.GetStringWidth(txt)) / 2
CASE "FJ" 'Justify
'Set word spacing
wmax = (w - 2 * $cMargin)
$ws = (wmax - ME.GetStringWidth(txt)) / (Split(txt, " ").Count - 1)
_out(_stringFloat($ws * $k, "0.000") & " Tw")
dx = $cMargin
DEFAULT
dx = $cMargin
END SELECT
IF ($ColorFlag) THEN s &= "q " & $TextColor & " "
txt2 = Replace(Replace(Replace(txt, "\\", "\\\\"), "(", "\\("), ")", "\\)")
txt2 = convcharacters(txt2)
s &= "BT " & _stringFloat(($x + dx) * k, "0.00") & " " &
_stringFloat(($h - ($y + 0.5 * h + 0.3 * $FontSize)) * k, "0.00") & " Td (" & txt2 & ") Tj ET"
IF ($underline) THEN s &= " " & _dounderline($x + dx, $y + 0.5 * h + 0.3 * $FontSize, txt)
IF ($ColorFlag) THEN s &= " Q"
'IF (slink) THEN ME.Link($x + dx, $y + 0.5 * h - 0.5 * $FontSize, ME.GetStringWidth(txt), $FontSize, slink)
IF (slink) THEN
IF (align = "FJ") THEN
wlink = wmax
ELSE
wlink = ME.GetStringWidth(txt)
END IF
ME.Link($x + dx, $y + 0.5 * h - 0.5 * $FontSize, wlink, $FontSize, slink)
END IF
END IF
IF (s) THEN _out(s)
IF (align = "FJ") THEN
'Remove word spacing
_out("0 Tw")
$ws = 0
END IF
$lasth = h
IF (ln > 0) THEN
'Go to next line
$y += h
IF (ln = 1) THEN $x = $lMargin
ELSE
$x += w
END IF
END
PUBLIC SUB MultiRiga(w AS Float, h AS Float, txt AS String, OPTIONAL border AS Variant = FALSE, OPTIONAL align AS String = "J", OPTIONAL fill AS Boolean = FALSE)
DIM cw AS Integer[]
DIM wmax AS Float
DIM s, b, b2, c AS String
DIM nb, sep, i, j, l, ns, nl, ls AS Integer
DIM numeroriga AS Integer
DIM salva$y AS Integer
DIM hriga AS Integer
salva$y = $y
numeroriga = 0
'Output text with automatic or explicit line breaks
cw = $CurrentFont["cw"]
IF (w = 0) THEN w = $w - $rMargin - $x
wmax = (w - 2 * $cMargin) * 1000 / $FontSize
s = Replace(txt, "\r", "")
nb = Len(s)
IF (nb > 0) AND IF (Mid(s, nb, 1) = "\n") THEN DEC nb
b = 0
IF (IsBoolean(border) OR IsInteger(border)) THEN
IF (border) THEN
border = "LTRB"
b = "LRT"
b2 = "LR"
END IF
ELSE IF (IsString(border)) THEN
b2 = ""
IF (InStr(border, "L")) THEN b2 &= "L"
IF (InStr(border, "R")) THEN b2 &= "R"
b = IIf(InStr(border, "T"), b2 & "T", b2)
END IF
sep = -1
i = 1
j = 1
l = 0
ns = 0
nl = 1
WHILE (i <= nb)
'Get next character
c = Mid(s, i, 1)
IF (c = "\n") THEN
'Explicit line break
IF ($ws > 0) THEN
$ws = 0
_out("0 Tw")
END IF
numeroriga += 1
ME.Cell2(w, h, Mid(s, j, i - j), b, 2, align, fill)
INC i
sep = -1
j = i
l = 0
ns = 0
INC nl
IF (IsBoolean(border) OR IsInteger(border)) THEN
IF (border AND nl = 2) THEN b = b2
ELSE IF (IsString(border)) THEN
IF (NOT IsNull(border) AND nl = 2) THEN b = b2
END IF
CONTINUE
END IF
IF (c = " ") THEN
sep = i
ls = l
INC ns
END IF
l += cw[Asc(c)]
IF (l > wmax) THEN
'Automatic line break
IF (sep = -1) THEN
IF (i = j) THEN INC i
IF ($ws > 0) THEN
$ws = 0
_out("0 Tw")
END IF
numeroriga += 1
ME.Cell2(w, h, Mid(s, j, i - j), b, 2, align, fill)
ELSE
IF (align = "J") THEN
$ws = IIf(ns > 1, (wmax - ls) / 1000 * $FontSize / (ns - 1), 0)
_out(_stringFloat($ws * $k, "0.000") & " Tw")
END IF
numeroriga += 1
ME.Cell2(w, h, Mid(s, j, sep - j), b, 2, align, fill)
i = sep + 1
END IF
sep = -1
j = i
l = 0
ns = 0
INC nl
IF (IsBoolean(border) OR IsInteger(border)) THEN
IF (border AND nl = 2) THEN b = b2
ELSE IF (IsString(border)) THEN
IF (NOT IsNull(border) AND nl = 2) THEN b = b2
END IF
ELSE
INC i
END IF
WEND
'Last chunk
IF ($ws > 0) THEN
$ws = 0
_out("0 Tw")
END IF
IF (IsString(border)) THEN
IF (NOT IsNull(border) AND InStr(border, "B")) THEN b &= "B"
END IF
ME.Cell2(w, h, Mid(s, j, i - j), b, 2, align, fill)
IF numeroriga = 0 THEN
hriga = h
ELSE IF numeroriga = 1 THEN
hriga = (h * 2)
ELSE IF numeroriga = 2 THEN
hriga = (h * 3)
ELSE IF numeroriga = 3 THEN
hriga = (h * 4)
ELSE IF numeroriga = 4 THEN
hriga = (h * 5)
ENDIF
$lasthmulti = Max($lasthmulti, hriga)
$y = salva$y
$x += w
END
PUBLIC SUB Lnm()
'Line feed; default value is last cell height
DIM k, x, y, ws, dx, wmax, wlink AS Float
IF ($y + $lasthmulti > $PageBreakTrigger AND NOT $InFooter AND AcceptPageBreak()) THEN
'Automatic page break
x = $x
ws = $ws
IF (ws > 0) THEN
$ws = 0
_out("0 Tw")
END IF
ME.AddPage($CurOrientation)
$x = x
IF (ws > 0) THEN
$ws = ws
_out(_stringFloat(ws * k, "0.000") & " Tw")
END IF
END IF
$x = $lMargin
$y += $lasthmulti
$lasthmulti = 0
END
PUBLIC SUB MultiRect(w1 AS Float, w2 AS Float, w3 AS Float, w4 AS Float, w5 AS Float, w6 AS Float, w7 AS Float)
IF w1 > 0 THEN ME.Rect($lMargin, $y, w1, $lasthmulti, "")
IF w2 > 0 THEN ME.Rect($lMargin + w1, $y, w2, $lasthmulti, "")
IF w3 > 0 THEN ME.Rect($lMargin + w1 + w2, $y, w3, $lasthmulti, "")
IF w4 > 0 THEN ME.Rect($lMargin + w1 + w2 + w3, $y, w4, $lasthmulti, "")
IF w5 > 0 THEN ME.Rect($lMargin + w1 + w2 + w3 + w4, $y, w5, $lasthmulti, "")
IF w6 > 0 THEN ME.Rect($lMargin + w1 + w2 + w3 + w4 + w5, $y, w6, $lasthmulti, "")
IF w7 > 0 THEN ME.Rect($lMargin + w1 + w2 + w3 + w4 + w5 + w6, $y, w7, $lasthmulti, "")
END
FOR EACH MyRS
ME.MultiRiga(10, 5, MyRS!quantita, FALSE, "L", FALSE)
ME.MultiRiga(32, 5, MyRS!codice, FALSE, "L", FALSE)
ME.MultiRiga(108, 5, MyRS!descrizione, FALSE, "L", FALSE)
ME.MultiRiga(20, 5, MyRS!prezzo, FALSE, "R", FALSE)
ME.MultiRiga(20, 5, MyRS!prezzo * MyRS!quantita, FALSE, "R", FALSE)
ME.MultiRect(10, 32, 108, 20, 20, 0, 0)
ME.Lnm()
NEXT
PUBLIC SUB convcharacters(stringa AS String) AS String
stringa = Replace(stringa, "!", Chr(33))
stringa = Replace(stringa, "#", Chr(35))
stringa = Replace(stringa, "$", Chr(36))
stringa = Replace(stringa, "%", Chr(37))
stringa = Replace(stringa, "&", Chr(38))
stringa = Replace(stringa, "'", Chr(39))
stringa = Replace(stringa, "(", Chr(40))
stringa = Replace(stringa, ")", Chr(41))
stringa = Replace(stringa, "*", Chr(42))
stringa = Replace(stringa, "+", Chr(43))
stringa = Replace(stringa, ",", Chr(44))
stringa = Replace(stringa, "-", Chr(45))
stringa = Replace(stringa, ".", Chr(46))
stringa = Replace(stringa, "/", Chr(47))
stringa = Replace(stringa, "0", Chr(48))
stringa = Replace(stringa, "1", Chr(49))
stringa = Replace(stringa, "2", Chr(50))
stringa = Replace(stringa, "3", Chr(51))
stringa = Replace(stringa, "4", Chr(52))
stringa = Replace(stringa, "5", Chr(53))
stringa = Replace(stringa, "6", Chr(54))
stringa = Replace(stringa, "7", Chr(55))
stringa = Replace(stringa, "8", Chr(56))
stringa = Replace(stringa, "9", Chr(57))
stringa = Replace(stringa, ":", Chr(58))
stringa = Replace(stringa, ";", Chr(59))
stringa = Replace(stringa, "<", Chr(60))
stringa = Replace(stringa, "=", Chr(61))
stringa = Replace(stringa, ">", Chr(62))
stringa = Replace(stringa, "?", Chr(63))
stringa = Replace(stringa, "@", Chr(64))
stringa = Replace(stringa, "A", Chr(65))
stringa = Replace(stringa, "B", Chr(66))
stringa = Replace(stringa, "C", Chr(67))
stringa = Replace(stringa, "D", Chr(68))
stringa = Replace(stringa, "E", Chr(69))
stringa = Replace(stringa, "F", Chr(70))
stringa = Replace(stringa, "G", Chr(71))
stringa = Replace(stringa, "H", Chr(72))
stringa = Replace(stringa, "I", Chr(73))
stringa = Replace(stringa, "J", Chr(74))
stringa = Replace(stringa, "K", Chr(75))
stringa = Replace(stringa, "L", Chr(76))
stringa = Replace(stringa, "M", Chr(77))
stringa = Replace(stringa, "N", Chr(78))
stringa = Replace(stringa, "O", Chr(79))
stringa = Replace(stringa, "P", Chr(80))
stringa = Replace(stringa, "Q", Chr(81))
stringa = Replace(stringa, "R", Chr(82))
stringa = Replace(stringa, "S", Chr(83))
stringa = Replace(stringa, "T", Chr(84))
stringa = Replace(stringa, "U", Chr(85))
stringa = Replace(stringa, "V", Chr(86))
stringa = Replace(stringa, "W", Chr(87))
stringa = Replace(stringa, "X", Chr(88))
stringa = Replace(stringa, "Y", Chr(89))
stringa = Replace(stringa, "Z", Chr(90))
stringa = Replace(stringa, "[", Chr(91))
stringa = Replace(stringa, "\\", Chr(92))
stringa = Replace(stringa, "]", Chr(93))
stringa = Replace(stringa, "^", Chr(94))
stringa = Replace(stringa, "_", Chr(95))
stringa = Replace(stringa, "`", Chr(96))
stringa = Replace(stringa, "a", Chr(97))
stringa = Replace(stringa, "b", Chr(98))
stringa = Replace(stringa, "c", Chr(99))
stringa = Replace(stringa, "d", Chr(100))
stringa = Replace(stringa, "e", Chr(101))
stringa = Replace(stringa, "f", Chr(102))
stringa = Replace(stringa, "g", Chr(103))
stringa = Replace(stringa, "h", Chr(104))
stringa = Replace(stringa, "i", Chr(105))
stringa = Replace(stringa, "j", Chr(106))
stringa = Replace(stringa, "k", Chr(107))
stringa = Replace(stringa, "l", Chr(108))
stringa = Replace(stringa, "m", Chr(109))
stringa = Replace(stringa, "n", Chr(110))
stringa = Replace(stringa, "o", Chr(111))
stringa = Replace(stringa, "p", Chr(112))
stringa = Replace(stringa, "q", Chr(113))
stringa = Replace(stringa, "r", Chr(114))
stringa = Replace(stringa, "s", Chr(115))
stringa = Replace(stringa, "t", Chr(116))
stringa = Replace(stringa, "u", Chr(117))
stringa = Replace(stringa, "v", Chr(118))
stringa = Replace(stringa, "w", Chr(119))
stringa = Replace(stringa, "x", Chr(120))
stringa = Replace(stringa, "y", Chr(121))
stringa = Replace(stringa, "z", Chr(122))
stringa = Replace(stringa, "{", Chr(123))
stringa = Replace(stringa, "|", Chr(124))
stringa = Replace(stringa, "}", Chr(125))
stringa = Replace(stringa, "~", Chr(126))
stringa = Replace(stringa, "", Chr(127))
stringa = Replace(stringa, "€", Chr(128))
stringa = Replace(stringa, "", Chr(129))
stringa = Replace(stringa, "‚", Chr(130))
stringa = Replace(stringa, "ƒ", Chr(131))
stringa = Replace(stringa, "„", Chr(132))
stringa = Replace(stringa, "…", Chr(133))
stringa = Replace(stringa, "†", Chr(134))
stringa = Replace(stringa, "‡", Chr(135))
stringa = Replace(stringa, "ˆ", Chr(136))
stringa = Replace(stringa, "‰", Chr(137))
stringa = Replace(stringa, "Š", Chr(138))
stringa = Replace(stringa, "‹", Chr(139))
stringa = Replace(stringa, "Œ", Chr(140))
stringa = Replace(stringa, "", Chr(141))
stringa = Replace(stringa, "Ž", Chr(142))
stringa = Replace(stringa, "", Chr(143))
stringa = Replace(stringa, "", Chr(144))
stringa = Replace(stringa, "‘", Chr(145))
stringa = Replace(stringa, "’", Chr(146))
stringa = Replace(stringa, "“", Chr(147))
stringa = Replace(stringa, "”", Chr(148))
stringa = Replace(stringa, "•", Chr(149))
stringa = Replace(stringa, "–", Chr(150))
stringa = Replace(stringa, "—", Chr(151))
stringa = Replace(stringa, "˜", Chr(152))
stringa = Replace(stringa, "™", Chr(153))
stringa = Replace(stringa, "š", Chr(154))
stringa = Replace(stringa, "›", Chr(155))
stringa = Replace(stringa, "œ", Chr(156))
stringa = Replace(stringa, "", Chr(157))
stringa = Replace(stringa, "ž", Chr(158))
stringa = Replace(stringa, "Ÿ", Chr(159))
stringa = Replace(stringa, " ", Chr(160))
stringa = Replace(stringa, "¡", Chr(161))
stringa = Replace(stringa, "¢", Chr(162))
stringa = Replace(stringa, "£", Chr(163))
stringa = Replace(stringa, "¤", Chr(164))
stringa = Replace(stringa, "¥", Chr(165))
stringa = Replace(stringa, "¦", Chr(166))
stringa = Replace(stringa, "§", Chr(167))
stringa = Replace(stringa, "¨", Chr(168))
stringa = Replace(stringa, "©", Chr(169))
stringa = Replace(stringa, "ª", Chr(170))
stringa = Replace(stringa, "«", Chr(171))
stringa = Replace(stringa, "¬", Chr(172))
stringa = Replace(stringa, " ", Chr(173))
stringa = Replace(stringa, "®", Chr(174))
stringa = Replace(stringa, "¯", Chr(175))
stringa = Replace(stringa, "°", Chr(176))
stringa = Replace(stringa, "±", Chr(177))
stringa = Replace(stringa, "²", Chr(178))
stringa = Replace(stringa, "³", Chr(179))
stringa = Replace(stringa, "´", Chr(180))
stringa = Replace(stringa, "µ", Chr(181))
stringa = Replace(stringa, "¶", Chr(182))
stringa = Replace(stringa, "·", Chr(183))
stringa = Replace(stringa, "¸", Chr(184))
stringa = Replace(stringa, "¹", Chr(185))
stringa = Replace(stringa, "º", Chr(186))
stringa = Replace(stringa, "»", Chr(187))
stringa = Replace(stringa, "¼", Chr(188))
stringa = Replace(stringa, "½", Chr(189))
stringa = Replace(stringa, "¾", Chr(190))
stringa = Replace(stringa, "¿", Chr(191))
stringa = Replace(stringa, "À", Chr(192))
stringa = Replace(stringa, "Á", Chr(193))
stringa = Replace(stringa, "Â", Chr(194))
stringa = Replace(stringa, "Ã", Chr(195))
stringa = Replace(stringa, "Ä", Chr(196))
stringa = Replace(stringa, "Å", Chr(197))
stringa = Replace(stringa, "Æ", Chr(198))
stringa = Replace(stringa, "Ç", Chr(199))
stringa = Replace(stringa, "È", Chr(200))
stringa = Replace(stringa, "É", Chr(201))
stringa = Replace(stringa, "Ê", Chr(202))
stringa = Replace(stringa, "Ë", Chr(203))
stringa = Replace(stringa, "Ì", Chr(204))
stringa = Replace(stringa, "Í", Chr(205))
stringa = Replace(stringa, "Î", Chr(206))
stringa = Replace(stringa, "Ï", Chr(207))
stringa = Replace(stringa, "Ð", Chr(208))
stringa = Replace(stringa, "Ñ", Chr(209))
stringa = Replace(stringa, "Ò", Chr(210))
stringa = Replace(stringa, "Ó", Chr(211))
stringa = Replace(stringa, "Ô", Chr(212))
stringa = Replace(stringa, "Õ", Chr(213))
stringa = Replace(stringa, "Ö", Chr(214))
stringa = Replace(stringa, "×", Chr(215))
stringa = Replace(stringa, "Ø", Chr(216))
stringa = Replace(stringa, "Ù", Chr(217))
stringa = Replace(stringa, "Ú", Chr(218))
stringa = Replace(stringa, "Û", Chr(219))
stringa = Replace(stringa, "Ü", Chr(220))
stringa = Replace(stringa, "Ý", Chr(221))
stringa = Replace(stringa, "Þ", Chr(222))
stringa = Replace(stringa, "ß", Chr(223))
stringa = Replace(stringa, "à", Chr(224))
stringa = Replace(stringa, "á", Chr(225))
stringa = Replace(stringa, "â", Chr(226))
stringa = Replace(stringa, "ã", Chr(227))
stringa = Replace(stringa, "ä", Chr(228))
stringa = Replace(stringa, "å", Chr(229))
stringa = Replace(stringa, "æ", Chr(230))
stringa = Replace(stringa, "ç", Chr(231))
stringa = Replace(stringa, "è", Chr(232))
stringa = Replace(stringa, "é", Chr(233))
stringa = Replace(stringa, "ê", Chr(234))
stringa = Replace(stringa, "ë", Chr(235))
stringa = Replace(stringa, "ì", Chr(236))
stringa = Replace(stringa, "í", Chr(237))
stringa = Replace(stringa, "î", Chr(238))
stringa = Replace(stringa, "ï", Chr(239))
stringa = Replace(stringa, "ð", Chr(240))
stringa = Replace(stringa, "ñ", Chr(241))
stringa = Replace(stringa, "ò", Chr(242))
stringa = Replace(stringa, "ó", Chr(243))
stringa = Replace(stringa, "ô", Chr(244))
stringa = Replace(stringa, "õ", Chr(245))
stringa = Replace(stringa, "ö", Chr(246))
stringa = Replace(stringa, "÷", Chr(247))
stringa = Replace(stringa, "ø", Chr(248))
stringa = Replace(stringa, "ù", Chr(249))
stringa = Replace(stringa, "ú", Chr(250))
stringa = Replace(stringa, "û", Chr(251))
stringa = Replace(stringa, "ü", Chr(252))
stringa = Replace(stringa, "ý", Chr(253))
stringa = Replace(stringa, "þ", Chr(254))
stringa = Replace(stringa, "ÿ", Chr(255))
RETURN stringa
END
il lavoro lo ha fatto tutto elia!ELIA?..e cosa sono diventato un profeta adesso?? ???
Grazie, comunque so benissimo che adesso PdfWriter è in buone mani :ok: ;D
@DexCitazioneil lavoro lo ha fatto tutto elia!ELIA?..e cosa sono diventato un profeta adesso?? ???
:2birre: :D
Ciao
:) si si, sempre colpa dei moderatori ;D
L'unica cosa che non mi piace, ma è un mio pensiero, è quello di veder creare dei forkLo penso anch'io, e sono sicuro che crea confusione anche solo nel nostro forum.
1) il nome della funzione Multiriga deve cambiare nome in lingua inglese, magari anche MultiCell2Non ho tanta fantasia e non conosco bene l'inglese.. potrebbe andar bene "Multigrid" e "GridCell" ?
2) stessa cosa per tutte le funzioni, private e pubbliche, che sono state inseriteC'è una funzione pubblica "$lasthmulti" serve per memorizzare l'altezza massima delle celle in una riga. $max_y ?
3) non ho modo di farlo io, ma sarebbe il caso di testare la modifica che avevo proposto pocanzi, ovvero quella di aggiungere una piccola PROPERTY o metodo per impostare il set di caratteri. Indi per cui modificare la stampa delle stringhe iusando sì Conv, ma usando come parametro la nuova variabile (vedi nuova property).Scusa quà mi perdo qualcosa.. quale nuova property?
1) Non ci sono problemi con i nomi, purchè sia in inglese, e ce indichino più o meno cosa fà la funzione. Io penso che, dato che è una variante di MultiCell, di chiamarla anche MultiCell2, non ci sono imposizioni in questo... :-\
3) Riguardo alla nuova property, la mia idea era quella di impostare una variabile privata, ad esempio "$charConv", associarla ad una sua property o ad una funzione di lettura/scrittura, ad esempio "SetCharConv(newSet AS String)" a cui passare appunto la stringa corrispondente al set di caratteri scelto, ad esempio "UTF-8" o "ISO-xxxx-xx", e poi quando serve convertire le stringhe del testo tramite la funzione di gambas "Conv()", passandogli come parametro di conversione per la destinazione, la variabile "$charConv". Questo permette di slegare la libreria dal sistema, demandando all'applicazione, o l'utente, il compito di settare la giusta impostazione di lingua.Scusa ma non ho capito niente :rolleyes:..guarda che io sono un programmatore della domenica :D
'###aggiunte nella libreria PdfWriter
PRIVATE $charSet AS String = "UTF-8"
PUBLIC SUB SetLanguage(code as String)
$charSet = code
END
'###modifica della funzione di scrittura
...
$row = Conv($row, "UTF-8", $charSet)
...
Ho provato e funziona, però solo per i caratteri fino al 127.Forse ho sbagliato a usarla, non so.. fammi sapere
Dal 128 "€" compreso sballa. Almeno se non ho sbagliato qualcosa
ME.MultiRect(10, 32, 108, 20, 20, 0, 0, 0, 0, 0)In questo esempio ho 5 colonne che passo solo il parametro x (uguale alla larghezza Multicell2). Per le colonne che non si devono fare il valore è 0
PUBLIC SUB MultiRect(w1 AS Float, w2 AS Float, w3 AS Float, w4 AS Float, w5 AS Float, w6 AS Float, w7 AS Float, w8 AS Float, w9 AS Float, w10 AS Float)
IF w1 > 0 THEN ME.Rect($lMargin, $y, w1, $max_y, "")
IF w2 > 0 THEN ME.Rect($lMargin + w1, $y, w2, $max_y, "")
IF w3 > 0 THEN ME.Rect($lMargin + w1 + w2, $y, w3, $max_y, "")
IF w4 > 0 THEN ME.Rect($lMargin + w1 + w2 + w3, $y, w4, $max_y, "")
IF w5 > 0 THEN ME.Rect($lMargin + w1 + w2 + w3 + w4, $y, w5, $max_y, "")
IF w6 > 0 THEN ME.Rect($lMargin + w1 + w2 + w3 + w4 + w5, $y, w6, $max_y, "")
IF w7 > 0 THEN ME.Rect($lMargin + w1 + w2 + w3 + w4 + w5 + w6, $y, w7, $max_y, "")
IF w8 > 0 THEN ME.Rect($lMargin + w1 + w2 + w3 + w4 + w5 + w6 + w7, $y, w8, $max_y, "")
IF w9 > 0 THEN ME.Rect($lMargin + w1 + w2 + w3 + w4 + w5 + w6 + w7 + w8, $y, w9, $max_y, "")
IF w10 > 0 THEN ME.Rect($lMargin + w1 + w2 + w3 + w4 + w5 + w6 + w7 + w8 + w9, $y, w10, $max_y, "")
END
Ti pare che io non abbia sqlite installato? Ma per chi mi hai preso?Perdono!! ;D
Ho inserito anche le tue, ma ho dei dubbi, e ti prego di controllare attraverso l'esempio incluso nel pacchetto, la pagina n.6 del pdf che crea, nota bene la griglia creataSi ho visto, sembra fare la stessa cosa. Sinceramente mi ero già accorto dopo aver fatto le modifiche a multicell, però non ero riuscito a capire bene come funzionava e quindi non ho più approfondito, visto che il risultato l'avevo raggiunto lo stesso :-[
ME.SetColumnWidths([10.0, 30.0, 110.0, 40.0])
FOR n = 1 TO 10
ME.Row(["gino", "pino", "lino", "rino"])
NEXT
ME.SetColumnWidths([10.0, 30.0, 110.0, 40.0])
FOR EACH MyRS
ME.Row([MyRS!quantita, MyRS!codice, MyRS!descrizione, MyRS!colore])
NEXT
PUBLIC SUB MultiRect(wrect AS Integer[])
DIM ind AS Integer
DIM mylMargin AS Integer = $lMargin
FOR ind = 0 TO wrect.Count - 1
ME.Rect(mylMargin, $y, wrect[ind], $max_y, "")
mylMargin += wrect[ind]
NEXT
END
Scusate se ho perso qualche passaggio ma volevo chiedere: per inserire lettere accentate senza che mi vengano restituiti strani caratteri, come dovrei fare?
1. PUBLIC SUB MultiRect(wrect AS Integer[])
2. DIM ind AS Integer
3. DIM mylMargin AS Integer = $lMargin
4. FOR ind = 0 TO wrect.Count - 1
5. ME.Rect(mylMargin, $y, wrect[ind], $max_y, "")
6. mylMargin += wrect[ind]
7. NEXT
8. END
ME.Image(Application.Path & "/logo.png", 10, 10, 80, 35, "png")
Cosa intendi per inserirla in una cella? L'immagine puoi inserirla con le dimensioni che vuoi nelle coordinate che imposti.
Questo è per inserire un'immagineCodice: gambas [Seleziona]ME.Image(Application.Path & "/logo.png", 10, 10, 80, 35, "png")
Ovvero, vorresti che l'inserimento dell'immagine venga fatto in modo dinamico dalla gestione della tabella?
No.
Ma la cosa credo sia relativamente semplice da implementare, visto che comunque hai a disposizione le coordinate attuali di ogni riga.
Ovvero, vorresti che l'inserimento dell'immagine venga fatto in modo dinamico dalla gestione della tabella?
No.
Ma la cosa credo sia relativamente semplice da implementare, visto che comunque hai a disposizione le coordinate attuali di ogni riga.
DIM hStampa AS Process
hStampa = SHELL ("lpr " & "percorso") WAIT
Private Function convCP1252($txt As String) As String
'righe aggiunte da golia
$txt = Replace($txt, "€", Chr(128))
$txt = Replace($txt, "‚", Chr(130))
$txt = Replace($txt, "ƒ", Chr(131))
$txt = Replace($txt, "„", Chr(132))
$txt = Replace($txt, "…", Chr(133))
$txt = Replace($txt, "†", Chr(134))
$txt = Replace($txt, "‡", Chr(135))
$txt = Replace($txt, "ˆ", Chr(136))
$txt = Replace($txt, "‰", Chr(137))
$txt = Replace($txt, "Š", Chr(138))
$txt = Replace($txt, "‹", Chr(139))
$txt = Replace($txt, "Œ", Chr(140))
$txt = Replace($txt, "Ž", Chr(142))
$txt = Replace($txt, "‘", Chr(145))
$txt = Replace($txt, "’", Chr(146))
$txt = Replace($txt, "“", Chr(147))
$txt = Replace($txt, "”", Chr(148))
$txt = Replace($txt, "•", Chr(149))
$txt = Replace($txt, "–", Chr(150))
$txt = Replace($txt, "—", Chr(151))
$txt = Replace($txt, "˜", Chr(152))
$txt = Replace($txt, "™", Chr(153))
$txt = Replace($txt, "š", Chr(154))
$txt = Replace($txt, "›", Chr(155))
$txt = Replace($txt, "œ", Chr(156))
$txt = Replace($txt, "ž", Chr(158))
$txt = Replace($txt, "Ÿ", Chr(159))
$txt = Replace($txt, "é", Chr(233))
$txt = Replace($txt, "è", Chr(232))
$txt = Replace($txt, "£", Chr(163))
$txt = Replace($txt, "à", Chr(224))
$txt = Replace($txt, "ç", Chr(231))
$txt = Replace($txt, "ì", Chr(236))
$txt = Replace($txt, "ò", Chr(242))
$txt = Replace($txt, "°", Chr(176))
$txt = Replace($txt, "ù", Chr(249))
$txt = Replace($txt, "§", Chr(167))
'fine righe golia
' aggiunti da me...
$txt = Replace($txt, "À", Chr(192))
$txt = Replace($txt, "È", Chr(200))
$txt = Replace($txt, "É", Chr(201))
$txt = Replace($txt, "Ò", Chr(210))
$txt = Replace($txt, "Ù", Chr(217))
$txt = Replace($txt, "Ì", Chr(204))
$txt = Replace($txt, "α", "a") '"alfa")
$txt = Replace($txt, "β", "b") '"beta")
$txt = Replace($txt, "γ", "g") '"gamma")
$txt = Replace($txt, "δ", "d") '"delta")
$txt = Replace($txt, "ε", "e") '"epsilon")
$txt = Replace($txt, "μ", "micron")
$txt = Replace($txt, "ω", "o") '"omega")
Return $txt
End
txt = convCP1252(txt)
A meno che tu non voglia prendere in mano il progetto... Occhiolino
CASE "a3"
$fwPt = 841.89
$fhPt = 1190.55
CASE "a4"
$fwPt = 595.28
$fhPt = 841.89
CASE "a5"
$fwPt = 420.94
$fhPt = 595.28
CASE "letter"
$fwPt = 612
$fhPt = 792
CASE "legal"
$fwPt = 612
$fhPt = 1008
New ClassStampaOrdine("Portrait", "mm", "NUOVOCASE")
$pageFormats.Add([207.12, 368.85], "citizen")
Ciao,
Apri la classe Pdfwriter e alle righe.. circa 260, trovi questoCodice: gambas [Seleziona]
CASE "a3"
$fwPt = 841.89
$fhPt = 1190.55
CASE "a4"
$fwPt = 595.28
$fhPt = 841.89
CASE "a5"
$fwPt = 420.94
$fhPt = 595.28
CASE "letter"
$fwPt = 612
$fhPt = 792
CASE "legal"
$fwPt = 612
$fhPt = 1008
Ci aggiungi un case con la misura da te desiderata, poiCodice: gambas [Seleziona]
New ClassStampaOrdine("Portrait", "mm", "NUOVOCASE")
Case "in"
$k = 72
Default
Error.Raise("Incorrect unit: " & unit)
End Select
'Page format
' SELECT CASE Lower(form)
' CASE "a3"
' $fwPt = 841.89
' $fhPt = 1190.55
' CASE "a4"
' $fwPt = 595.28
' $fhPt = 841.89
' CASE "a5"
' $fwPt = 420.94
' $fhPt = 595.28
' CASE "letter"
' $fwPt = 612
' $fhPt = 792
' CASE "legal"
' $fwPt = 612
' $fhPt = 1008
' DEFAULT
' Error.Raise("Unknown page format: " & form)
' END SELECT
' $fw = $fwPt / $k
' $fh = $fhPt / $k
$pageFormats = New Collection
$pageFormats.Add([841.89, 1190.55], "a3")
$pageFormats.Add([595.28, 841.89], "a4")
$pageFormats.Add([420.94, 595.28], "a5")
$pageFormats.Add([612, 792], "letter")
$pageFormats.Add([612, 1008], "legal")
$pageFormats.Add([207.12, 368.85], "citizen")
size = _getpageformat(form)
If (IsNull(size)) Then
Error.Raise("Unknown page format: " & form)
End If