|
Home > Archive > Programming with dBASE > October 2005 > Report Preview form question
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 |
Report Preview form question
|
|
| Mark Wood 2005-10-17, 1:26 pm |
| I have a question about the report preview form (originally coded by Ken
Mayer).
In the circumstances in which i am using this useful form, I launch the
form, then move focus back to the data editing form i launched it from,
alter some data and move back to the report viewer to see the results of my
edit(s).
The function PUSHRERENDER_onClick
routine is what i am trying to use to
refresh the page (called from the preview form's on_got focus event).
However the altered data is not displayed, its is as it was before the
edits. Additionally if i use the next page button then the previous page
button the updates are shown.
I'd be grateful if someone familliar with this form could shed a little
kight on this for me.
Thanks in advance
Mark
| |
| Michael Nuwer [dBVIPS] 2005-10-17, 1:26 pm |
|
This might be a bit tricky. Could you please show us 1) the code you
use to call the Preview form and 2) the code you use in the data editing
form to change the report properties, i.e how do tell the report to
update itself.
The two attached files might give an idea of one way to achieve your goal.
Mark Wood wrote:
> I have a question about the report preview form (originally coded by Ken
> Mayer).
>
> In the circumstances in which i am using this useful form, I launch the
> form, then move focus back to the data editing form i launched it from,
> alter some data and move back to the report viewer to see the results of my
> edit(s).
>
> The function PUSHRERENDER_onClick
routine is what i am trying to use to
> refresh the page (called from the preview form's on_got focus event).
> However the altered data is not displayed, its is as it was before the
> edits. Additionally if i use the next page button then the previous page
> button the updates are shown.
>
> I'd be grateful if someone familliar with this form could shed a little
> kight on this for me.
>
> Thanks in advance
>
> Mark
>
>
| |
| Bruce Beacham 2005-10-17, 1:26 pm |
| Mark Wood wrote:
> In the circumstances in which i am using this useful form, I launch the
> form, then move focus back to the data editing form i launched it from,
> alter some data and move back to the report viewer to see the results of my
> edit(s).
>
> The function PUSHRERENDER_onClick
routine is what i am trying to use to
> refresh the page (called from the preview form's on_got focus event).
My experience is that if your report is two or more pages in length you
can change pages and that will reflect the changes in the data. But
one page only of data means you have to re-run the form.
Bruce Beacham
| |
| Mark Wood 2005-10-17, 1:26 pm |
| Thanks for your tip Michael, I have managedto get it working because of your
help.
Calling the reExecute() method from my calling form rather than the onFocus
event of the previewForm worked fine
Keep up the good work :)
Mark
"Michael Nuwer [dBVIPS]" <nuwermj@no.spam.yahoo.com> wrote in message
news:fiO2UwB0FHA.1044@news-server...
>
> This might be a bit tricky. Could you please show us 1) the code you
> use to call the Preview form and 2) the code you use in the data editing
> form to change the report properties, i.e how do tell the report to
> update itself.
>
> The two attached files might give an idea of one way to achieve your goal.
>
>
>
> Mark Wood wrote:
my[color=darkred]
>
>
----------------------------------------------------------------------------
----
> ** END HEADER -- do not remove this line
> //
> // Generated on 10/13/2005
> //
> parameter bModal
> local f
> f = new ReportTestForm()
> if (bModal)
> f.mdi = false // ensure not MDI
> f.readModal()
> else
> f.open()
> endif
>
> class ReportTestForm of FORM
> with (this)
> height = 16.0
> left = 51.5
> top = 0.0
> width = 40.0
> text = ""
> endwith
>
> this.PUSHBUTTON1 = new PUSHBUTTON(this)
> with (this.PUSHBUTTON1)
> onClick = class::PUSHBUTTON1_O
NCLICK
> height = 1.0909
> left = 11.0
> top = 4.5
> width = 15.2857
> text = "Open report"
> endwith
>
> this.ENTRYFIELD1 = new ENTRYFIELD(this)
> with (this.ENTRYFIELD1)
> height = 1.0
> left = 9.0
> top = 3.0
> width = 22.0
> value = "Entryfield1"
> endwith
>
> this.PUSHBUTTON2 = new PUSHBUTTON(this)
> with (this.PUSHBUTTON2)
> onClick = class::PUSHBUTTON2_O
NCLICK
> height = 1.0909
> left = 11.0
> top = 6.0
> width = 15.2857
> text = "Update report"
> endwith
>
>
> function PUSHBUTTON1_onClick
> set procedure to :duflp:preview.wfm additive
> aParams = new AssocArray()
> aParams[ "Title" ] = form.entryfield1.value
> form.fPreview = new PreviewForm()
> //fPreview.bModal = true
> form.fPreview.params = aParams
> form.fPreview.viewer.fileName := "TestReport.rep"
> // new to version 2.18
> //fPreview.bClose = false
> form.fPreview.Open()
> return
>
> function PUSHBUTTON2_onClick
> form.fPreview.params[ "Title" ] = form.entryfield1.value
> form.fPreview.viewer.reExecute()
> return
>
> endclass
>
>
----------------------------------------------------------------------------
----
> ** END HEADER -- do not remove this line
> //
> // Generated on 04/14/2005
> //
> local r
> r = new TestReport()
> r.render()
>
> class TestReport of DUFLPCREPORT from :dUFLP:Duflp.crp
>
>
> function setParams
> ? "setParams"
> //if form.params.iskey( "Title" )
> form.pagetemplate1.kmtitletext11.text := ;
> form.params[ "Title" ]
> //endif
> return
> endclass
| |
| Mark Wood 2005-10-17, 1:26 pm |
| Thanks for the tip, i'll ensure my code takes account of this.
Cheers
Mark
"Bruce Beacham" <bbeacham@beacham.no-spam.co.uk> wrote in message
news:1emDOKJ0FHA.1236@news-server...
> Mark Wood wrote:
>
my[color=darkred]
>
> My experience is that if your report is two or more pages in length you
> can change pages and that will reflect the changes in the data. But
> one page only of data means you have to re-run the form.
>
>
> Bruce Beacham
| |
| Michael Nuwer [dBVIPS] 2005-10-17, 1:26 pm |
| Mark Wood wrote:
>
> Calling the reExecute() method from my calling form rather than the onFocus
> event of the previewForm worked fine
Thanks for the success report, Mark.
|
|
|
|
|