Subject Re: form.MYTITLETEXT
From Ruth Bromer <ruth@treklite.com>
Date Sat, 22 Jun 2019 10:25:45 -0400
Newsgroups dbase.getting-started
Attachment(s) EPunch.repEPunch.pdf

I've attached the code as well as what the report looks like (screen
capture and then put into a pdf).

The reason I thought I had an error is because when I ran the report,
that was the line that dBase told me was wrong.

I found a report with this problem.  (Not all reports seem to be using
the command.) Possibly code got deleted somewhere over the years. I've
attached the report where it has a title. If I remove form.MYTITLETEXT1
= form.pagetemplate1.mytitletext1, the report works. SO, I am defining
something wrong somewhere?

The code that seems pertinent is:

   form.STREAMFRAME1 = form.pagetemplate1.streamframe1

**  This is the header.  Am I doing it wrong? **

    with (this.PAGETEMPLATE1.TEXT1)
       height = 0.3229
       left = 0.3646
       top = 0.0729
       width = 3.5313
       text = "EPunch Rental List"
       form.TEXT1 = form.pagetemplate1.text1
    endwith

    with (this.PAGETEMPLATE1.KMDATETEXT1)
       height = 0.18
       left = 3.8646
       top = 0.1667
       width = 1.4896
       form.KMDATETEXT1 = form.pagetemplate1.kmdatetext1
    endwith

    form.PAGENUMBER1 = form.pagetemplate1.pagenumber1

** Here's the command on question **

    form.MYTITLETEXT1 = form.pagetemplate1.mytitletext1

** Second heading **

    this.PAGETEMPLATE1.EVENTDATE = new KMTITLETEXT2(this.PAGETEMPLATE1)
    with (this.PAGETEMPLATE1.EVENTDATE)
       height = 0.2396
       left = 3.1791
       top = 0.4188
       width = 1.8646
       alignHorizontal = 0        // Left
       fontBold = true
       fontItalic = true
       text = "August 1-4, 2019"
       form.EVENTDATE = form.pagetemplate1.eventdate
    endwith


On 6/22/2019 5:25 AM, Mervyn Bick wrote:

>
> Mm, form.MYTITLETEXT1 = form.pagetemplate1.mytitletext1 is correct.
>
> The report designer streams out the line, with the appropriate object
> names, in the constructor code for any text object placed on a
> pagetemplate object.
>
> Ruth, what gave you the impression that the line isn't working?
>
> The constructor code MYTITLETEXT1 on pagetemplate1 would be something like
>
>     this.PAGETEMPLATE1.MYTITLETEXT1 = new TEXT(this.PAGETEMPLATE1)
>     with (this.PAGETEMPLATE1.MYTITLETEXT1)
>        //various properties set here in the constructor code
>        text = "The title for my report."
>        form.MYTITLETEXT1 = form.pagetemplate1.mytitletext1
>     endwith
>
> The line doesn't appear to be used within the report itself and the
> report will actually render without a problem if the line is removed.
>
> The line of code does, however, serve a purpose if one ever needs to
> change the text property of a text object on a pagetemplate before
> rendering the report.
>
> Without the line one would need to use the following in a launch form if
> one wanted to change the text property of the object.
>
> set procedure to whatever.rep
> form.rep = new whateverReport()
> form.rep.pagetemplate1.mytitletext1.text = 'A new title for the report'
> form.rep.render()
>
> While the code above will still work if the line is left in, the line of
> code allows one to simplify this a bit.
>
> set procedure to whatever.rep
> form.rep = new whateverReport()
> form.rep.mytitletext1.text = 'A new title for the report'
> form.rep.render()
>
>
> Mervyn.
>
>




** END HEADER -- do not remove this line
//
// Generated on 10/02/2013
//
local r
r = new EPUNCHREPORT()
r.render()

class EPUNCHREPORT of BASECREPORT from "Base.crp"
   set procedure to MyControls.cc additive
   set procedure to :dUFLP:Repcntl.cc additive
   set procedure to :ReportControls:REPORT.CC additive
   this.EPUNCH1 = new QUERY()
   this.EPUNCH1.parent = this
   with (this.EPUNCH1)
      left = 0.6563
      top = 0.5833
      sql = "@EPunch.sql"
      requestLive = false
      active = true
   endwith

   with (this.printer)
      duplex = 1        // None
      orientation = 1        // Portrait
      paperSource = 15
      paperSize = 1
      resolution = 0        // Default
      color = 2        // Color
      trueTypeFonts = 3        // Substitute
   endwith

   form.STREAMFRAME1 = form.pagetemplate1.streamframe1

   with (this.PAGETEMPLATE1.TEXT1)
      height = 0.3229
      left = 0.3646
      top = 0.0729
      width = 3.5313
      text = "EPunch Rental List"
      form.TEXT1 = form.pagetemplate1.text1
   endwith

   with (this.PAGETEMPLATE1.KMDATETEXT1)
      height = 0.18
      left = 3.8646
      top = 0.1667
      width = 1.4896
      form.KMDATETEXT1 = form.pagetemplate1.kmdatetext1
   endwith

   form.PAGENUMBER1 = form.pagetemplate1.pagenumber1

*   form.MYTITLETEXT1 = form.pagetemplate1.mytitletext1

   this.PAGETEMPLATE1.EVENTDATE = new KMTITLETEXT2(this.PAGETEMPLATE1)
   with (this.PAGETEMPLATE1.EVENTDATE)
      height = 0.2396
      left = 3.1791
      top = 0.4188
      width = 1.8646
      alignHorizontal = 0        // Left
      fontBold = true
      fontItalic = true
      text = "August 1-4, 2019"
      form.EVENTDATE = form.pagetemplate1.eventdate
   endwith

   with (this.STREAMSOURCE1.detailBand)
      height = 0.0
   endwith

   this.STREAMSOURCE1.detailBand.NAMEHEADING = new KMFIELDHEADINGTEXT(this.STREAMSOURCE1.detailBand)
   with (this.STREAMSOURCE1.detailBand.NAMEHEADING)
      canRender = {||this.parent.firstOnFrame}
      height = 0.18
      left = 0.0104
      top = 0.0
      width = 0.75
      alignHorizontal = 0        // Left
      suppressIfBlank = true
      transparent = false
      fontSize = 12.0
      fontBold = true
      text = "Name"
   endwith

   this.STREAMSOURCE1.detailBand.EPUNCHHEADING = new KMFIELDHEADINGTEXT(this.STREAMSOURCE1.detailBand)
   with (this.STREAMSOURCE1.detailBand.EPUNCHHEADING)
      canRender = {||this.parent.firstOnFrame}
      left = 1.6
      top = 0.0
      alignHorizontal = 0        // Left
      suppressIfBlank = true
      transparent = false
      fontSize = 12.0
      fontBold = true
      text = "EPunch"
   endwith

   this.STREAMSOURCE1.detailBand.FULLNAME = new KMFIELDTEXT(this.STREAMSOURCE1.detailBand)
   with (this.STREAMSOURCE1.detailBand.FULLNAME)
      left = 0.0104
      top = 0.24
      width = 1.5
      alignHorizontal = 0        // Left
      transparent = false
      text = {||form.streamSource1.rowset.fields["Name"].value}
   endwith

   this.STREAMSOURCE1.detailBand.EPUNCH = new KMFIELDTEXT(this.STREAMSOURCE1.detailBand)
   with (this.STREAMSOURCE1.detailBand.EPUNCH)
      left = 1.6
      top = 0.24
      width = 1.0
      alignHorizontal = 0        // Left
      transparent = false
      text = {||form.streamSource1.rowset.fields["EPunchId"].value}
   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.epunch1.rowset

endclass