How to mofify text 'xyz' after issuing a dw_1.modify("CREATE TEXT(band='footer' text='xyz' ............)")

Hi All,

I am new to Powerbuilder and on a steep learning curve so please bear with
me and do not assume I know anything in your response!

I have a datawindow control 'dw_1' in a window 'w_report_1'

With the w_report_1.open() event, I assign a data object 'd_site_details' to
the 'dw_1' control in the following code extract. I use  a loop to provide
different retrieval arguments for 'd_site_details' from a datastore so that
we get different details for different system accounts. After each retrieval
we print dw_1 together with a text footer which is created using a function
'wf_multiprint_footer()' also shown beow.

My problem is , I want to update the time in the text footer for each system
account printed.

But what I find is that using this function appears to create 'new text'
which is then overlayed/superimposed on top of the previous text such that
the times (the only part that changes) becomes un readable!

How can I overcome this problem.

Thanks in advance for any help given!

---------------------------------------
w_report_1.open():
----------------------------------------------------------------------------
---------------
integer li_rv, li_pagecount, ll_tocompile, li_proceed, n
long ll_rows, ll_system_no,  ll_printed, ll_notprinted, ll_compiled
string ls_sys_type, ls_rpttype, ls_null
datastore ds_2

//MessageBox("SysType_id specified:", s_sys_type)
li_proceed = wf_proceed():

IF li_proceed = 1 THEN
  isnull(ls_null)

  ls_rpttype = 'Inst/A4 All Systype_id'

  wf_report_usage(ls_rpttype, 'N', string(l_start), string(l_end),&
        ls_null, ls_null, ls_null, ls_null)

  ds_2 = create datastore
  ds_2.dataobject = 'd_sys_all_systype_id'
  ds_2.settransobject(sqlca)

  // Determine how many require compiling
  ll_tocompile = ds_2.retrieve(l_start, l_end)

  ll_compiled = 0
  ll_printed = 0
  ll_notprinted = 0
  li_pagecount = integer(profilestring(const.app_ini, "daily", "pagecount",
""))

  wf_show_totals(ls_rpttype, ll_tocompile)

  dw_1.dataobject = 'd_site_details'
  dw_1.settransobject(SQLCA)

//  MessageBox("No of systems to process:", ll_tocompile)

  for n = 1 to ll_tocompile

   li_rv = wf_cancel_printing()
   yield()
   if li_rv = 1 then
    exit
   end if
   ll_system_no = ds_2.getitemnumber(n, 'system_no')

   dw_1.retrieve(ll_system_no)
   IF SQLCA.SQLCode < 0 THEN
    MessageBox("SQL error", SQLCA.SQLErrText)
   END IF

   ll_compiled ++
   ll_tocompile --
   wf_update_compile(ll_compiled, ll_tocompile)

   wf_multiprint_footer()
   dw_1.print()
   ll_printed ++
   wf_pause_printing(ll_printed, li_pagecount)

  next

END IF

IF isvalid(ds_2) THEN
 destroy(ds_2)
END IF
----------------------------------------------------------------------------
--------------------------





-------------------------------------
Function wf_multiprint_footer():
----------------------------------------------------------------------------
-----------
string ls_modstring, ls_computer_name, ls_text_string, ls_return

// build string for footer text
ls_computer_name = f_get_machine_name()
ls_text_string = "Compiled on " + SQLCA.ServerName + " (" + &
     SQLCA.Database + ") at " + string(now()) + " to " + ls_computer_name

// now build complete modify string for footer text
ls_modstring = "CREATE text(band=footer alignment='0' text='" +
ls_text_string + "'" + &
       " border='0' color='0' x='32' y='4' height='40' width='2000' " + &
     " name=st_footer  font.face='Small Fonts' font.height='-6'"+ &
     " font.weight='400'  font.family='2' font.pitch='2' font.charset='0'" +
&
     " background.mode='2' background.color='16777215' )"


// add text to summary
ls_return = dw_1.Modify(ls_modstring)

// now increase height of footer to reveal footer text
ls_modstring = "DataWindow.footer.height='100'"
ls_return = dw_1.Modify(ls_modstring)

----------------------------------------------------------------------------
---------------------------


0
Sybase
9/18/2000 8:06:00 AM
sybase.powerbuilder.datawindow 28057 articles. 5 followers. Follow

2 Replies
822 Views

Similar Articles

[PageSpeed] 18

Thanks for the information, but using the syntax below I cannot get it to
modify the text post creation. I suggest it is down to my syntax and
inexperience!

Please find below the function code which creates the footer text and
attempts to modify same subject to whether it is the first report or
subsequent reports:
==========================================================
wf_multiprint_footer(i_row_no, s_dwtype, s_report_name)
------------------------------------------------------------
// when i_row_no = 1 this is the first report on page 1
// when i_row_no > 1 then these are subsequent reports/pages
// s_dwtype defines whether footer for datawaindow (dw) or (ds)
// s_report_name = report's name/title
==========================================================
string ls_modstring, ls_computer_name, ls_text_string, ls_return

IF i_row_no = 1 THEN

     // build string for footer text
     ls_computer_name = f_get_machine_name()
     ls_text_string = "Compiled on " + SQLCA.ServerName + " (" + &
         SQLCA.Database + ") at " + string(now()) + " to " +
ls_computer_name + "   (" + s_report_name + ")"

     // now build complete modify string for footer text
     ls_modstring = "CREATE text(band=footer alignment='0' text='" +
ls_text_string + "'" + &
           " border='0' color='0' x='32' y='4' height='40' width='2000' " +
&
         " name=st_footer  font.face='Small Fonts' font.height='-6'"+ &
         " font.weight='400'  font.family='2' font.pitch='2'
font.charset='0'" + &
         " background.mode='2' background.color='16777215' )"

     IF s_dwtype = 'DS' THEN

      // add text to footer
      ls_return = ds_1.Modify(ls_modstring)

      // now increase height of footer to reveal footer text
      ls_modstring = "DataWindow.footer.height='100'"
      ls_return = ds_1.Modify(ls_modstring)

     END IF

     IF s_dwtype = 'DW' THEN

      // add text to summary
      ls_return = dw_1.Modify(ls_modstring)

      // now increase height of footer to reveal footer text
      ls_modstring = "DataWindow.footer.height='100'"
      ls_return = dw_1.Modify(ls_modstring)

     END IF

     // Display in w_frame status bar
     w_frame.SetMicroHelp(s_dwtype + "(" + string(i_row_no) + "): " +
ls_text_string)

ELSE

     // build new string for footer text
     ls_computer_name = f_get_machine_name()
    ls_text_string = "Compiled on " + SQLCA.ServerName + " (" + &
         SQLCA.Database + ") at " + string(now()) + " to " +
ls_computer_name + "   (" + s_report_name + ")"

     ls_modstring = "st_footer.text=" + ls_text_string

     // For additional pages update report time in footer by modifying text
    IF s_dwtype = 'DS' THEN

          ds_1.Modify(ls_modstring)

     END IF

     IF s_dwtype = 'DW' THEN

          dw_1.Modify(ls_modstring)

     END IF

     // Display in w_frame status bar
     w_frame.SetMicroHelp(s_dwtype + "(" + string(i_row_no) + "): " +
ls_text_string)

END IF
=============================================================
"Simon Caldwell" <simonDOTcaldwellATgetrealsystemsDOTcom> wrote in message
news:ijCAt8hIAHA.202@forums.sybase.com...
>
> "Philip Sparke(Sybase Forums)" <psparke@lineone.net> wrote in message
> news:VHffA9YIAHA.201@forums.sybase.com...
> > Hi All,
> >
> > How to modify text 'xyz' after issuing a dw_1.modify("CREATE
> > TEXT(band='footer' text='xyz' ............)")
> >
>
> Your syntax presumably includes "name='your_text_name' "
> So then to change the text, just code
dw_1.Modify("your_text_name.text='new
> value' ")
>
> HTH
>
> Simon
>
> --
> Simon Caldwell
> Get Real Systems Ltd
> Holtby Manor, Stamford Bridge Road, York, YO19 5LL
> Tel 01904 481999 Fax 01904 481666
> Visit us at www.getrealsystems.com
>
> Specialists in e-Procurement and supply chain technology
>
>
>


"Sybase Forums" <psparke@lineone.net> wrote in message
news:3#rAqjUIAHA.275@forums.sybase.com...
> Hi All,
>
> I am new to Powerbuilder and on a steep learning curve so please bear with
> me and do not assume I know anything in your response!
>
> I have a datawindow control 'dw_1' in a window 'w_report_1'
>
> With the w_report_1.open() event, I assign a data object 'd_site_details'
to
> the 'dw_1' control in the following code extract. I use  a loop to provide
> different retrieval arguments for 'd_site_details' from a datastore so
that
> we get different details for different system accounts. After each
retrieval
> we print dw_1 together with a text footer which is created using a
function
> 'wf_multiprint_footer()' also shown beow.
>
> My problem is , I want to update the time in the text footer for each
system
> account printed.
>
> But what I find is that using this function appears to create 'new text'
> which is then overlayed/superimposed on top of the previous text such that
> the times (the only part that changes) becomes un readable!
>
> How can I overcome this problem.
>
> Thanks in advance for any help given!
>
> ---------------------------------------
> w_report_1.open():
> --------------------------------------------------------------------------
--
> ---------------
> integer li_rv, li_pagecount, ll_tocompile, li_proceed, n
> long ll_rows, ll_system_no,  ll_printed, ll_notprinted, ll_compiled
> string ls_sys_type, ls_rpttype, ls_null
> datastore ds_2
>
> //MessageBox("SysType_id specified:", s_sys_type)
> li_proceed = wf_proceed():
>
> IF li_proceed = 1 THEN
>   isnull(ls_null)
>
>   ls_rpttype = 'Inst/A4 All Systype_id'
>
>   wf_report_usage(ls_rpttype, 'N', string(l_start), string(l_end),&
>         ls_null, ls_null, ls_null, ls_null)
>
>   ds_2 = create datastore
>   ds_2.dataobject = 'd_sys_all_systype_id'
>   ds_2.settransobject(sqlca)
>
>   // Determine how many require compiling
>   ll_tocompile = ds_2.retrieve(l_start, l_end)
>
>   ll_compiled = 0
>   ll_printed = 0
>   ll_notprinted = 0
>   li_pagecount = integer(profilestring(const.app_ini, "daily",
"pagecount",
> ""))
>
>   wf_show_totals(ls_rpttype, ll_tocompile)
>
>   dw_1.dataobject = 'd_site_details'
>   dw_1.settransobject(SQLCA)
>
> //  MessageBox("No of systems to process:", ll_tocompile)
>
>   for n = 1 to ll_tocompile
>
>    li_rv = wf_cancel_printing()
>    yield()
>    if li_rv = 1 then
>     exit
>    end if
>    ll_system_no = ds_2.getitemnumber(n, 'system_no')
>
>    dw_1.retrieve(ll_system_no)
>    IF SQLCA.SQLCode < 0 THEN
>     MessageBox("SQL error", SQLCA.SQLErrText)
>    END IF
>
>    ll_compiled ++
>    ll_tocompile --
>    wf_update_compile(ll_compiled, ll_tocompile)
>
>    wf_multiprint_footer()
>    dw_1.print()
>    ll_printed ++
>    wf_pause_printing(ll_printed, li_pagecount)
>
>   next
>
> END IF
>
> IF isvalid(ds_2) THEN
>  destroy(ds_2)
> END IF
> --------------------------------------------------------------------------
--
> --------------------------
>
>
>
>
>
> -------------------------------------
> Function wf_multiprint_footer():
> --------------------------------------------------------------------------
--
> -----------
> string ls_modstring, ls_computer_name, ls_text_string, ls_return
>
> // build string for footer text
> ls_computer_name = f_get_machine_name()
> ls_text_string = "Compiled on " + SQLCA.ServerName + " (" + &
>      SQLCA.Database + ") at " + string(now()) + " to " + ls_computer_name
>
> // now build complete modify string for footer text
> ls_modstring = "CREATE text(band=footer alignment='0' text='" +
> ls_text_string + "'" + &
>        " border='0' color='0' x='32' y='4' height='40' width='2000' " + &
>      " name=st_footer  font.face='Small Fonts' font.height='-6'"+ &
>      " font.weight='400'  font.family='2' font.pitch='2' font.charset='0'"
+
> &
>      " background.mode='2' background.color='16777215' )"
>
>
> // add text to summary
> ls_return = dw_1.Modify(ls_modstring)
>
> // now increase height of footer to reveal footer text
> ls_modstring = "DataWindow.footer.height='100'"
> ls_return = dw_1.Modify(ls_modstring)
>
> --------------------------------------------------------------------------
--
> ---------------------------
>
>


0
Philip
9/20/2000 10:48:15 AM
It should be

ls_modstring = "st_footer.text='" + ls_text_string + "'"

S.

--
Simon Caldwell
Get Real Systems Ltd
Holtby Manor, Stamford Bridge Road, York, YO19 5LL
Tel 01904 481999 Fax 01904 481666
Visit us at www.getrealsystems.com

Specialists in e-Procurement and supply chain technology


"Philip Sparke(Sybase Forums)" <psparke@lineone.net> wrote in message
news:HGq#iIvIAHA.201@forums.sybase.com...
> Thanks for the information, but using the syntax below I cannot get it to
> modify the text post creation. I suggest it is down to my syntax and
> inexperience!
>
> Please find below the function code which creates the footer text and
> attempts to modify same subject to whether it is the first report or
> subsequent reports:
> ==========================================================
> wf_multiprint_footer(i_row_no, s_dwtype, s_report_name)
> ------------------------------------------------------------
> // when i_row_no = 1 this is the first report on page 1
> // when i_row_no > 1 then these are subsequent reports/pages
> // s_dwtype defines whether footer for datawaindow (dw) or (ds)
> // s_report_name = report's name/title
> ==========================================================
> string ls_modstring, ls_computer_name, ls_text_string, ls_return
>
> IF i_row_no = 1 THEN
>
>      // build string for footer text
>      ls_computer_name = f_get_machine_name()
>      ls_text_string = "Compiled on " + SQLCA.ServerName + " (" + &
>          SQLCA.Database + ") at " + string(now()) + " to " +
> ls_computer_name + "   (" + s_report_name + ")"
>
>      // now build complete modify string for footer text
>      ls_modstring = "CREATE text(band=footer alignment='0' text='" +
> ls_text_string + "'" + &
>            " border='0' color='0' x='32' y='4' height='40' width='2000' "
+
> &
>          " name=st_footer  font.face='Small Fonts' font.height='-6'"+ &
>          " font.weight='400'  font.family='2' font.pitch='2'
> font.charset='0'" + &
>          " background.mode='2' background.color='16777215' )"
>
>      IF s_dwtype = 'DS' THEN
>
>       // add text to footer
>       ls_return = ds_1.Modify(ls_modstring)
>
>       // now increase height of footer to reveal footer text
>       ls_modstring = "DataWindow.footer.height='100'"
>       ls_return = ds_1.Modify(ls_modstring)
>
>      END IF
>
>      IF s_dwtype = 'DW' THEN
>
>       // add text to summary
>       ls_return = dw_1.Modify(ls_modstring)
>
>       // now increase height of footer to reveal footer text
>       ls_modstring = "DataWindow.footer.height='100'"
>       ls_return = dw_1.Modify(ls_modstring)
>
>      END IF
>
>      // Display in w_frame status bar
>      w_frame.SetMicroHelp(s_dwtype + "(" + string(i_row_no) + "): " +
> ls_text_string)
>
> ELSE
>
>      // build new string for footer text
>      ls_computer_name = f_get_machine_name()
>     ls_text_string = "Compiled on " + SQLCA.ServerName + " (" + &
>          SQLCA.Database + ") at " + string(now()) + " to " +
> ls_computer_name + "   (" + s_report_name + ")"
>
>      ls_modstring = "st_footer.text=" + ls_text_string
>
>      // For additional pages update report time in footer by modifying
text
>     IF s_dwtype = 'DS' THEN
>
>           ds_1.Modify(ls_modstring)
>
>      END IF
>
>      IF s_dwtype = 'DW' THEN
>
>           dw_1.Modify(ls_modstring)
>
>      END IF
>
>      // Display in w_frame status bar
>      w_frame.SetMicroHelp(s_dwtype + "(" + string(i_row_no) + "): " +
> ls_text_string)
>
> END IF
> =============================================================
> "Simon Caldwell" <simonDOTcaldwellATgetrealsystemsDOTcom> wrote in message
> news:ijCAt8hIAHA.202@forums.sybase.com...
> >
> > "Philip Sparke(Sybase Forums)" <psparke@lineone.net> wrote in message
> > news:VHffA9YIAHA.201@forums.sybase.com...
> > > Hi All,
> > >
> > > How to modify text 'xyz' after issuing a dw_1.modify("CREATE
> > > TEXT(band='footer' text='xyz' ............)")
> > >
> >
> > Your syntax presumably includes "name='your_text_name' "
> > So then to change the text, just code
> dw_1.Modify("your_text_name.text='new
> > value' ")
> >
> > HTH
> >
> > Simon
> >
> > --
> > Simon Caldwell
> > Get Real Systems Ltd
> > Holtby Manor, Stamford Bridge Road, York, YO19 5LL
> > Tel 01904 481999 Fax 01904 481666
> > Visit us at www.getrealsystems.com
> >
> > Specialists in e-Procurement and supply chain technology
> >
> >
> >
>
>
> "Sybase Forums" <psparke@lineone.net> wrote in message
> news:3#rAqjUIAHA.275@forums.sybase.com...
> > Hi All,
> >
> > I am new to Powerbuilder and on a steep learning curve so please bear
with
> > me and do not assume I know anything in your response!
> >
> > I have a datawindow control 'dw_1' in a window 'w_report_1'
> >
> > With the w_report_1.open() event, I assign a data object
'd_site_details'
> to
> > the 'dw_1' control in the following code extract. I use  a loop to
provide
> > different retrieval arguments for 'd_site_details' from a datastore so
> that
> > we get different details for different system accounts. After each
> retrieval
> > we print dw_1 together with a text footer which is created using a
> function
> > 'wf_multiprint_footer()' also shown beow.
> >
> > My problem is , I want to update the time in the text footer for each
> system
> > account printed.
> >
> > But what I find is that using this function appears to create 'new text'
> > which is then overlayed/superimposed on top of the previous text such
that
> > the times (the only part that changes) becomes un readable!
> >
> > How can I overcome this problem.
> >
> > Thanks in advance for any help given!
> >
> > ---------------------------------------
> > w_report_1.open():
>
> --------------------------------------------------------------------------
> --
> > ---------------
> > integer li_rv, li_pagecount, ll_tocompile, li_proceed, n
> > long ll_rows, ll_system_no,  ll_printed, ll_notprinted, ll_compiled
> > string ls_sys_type, ls_rpttype, ls_null
> > datastore ds_2
> >
> > file://MessageBox("SysType_id specified:", s_sys_type)
> > li_proceed = wf_proceed():
> >
> > IF li_proceed = 1 THEN
> >   isnull(ls_null)
> >
> >   ls_rpttype = 'Inst/A4 All Systype_id'
> >
> >   wf_report_usage(ls_rpttype, 'N', string(l_start), string(l_end),&
> >         ls_null, ls_null, ls_null, ls_null)
> >
> >   ds_2 = create datastore
> >   ds_2.dataobject = 'd_sys_all_systype_id'
> >   ds_2.settransobject(sqlca)
> >
> >   // Determine how many require compiling
> >   ll_tocompile = ds_2.retrieve(l_start, l_end)
> >
> >   ll_compiled = 0
> >   ll_printed = 0
> >   ll_notprinted = 0
> >   li_pagecount = integer(profilestring(const.app_ini, "daily",
> "pagecount",
> > ""))
> >
> >   wf_show_totals(ls_rpttype, ll_tocompile)
> >
> >   dw_1.dataobject = 'd_site_details'
> >   dw_1.settransobject(SQLCA)
> >
> > //  MessageBox("No of systems to process:", ll_tocompile)
> >
> >   for n = 1 to ll_tocompile
> >
> >    li_rv = wf_cancel_printing()
> >    yield()
> >    if li_rv = 1 then
> >     exit
> >    end if
> >    ll_system_no = ds_2.getitemnumber(n, 'system_no')
> >
> >    dw_1.retrieve(ll_system_no)
> >    IF SQLCA.SQLCode < 0 THEN
> >     MessageBox("SQL error", SQLCA.SQLErrText)
> >    END IF
> >
> >    ll_compiled ++
> >    ll_tocompile --
> >    wf_update_compile(ll_compiled, ll_tocompile)
> >
> >    wf_multiprint_footer()
> >    dw_1.print()
> >    ll_printed ++
> >    wf_pause_printing(ll_printed, li_pagecount)
> >
> >   next
> >
> > END IF
> >
> > IF isvalid(ds_2) THEN
> >  destroy(ds_2)
> > END IF
>
> --------------------------------------------------------------------------
> --
> > --------------------------
> >
> >
> >
> >
> >
> > -------------------------------------
> > Function wf_multiprint_footer():
>
> --------------------------------------------------------------------------
> --
> > -----------
> > string ls_modstring, ls_computer_name, ls_text_string, ls_return
> >
> > // build string for footer text
> > ls_computer_name = f_get_machine_name()
> > ls_text_string = "Compiled on " + SQLCA.ServerName + " (" + &
> >      SQLCA.Database + ") at " + string(now()) + " to " +
ls_computer_name
> >
> > // now build complete modify string for footer text
> > ls_modstring = "CREATE text(band=footer alignment='0' text='" +
> > ls_text_string + "'" + &
> >        " border='0' color='0' x='32' y='4' height='40' width='2000' " +
&
> >      " name=st_footer  font.face='Small Fonts' font.height='-6'"+ &
> >      " font.weight='400'  font.family='2' font.pitch='2'
font.charset='0'"
> +
> > &
> >      " background.mode='2' background.color='16777215' )"
> >
> >
> > // add text to summary
> > ls_return = dw_1.Modify(ls_modstring)
> >
> > // now increase height of footer to reveal footer text
> > ls_modstring = "DataWindow.footer.height='100'"
> > ls_return = dw_1.Modify(ls_modstring)
> >
>
> --------------------------------------------------------------------------
> --
> > ---------------------------
> >
> >
>
>


0
Simon
9/20/2000 11:25:49 AM
Reply: