Subject Re: Print Entryfield Editor
From Norman Snowden <duluth@msn.com>
Date Sat, 23 Apr 2022 12:02:01 -0400
Newsgroups dbase.getting-started

Akshat Kapoor Wrote:

> Good Afternoon Norman,
>
>
> >   function PUSHBUTTON11_onClick()
> >        form.entryfield1.value = set('directory')+'\plot_occupation.txt'
> >        oWord = new oleAutoclient("word.application")
> >        oWord.ChangeFileOpenDirectory( set('directory')+'\')
> I have never used word ad oleAutoclient so cannot say for sure But I
> would give the following a trial
> oWord.ChangeFileOpenDirectory( set('directory'))
>
> >        oWord.documents.open("plot_occupation.txt",false, true )
> >        oWord.activeDocument.printOut()
>
> I can suggest you an alternative if you are not doing any fancy
> formatting in Word.
>
> Instead of saving to a txt file append to a memo field and print that
> memo field using dbase report designer.
>
> Sample is attached.
>
> It would be much faster. PLUS you are not dependent on microsh???
> They change things at will which are damn hard to locate
>
> Untested suggestion
> In case you require some formatting add html tags at required locations.
> dbase report writer does process some html tags.
>
> Regards
> Akshat
> ** END HEADER -- do not remove this line
> //
> // Generated on 23.04.2022
> //
> local r
> r = new normanReport()
> r.render()
>
> class normanReport of REPORT
>    with (this)
>       title = "Norman"
>       autoSort = false
>    endwith
>
>    this.NORMAN1 = new QUERY(this)
>    with (this.NORMAN1)
>       width = 360.0
>       height = 360.0
>       sql = 'select * from "C:\dbasetutorial\muneemado\news\norman.dbf"'
>       requestLive = false
>       active = true
>    endwith
>
>    with (this.printer)
>       duplex = 1        // None
>       orientation = 1        // Portrait
>       paperSource = 7
>       paperSize = 9
>       resolution = 0        // Default
>       color = 1        // Monochrome
>       trueTypeFonts = 1        // Bitmap
>    endwith
>
>    this.PAGETEMPLATE1 = new PAGETEMPLATE(this)
>    with (this.PAGETEMPLATE1)
>       height = 16837.0
>       width = 11905.0
>       marginTop = 1080.0
>       marginLeft = 1080.0
>       marginBottom = 1080.0
>       marginRight = 1080.0
>       gridLineWidth = 0
>    endwith
>
>    this.PAGETEMPLATE1.STREAMFRAME1 = new STREAMFRAME(this.PAGETEMPLATE1)
>    with (this.PAGETEMPLATE1.STREAMFRAME1)
>       height = 11592.0
>       left = 360.0
>       top = 1365.0
>       width = 9360.0
>       form.STREAMFRAME1 = form.pagetemplate1.streamframe1
>    endwith
>
>    this.PAGETEMPLATE1.TEXT1 = new TEXT(this.PAGETEMPLATE1)
>    with (this.PAGETEMPLATE1.TEXT1)
>       height = 524.0
>       left = 360.0
>       top = 360.0
>       width = 1656.0
>       prefixEnable = false
>       text = "<H1>Norman</H1>"
>       form.TEXT1 = form.pagetemplate1.text1
>    endwith
>
>    this.PAGETEMPLATE1.TEXT2 = new TEXT(this.PAGETEMPLATE1)
>    with (this.PAGETEMPLATE1.TEXT2)
>       height = 228.0
>       left = 360.0
>       top = 915.0
>       width = 3090.0
>       prefixEnable = false
>       text = {||Date()}
>       form.TEXT2 = form.pagetemplate1.text2
>    endwith
>
>    this.STREAMSOURCE1 = new STREAMSOURCE(this)
>    with (this.STREAMSOURCE1.detailBand)
>       height = 250.0
>    endwith
>
>    this.STREAMSOURCE1.detailBand.TITLETEXTTESTING1 = new TEXT(this.STREAMSOURCE1.detailBand)
>    with (this.STREAMSOURCE1.detailBand.TITLETEXTTESTING1)
>       canRender = {||this.parent.firstOnFrame}
>       height = 293.0
>       left = 0.0
>       top = 0.0
>       width = 5760.0
>       prefixEnable = false
>       suppressIfBlank = true
>       text = "<H3>Testing</H3>"
>    endwith
>
>    this.STREAMSOURCE1.detailBand.TEXTTESTING1 = new TEXT(this.STREAMSOURCE1.detailBand)
>    with (this.STREAMSOURCE1.detailBand.TEXTTESTING1)
>       height = 1.0
>       left = 0.0
>       top = 293.0
>       width = 9165.0
>       variableHeight = true
>       prefixEnable = false
>       text = {||this.form.NORMAN1.rowset.fields["Testing"].value}
>    endwith
>
>    with (this.reportGroup.footerBand)
>       height = 250.0
>    endwith
>
>    with (this.reportGroup.headerBand)
>       height = 250.0
>    endwith
>
>    this.firstPageTemplate = this.form.pagetemplate1
>    this.form.pagetemplate1.nextPageTemplate = this.form.pagetemplate1
>    this.form.pagetemplate1.streamframe1.streamSource = this.form.streamsource1
>    this.form.streamsource1.rowset = this.form.norman1.rowset
>
> endclass
>
Thank you very much for your response. However, I still get the Error message. Thank you for the alternative code, I appreciate it.
Thanks, Norman