Home > Archive > dBASE Questions and Answers > February 2006 > How can I use preview.wfm









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How can I use preview.wfm
Kurt Tanner

2006-02-11, 3:23 am

I call the report from a form as follows:

function PBDRUCKEN_onClick
private cTabelle
cTabelle = form.listbox1.value
if cTabelle = "Buchung.dbf"
Jahr = year(Date())
else
cTabelle = left(cTabelle,9)
Jahr = stuff(cTabelle, 1, 7,"20")
endif

// call Report
set procedure to Gruppen2.rep additive
rGruppen2Rep = new Gruppen2Report()
// der Query die neue Tabelle zuweisen
rGruppen2Rep.gruppen1.active := false
rGruppen2Rep.gruppen1.sql = [select Konto_Nr, R_Datum, Text, ;
Betrag, SUM(Betrag), Bez_Datum From "]+ cTabelle + ["] + ;
[GROUP BY Konto_Nr, R_Datum, Text, Betrag, Bez_Datum]
rGruppen2Rep.gruppen1.active := true
rGruppen2Rep.pagetemplate1.text1.text = "Ausgaben " + Jahr
rGruppen2Rep.render()
// nach schliessen des Reports, auch dieses Formular schliessen
form.close()
return

As I can here use preview.wfm?

Kurt Tanner
Switzerland
Michael Nuwer [dBVIPS]

2006-02-11, 7:23 am


First: Find the "Binaries" new group and
look for the following message

Date: Thu, 08 Dec 2005 09:00:59 -0500
From: Todd Kreuter <tkreuter@dbvips.usa>
Subject: Re: Preview.wfm 2.x beta

Download the ZIP file attached to this message
filename: NewPreview.zip

Use the NEWPREVIEW.WFM form inside this zip file.

Second: Change your code as indicated below:

>
> // call Report
> set procedure to Gruppen2.rep additive
> rGruppen2Rep = new Gruppen2Report()
> // der Query die neue Tabelle zuweisen
> rGruppen2Rep.gruppen1.active := false
> rGruppen2Rep.gruppen1.sql = [select Konto_Nr, R_Datum, Text, ;
> Betrag, SUM(Betrag), Bez_Datum From "]+ cTabelle + ["] + ;
> [GROUP BY Konto_Nr, R_Datum, Text, Betrag, Bez_Datum]
> rGruppen2Rep.gruppen1.active := true
> rGruppen2Rep.pagetemplate1.text1.text = "Ausgaben " + Jahr


set procedure to NewPreview.wfm additive
oPreviewForm = new PreviewForm()
oPreviewForm.viewer.ref = rGruppen2Rep
oPreviewForm.open()


> //// rGruppen2Rep.render()
> // nach schliessen des Reports, auch dieses Formular schliessen
> form.close()
> return

Kurt Tanner

2006-02-11, 11:23 am

> First: Find the "Binaries" new group and
> look for the following message
>
> Date: Thu, 08 Dec 2005 09:00:59 -0500
> From: Todd Kreuter <tkreuter@dbvips.usa>
> Subject: Re: Preview.wfm 2.x beta

-----------------------------------------
That works fine!
Thank-you.

Kurt Tanner
Michael Nuwer [dBVIPS]

2006-02-11, 8:23 pm

Kurt Tanner wrote:
>
> -----------------------------------------
> That works fine!
> Thank-you.
>
> Kurt Tanner


Your welcome. Keep in mind that this form is still considered beta.
Please let us know if you run into any problems. That said, we do not
expect any problem will be found :-).

Thanks, Todd, for making this form.
Ivar B. Jessen

2006-02-12, 3:23 am

On Sat, 11 Feb 2006 18:44:22 -0500, in dbase.how-to,
Subject: Re: How can I use preview.wfm,
Message-ID: <2KZB9X2LGHA.1148@news-server>,
"Michael Nuwer [dBVIPS]" <nuwermj@yahoo.com> wrote:


>Your welcome. Keep in mind that this form is still considered beta.
>Please let us know if you run into any problems. That said, we do not
>expect any problem will be found :-).


Michael,

I noticed a couple of issues when running the form from Run_me.prg. It was done
using Win2000/Plus 2.21/BLLT1DA0 as language driver in BDE and Plus.ini.

1) Run the form, click button "Next Page of report" ( Why is page spelt with
upper case P and report with lower case r? ) repeatedly until "Last page:"
displays 4, click button "First Page of report", in "View:" set value to 5 and
click button "Redisplay report", the result is a blank page. This should not
happen

2) Run the form, click button "Save as HTML" and get error:

PREVIEWFORM::PUSHHTM
L_ONCLICK
924
167
Error: Variable undefined: PRINTHTML

Changing line 924 from 'this.printHtml()' to 'this.form.printHtml()' fixes the
problem, but the resulting HTML file viewed in Netscape7 is lousy, the first
line in the report has the same font size as the remaining lines, the line
starting with 'Paint palette' is now spread over three lines.

The display in IE6 is pretty much the same as in Netscape, only here the words
'Total Quantity' is spread over two lines, in Word2000 and WordPerfect9 the
display looks like a sort of grid and is unuseable, in OpenOffice 1.1.0 the
display is the same as in Netscape.


Ivar B. Jessen


Michael Nuwer [dBVIPS]

2006-02-13, 7:24 am

Ivar B. Jessen wrote:
>
> I noticed a couple of issues


Thanks for this report.


> when running the form from Run_me.prg. It was done
> using Win2000/Plus 2.21/BLLT1DA0 as language driver in BDE and Plus.ini.
>
> 1) Run the form, click button "Next Page of report" ( Why is page spelt with
> upper case P and report with lower case r? ) repeatedly until "Last page:"
> displays 4, click button "First Page of report", in "View:" set value to 5 and
> click button "Redisplay report", the result is a blank page. This should not
> happen


Ok, thanks.

>
> 2) Run the form, click button "Save as HTML" and get error:
>
> PREVIEWFORM::PUSHHTM
L_ONCLICK
> 924
> 167
> Error: Variable undefined: PRINTHTML
>
> Changing line 924 from 'this.printHtml()' to 'this.form.printHtml()' fixes the
> problem,



Good, thanks.


> but the resulting HTML file viewed in Netscape7 is lousy, the first
> line in the report has the same font size as the remaining lines, the line
> starting with 'Paint palette' is now spread over three lines.


The Preview form and the report viewer control have no control over how
the HTML file is created. That is handled by dBASE internally. I agree
that the reporting engine produces poor HTML documents, however, I don't
know that there's anything we can do about it.

Ken Mayer [dBVIPS]

2006-02-13, 9:23 am

Ivar B. Jessen wrote:
> On Sat, 11 Feb 2006 18:44:22 -0500, in dbase.how-to,
> Subject: Re: How can I use preview.wfm,
> Message-ID: <2KZB9X2LGHA.1148@news-server>,
> "Michael Nuwer [dBVIPS]" <nuwermj@yahoo.com> wrote:
>
>
>
>
>
> Michael,
>
> I noticed a couple of issues when running the form from Run_me.prg. It was done
> using Win2000/Plus 2.21/BLLT1DA0 as language driver in BDE and Plus.ini.
>
> 1) Run the form, click button "Next Page of report" ( Why is page spelt with
> upper case P and report with lower case r? ) repeatedly until "Last page:"
> displays 4, click button "First Page of report", in "View:" set value to 5 and
> click button "Redisplay report", the result is a blank page. This should not
> happen


I may have fixed this ... this is a problem in the current version as
well, I believe.

I am attaching the current beta ...

> 2) Run the form, click button "Save as HTML" and get error:
>
> PREVIEWFORM::PUSHHTM
L_ONCLICK
> 924
> 167
> Error: Variable undefined: PRINTHTML
>
> Changing line 924 from 'this.printHtml()' to 'this.form.printHtml()' fixes the
> problem, but the resulting HTML file viewed in Netscape7 is lousy, the first
> line in the report has the same font size as the remaining lines, the line
> starting with 'Paint palette' is now spread over three lines.


Ah, Michael didn't have the latest version of the beta of Preview.wfm --
that issue was fixed awhile back. <g> (Not Michael's fault)

> The display in IE6 is pretty much the same as in Netscape, only here the words
> 'Total Quantity' is spread over two lines, in Word2000 and WordPerfect9 the
> display looks like a sort of grid and is unuseable, in OpenOffice 1.1.0 the
> display is the same as in Netscape.


As Michael points out, this is not a Preview.wfm issue, but one with
HTML and reports in dBASE in general. The safest way to generate an HTML
report from dBASE (using the report designer) is to make sure that the
text is clearly not overlapping, and that you use a mono-spaced font
when designing it ...

The better way is to just write your own code ... <g>

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase


Ivar B. Jessen

2006-02-13, 1:24 pm

On Mon, 13 Feb 2006 07:22:44 -0800, in dbase.how-to,
Subject: Re: How can I use preview.wfm,
Message-ID: <bBFaYJLMGHA.560@news-server>,
"Ken Mayer [dBVIPS]" < dbase@_nospam_golden
stag.net> wrote:


>Ah, Michael didn't have the latest version of the beta of Preview.wfm --
>that issue was fixed awhile back. <g> (Not Michael's fault)


I tried preview.wfm attached to your message. I looks like you fixed the bug
which allowed setting of a page number larger than for the last page.

At the same time you introduced a new bug :-)

When you use the button 'Next page of report' to go to page 2 or 3 you can go to
a lower pager number, but when you go to page 4 you are stuck and neither 'First
page of report' or 'Previous page of report' allows you to go to a lower page
number.

There is probably also problem with the settings of 'Start Page'/'End Page' as
those settings do not bear any relations to the number of 'pages' output to
HTML.


Ivar B. Jessen
Ken Mayer [dBVIPS]

2006-02-13, 8:24 pm

Ivar B. Jessen wrote:
> On Mon, 13 Feb 2006 07:22:44 -0800, in dbase.how-to,
> Subject: Re: How can I use preview.wfm,
> Message-ID: <bBFaYJLMGHA.560@news-server>,
> "Ken Mayer [dBVIPS]" < dbase@_nospam_golden
stag.net> wrote:
>
>
>
>
>
> I tried preview.wfm attached to your message. I looks like you fixed the bug
> which allowed setting of a page number larger than for the last page.
>
> At the same time you introduced a new bug :-)
>
> When you use the button 'Next page of report' to go to page 2 or 3 you can go to
> a lower pager number, but when you go to page 4 you are stuck and neither 'First
> page of report' or 'Previous page of report' allows you to go to a lower page
> number.


Um ... hmm. I tried that and it worked, I thought. Sigh. I will take
another look.

> There is probably also problem with the settings of 'Start Page'/'End Page' as
> those settings do not bear any relations to the number of 'pages' output to
> HTML.


Well, I can't speak much to the HTML end of things, really. I would
actually rather not have that button on the form, but someone really
wanted it ...

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
Ronnie MacGregor

2006-02-13, 8:24 pm


On Mon, 13 Feb 2006 07:22:44 -0800
Ken Mayer [dBVIPS] said :

> The better way is to just write your own code ... <g>


Alternatively use QR3 which has its own HTML output capability.

http://www.dbasedeveloper.co.uk/QR3/QR3.htm

--
Ronnie MacGregor
Scotland

Ronnie at
dBASEdeveloper
dot co dot uk

www.dBASEdeveloper.co.uk



Ken Mayer [dBVIPS]

2006-02-13, 8:24 pm

Ivar B. Jessen wrote:
> On Mon, 13 Feb 2006 07:22:44 -0800, in dbase.how-to,
> Subject: Re: How can I use preview.wfm,
> Message-ID: <bBFaYJLMGHA.560@news-server>,
> "Ken Mayer [dBVIPS]" < dbase@_nospam_golden
stag.net> wrote:
>
>
>
>
>
> I tried preview.wfm attached to your message. I looks like you fixed the bug
> which allowed setting of a page number larger than for the last page.
>
> At the same time you introduced a new bug :-)
>
> When you use the button 'Next page of report' to go to page 2 or 3 you can go to
> a lower pager number, but when you go to page 4 you are stuck and neither 'First
> page of report' or 'Previous page of report' allows you to go to a lower page
> number.
>
> There is probably also problem with the settings of 'Start Page'/'End Page' as
> those settings do not bear any relations to the number of 'pages' output to
> HTML.


See attached. I have fixed (by removing) the previous code I added. The
problem here is that unless you know what the last page number is for a
report, you can't set the code. I took a look and couldn't figure a
simple way to handle that.

I also set this version so that the HTML button is not visible (and
shifted things so there's no gap in the form) by default ... there's a
new parameter added to turn that on.

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase


Ronnie MacGregor

2006-02-13, 8:24 pm


On Mon, 13 Feb 2006 14:03:29 -0800
Ken Mayer [dBVIPS] said :

> I also set this version so that the HTML button is not visible (and
> shifted things so there's no gap in the form) by default ... there's a
> new parameter added to turn that on.


Good move.

--
Ronnie MacGregor
Scotland

Ronnie at
dBASEdeveloper
dot co dot uk

www.dBASEdeveloper.co.uk



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com