Comment re-dimensionner un controle OLE et du texte RTF avec le reportlistener
# 0000000865
ajouté le 07/08/2013 18:53:44 et modifié le 15/08/2013
consulté 15435 fois
Niveau
initié
Créer un état FoxPro et y ajouter un ‘Picture/Activex Bound control’ et l’agrandir à la grandeur désiré et l'appeler 'c:\rtfdemo'
Code source :
#Define GDIPLUS_DETAIL_OBJCODE 4
#Define CRLF Chr(13)+Chr(10) Local lcStr Public lcReportPath,lcTmpReport
lcStr = "Note that there is a limit of 32 characters total for the sum of text"+CRLF +; "before and text after for simple numbering. Multilevel numbering has a limit"+CRLF +; "of 64 characters total for the sum of all levels.NOTE: The file must have a"+CRLF +; ".RTF extension to work properly.Note that there is a limit of 32 characters total for the sum of text"+CRLF +; "before and text after for simple numbering. Multilevel numbering has a limit"+CRLF +; "of 64 characters total for the sum of all levels.NOTE: The file must have a"+CRLF +; ".RTF extension to work properly.Note that there is a limit of 32 characters total for the sum of text"+CRLF +; "before and text after for simple numbering. Multilevel numbering has a limit"+CRLF +; "of 64 characters total for the sum of all levels.NOTE: The file must have a"+CRLF +; ".RTF extension to work properly.Note that there is a limit of 32 characters total for the sum of text"+CRLF +; "before and text after for simple numbering.\b Multilevel numbering has a limit"+CRLF +; "of 64 characters total for the sum of all levels.NOTE: The file must have a"+CRLF +; ".RTF extension to work properly. \b0 Note that there is a limit of 32 characters total for the sum of text"+CRLF +; "before and text after for simple numbering. Multilevel numbering has a limit"+CRLF +; "of 64 characters total for the sum of all levels.NOTE: The file must have a"+CRLF +; ".RTF extension to work properly."&& Fill the variable with Text.
lnCount =Alines(myrray,lcStr) CreateCursor ctext (lctext m,gText g) &&Create a cursor . InsertInto ctext (lctext) Values (lcStr) && insert the text in the memo field
_rtfFile = "c:\"+Sys(3)+".rtf"&& Create a temporary rtf file Scan SetTextmergeTo &_rtfFile Noshow SetTextmergeOn
\\{\rtf1 <<ALLT(cText.lcText)>>} SetTextmergeTo AppendGeneral gText From &_rtfFile Class"RICHTEXT.RICHTEXTCTRL.1"&&Class RTF endscan
loListener = Createobject("AdRTFListener")
lcReportPath='c:\rtfdemo'
lcTmpReport = sys(2023)+'\'+sys(3)+'.frx'
lcTmpReportfrt = sys(2023)+'\'+juststem(lcTmpReport)+'.frt' copyfile lcReportPath+'.frx'TO (lcTmpReport)
lcReportPath2 = lcReportPath+'.frt' copyfile (lcReportPath2) to (lcTmpReportfrt)
loListener.OutputType = -1 && Generate the correct size without showing the report && So the resizing takes place.
loListener.Quietmode = .T. ReportForm (lcTmpReport) Object m.loListener
loListener.OutputType = 1 && Now we show the report resized
loListener.Quietmode = .F. ReportForm (lcTmpReport) Object m.loListener Erase &_rtfFile
DefineClass AdRTFListener As _ReportListener Of ; home() + 'ffc\_ReportListener.vcx'
oGDIGraphics = .Null. FunctionBeforeBand(tnBandObjCode, tnFRXRecNo) local lcAlias
lcAlias = alias() WithThis If tnBandObjCode=GDIPLUS_DETAIL_OBJCODE Use (lcTmpReport) SharedAgainIn 0 alias DEMO select DEMO
locate for DEMO.OBJTYPE = 17 and DEMO.OBJCODE = 0 REPLACE DEMO.HEIGHTwith DEMO.HEIGHT*lnCount go tnFRXRecNo REPLACE DEMO.HEIGHTwith DEMO.HEIGHT*lnCount useinselect('demo') select (lcAlias) endif DoDefault(tnBandObjCode, tnFRXRecNo) Endwith endfunc Enddefine
Commentaires
le 15/08/2013, eddymaue a écrit : t populaire Mike ....
t populaire Mike ....
consulté 5112 fois en 7 jours ....