Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Exporting runtime DW to HTML format

4 views
Skip to first unread message

Magno Condori

unread,
Nov 20, 2000, 3:00:00 AM11/20/00
to
Please, I have a problem.


I'm trying to export a datawindow,
the datawindow is created dinamically.


first, I buil a sql sentence like this:

select sf_getname( id ) as code
sf_getdatax(id, ...) as t1s1,
sf_getdatax(id, ...) as t1s2,
sf_getdatax(id, ...) as t1s3,
sf_getdatax(id, ...) as t1s4
from grp_headers
where id = 667
and cod_row = 100
and cod_column = 200
order by 1


after that, I use the sql sentence to create a datawindow,
then :

ls_syntax = sqlca.SyntaxFromSQL (
is_sql_global,"style(type=grid)",ls_error )
if ls_syntax = '' then
messagebox('',ls_error)
return ls_error
end if

dw_1.create(ls_syntax, "", ls_error)

if ls_error <> '' then return ls_error

dw_1.settransobject(sqlca)
dw_1.retrieve()

next, I create computed fields and texts into this datawindow,
then I use modify as follow:

dw_1.modify("datawindow.htmlgen.clientevents='1'
datawindow.htmlgen.clientvalidation='1'
datawindow.htmlgen.clientcomputedfields='1'
datawindow.htmlgen.clientformatting='1'
datawindow.htmlgen.clientscriptable='1'
datawindow.htmlgen.generatejavascript='1'
datawindow.htmlgen.browser='Mozilla/4.x (): Netscape 4.x'
datawindow.htmlgen.htmlversion='4.0'")

Finally, as I want to export these reports to Excel or HTML formats;
but with every texts and computed fields...

then I tried follow sentence:

ls_htmlstring = ld_ds.Object.DataWindow.Data.HTMLtable


and the result is a Dr. Watson problem, it's in Windows NT:

Aplication Error
unknown error.

thanks,

Magno

Bruce Armstrong [TeamSybase]

unread,
Nov 21, 2000, 3:00:00 AM11/21/00
to
OK, I'm lost. You were doing everything with dw_1 until you wanted to grab
the HTML, and then you referenced ld_ds.

On Mon, 20 Nov 2000 15:09:46 -0500,
in powersoft.public.powerbuilder.web-pb

Bruce Armstrong [TeamSybase]
mailto:Bruce.A...@teamsybase.com

Preach the gospel at all times. If necessary, use words. [Francis of Assisi]
http://www.kidbrothers.org | http://www.fccwc.org
http://www.harvest.org/knowgod/index.htm | http://www.needhim.org
http://www.jesusfilm.org/view/realvideo/rv/languages/english.ram

-----------== Posted via the PFCGuide Web Newsreader ==----------
http://www.pfcguide.com/_newsgroups/group_list.asp

Magno Condori

unread,
Nov 22, 2000, 3:00:00 AM11/22/00
to
oh!!
excuse me Sr, in the statement :

ls_htmlstring = ld_ds.Object.DataWindow.Data.HTMLtable

ld_ds must be dw_1

Thanks a lot,

Magno

"Bruce Armstrong [TeamSybase]" ha escrito:

Bruce Armstrong [TeamSybase]

unread,
Nov 22, 2000, 3:00:00 AM11/22/00
to
Ok, here's a couple of other things to look at:

1. You're manipulating HTMLGen properties, but I don't ever see that you
turned the HTMLDW property on.

2. You're manipulating HTMLGen properties, but you are using the
Object.DataWindow.Data.HTMLtable property to get the HTML. That property
is unaffected by the HTMLGen properties (from the online help):

"Data.HTMLTable is not affected by the HTMLDW property and doesn't generate
a client control with events and support for scripting in the web page."

What you might want to use instead is the Data.HTML property (once again
from the online help):

"When HTMLDW is set to No, the value of Data.HTML is the same as the value
of HTMLTable—a read-only HTML table that displays all retrieved rows.
When the HTMLDW property is set to Yes, the value of Data.HTML is a form
that supports data input with client scripts for data validation and events.
The generated string for Data.HTML includes:

· HTML input elements
· JavaScript for validating newly entered data based on validation rules in
the DataWindow object
· HTML and JavaScript for navigation based on DataWindow Button controls
with scrolling actions
· State information about the modification status of data items"

Note that unless you turn on the HTMLDW property, the Data.HTML and
Data.HTMLTable will give you essentially the same results.

On Wed, 22 Nov 2000 09:28:57 -0500,

Magno Condori

unread,
Nov 22, 2000, 3:00:00 AM11/22/00
to
thanks,
but, I tried both with html and with htmltable,
aditionally I considered your advances,

in my case I have a datawindow control (inherited from pfc u_dw),
but without Datawindow Object, because it's created as you saw in
runtime,
do you remember?, because Online help says:

"Generating HTML
You can use any of several techniques to generate HTML from a DataWindow
object or a DataStore."

/******SCRIPT******/
//dw_display contains the dw created dinamically
//ld_ds is used to consider the online help

datastore ld_ds
string ls_syntax, ls_error
string ls_html

ls_html =
tab_padre.tabpage_paso_3.dw_display.modify('Datawindow.HTMLDW=yes')
messagebox('',ls_html)

ls_html =
tab_padre.tabpage_paso_3.dw_display.modify("Datawindow.htmltable.border='1'
Datawindow.htmltable.cellpadding='1'
Datawindow.htmltable.cellspacing='1'
Datawindow.htmltable.generatecss='1' Datawindow.htmltable.nowrap='1'")
messagebox('',ls_html)


ls_syntax =
tab_padre.tabpage_paso_3.dw_display.describe('Datawindow.syntax')

ld_ds = create n_ds
ld_ds.create(ls_syntax, ls_error)

ld_ds.settransobject(sqlca)

ld_ds.retrieve()

//THEN, UNKNOWN ERROR APLICATION IS HERE
ls_html = ld_ds.object.datawindow.data.htmltable
messagebox('',ls_html)
return


/********END**********/

Magno Condori

unread,
Nov 22, 2000, 3:00:00 AM11/22/00
to
i think i founded something interesting,
1) i tried to access to data.htmlable property before that i created a
text into this datawindow and it's OK.
2) i tried step 1) after the text creation with modify, and there is an
error
wich is the problem?, maybe my script... i don't think so

//and the script that i used to create the text is:

idw_display.Modify(&
"create text(band=Header " + &
"color='"+string(rgb(0,0,0))+"' " + &
"alignment='2' " + &
"border='6' " + &
"moveable=0 " + &
"background.mode='0' " + &
"background.color='12632256' " + &
"resizeable=0 " + &
"x='"+ string(ll_text_x) + "' "+ &
"y='"+string(li_text_y)+"' " + &
"height='"+string(li_text_height - 10)+"' " + &
"width='"+ string(ll_text_width)+"' " + &
"text='"+ is_titulos[li_contador] + "' " + &
"name=" + 'titulo_' + string(li_contador) + ' ' + &
"Font.Height='-8')")

this sentence return ''

well, but I need create texts and computed fields.

0 new messages