TextToCSS ( text )
Moderatore: Moderatori
-
- Messaggi: 3616
- Iscritto il: sabato 7 febbraio 2004, 1:00
- Località: Roma
- Contatta:
TextToCSS ( text )
Per visualizzare il contenuto di un campo in un Web Viewer, compresi gli allineamenti, i colori, gli stili, i caratteri ecc. ecc.
Codice: Seleziona tutto
/*
TextToCSS ( text ) custom function
Author
Daniele Raybaudi
Type
Recursive
Returns a valid CSS, including all alignments, styles and colors of the original text. ( GetAsCSS ( ) can't do it !! )
A Web Viewer set as:
"data: text / html, <style type='text/css'> body {border: none; overflow: hidden;} </ style>" & TextToCSS ( YourTable :: text )
shows exactly the content of the field.
09/19/2013 v1
*/
Let([
$i = $i + 1 ;
v = GetValue ( text ; $i ) ;
css = GetAsCSS ( v ) ;
pos1 = Position ( css ; "text-align:" ; 1 ; 1 ) + 11;
pos2 = Position ( css ; ";" ; pos1 ; 1 ) ;
align = Middle ( css ; pos1 ; pos2 - pos1 ) ;
div = If ( IsEmpty ( v ) ; "<BR>" ; "<div style='text-align:" & align & ";'>" & css & "</div>" )
];
Case(
$i ≤ ValueCount ( text ) ; List ( div ; TextToCSS ( text ) ) ;
Let ( $i = "" ; "" )
)
)
Raybaudi FMP 12 Adv. Windows XP SP3