Home > Archive > Programming with dBASE > December 2005 > Functions in reports









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 Functions in reports
Mark Wood

2005-12-06, 9:23 am

I have a report where i have a function convertTime that takes input in
minutes and converts to HH:MM format.

I use it thus
class::convertTime(r
owTimeStamps.fields["operationTime"].value,4)

The function is within the class.

If i try and edit this report in the designer i get "class not found
timeSheetReport::con
vertTime" and dBase crashes

Has anyone seen this behaviour before? Anyone got a fix?

Thanks

Mark


Michael Nuwer [dBVIPS]

2005-12-06, 11:23 am

Mark Wood wrote:
> I have a report where i have a function convertTime that takes input in
> minutes and converts to HH:MM format.
>
> I use it thus
> class::convertTime(r
owTimeStamps.fields["operationTime"].value,4)
>
> The function is within the class.
>
> If i try and edit this report in the designer i get "class not found
> timeSheetReport::con
vertTime" and dBase crashes
>
> Has anyone seen this behaviour before? Anyone got a fix?


Is your report subclassed from a custom report? If yes, then I have seen
this behaviour. Let me know and I'll discuss the fix.
Mark Wood

2005-12-06, 11:23 am


"Michael Nuwer [dBVIPS]" <nuwermj@nospam.please.yahoo.com> wrote in message
news:djf0fqn%23FHA.1520@news-server...
> Mark Wood wrote:
>
> Is your report subclassed from a custom report? If yes, then I have seen
> this behaviour. Let me know and I'll discuss the fix.


Thanks for the reply Nichael,

Yes i have subclassed this report

the custom report sets up printer defaults, page Template, streamframe,
streamsource see code below

Mark

class PlanningCReport of REPORT custom
with (this)
metric = 3 // Inches
autoSort = false
endwith

with (this.printer)
duplex = 1 // None
orientation = 1 // Portrait
paperSource = 7
paperSize = 9
resolution = 4 // High
color = 2 // Color
trueTypeFonts = 4 // Outline
endwith

this.PAGETEMPLATE1 = new PAGETEMPLATE(this)
with (this.PAGETEMPLATE1)
height = 11.6924
width = 8.2674
marginTop = 0.25
marginLeft = 0.25
marginBottom = 0.25
marginRight = 0.25
gridLineWidth = 0
endwith

this.PAGETEMPLATE1.STREAMFRAME1 = new STREAMFRAME(this.PAGETEMPLATE1)
with (this.PAGETEMPLATE1.STREAMFRAME1)
height = 10.69
left = 0.0
top = 0.75
width = 7.77
form.STREAMFRAME1 = form.pagetemplate1.streamframe1
endwith

this.STREAMSOURCE1 = new STREAMSOURCE(this)
this.firstPageTemplate = this.form.pagetemplate1
this.form.pagetemplate1.nextPageTemplate = this.form.pagetemplate1
this.form.pagetemplate1.streamframe1.streamSource =
this.form.streamsource1

endclass


Michael Nuwer [dBVIPS]

2005-12-06, 11:23 am

Mark Wood wrote:
> Yes i have subclassed this report
>
> the custom report sets up printer defaults, page Template, streamframe,
> streamsource see code below
>



Ok, This is a known bug. Try this: In the subclassed report create an
onDesignOpen event handler with the following:

function form_onDesignOpen(bF
romPalette)
set procedure to program(1) additive
return


If that doesn't work try adding the "set proc" line in the constructor
like this:

class my_Report of DUFLPCREPORT from "DUFLP.CRP"
set procedure to program(1) additive
set procedure to repcntl.cc additive
set procedure to REPORT.CC additive


Beware that in this second case the report designer will delete the line
every time you modify and save the report, so you have to add the line
every time you attempt an edit.

Mark Wood

2005-12-06, 11:23 am

"Michael Nuwer [dBVIPS]" <nuwermj@nospam.please.yahoo.com> wrote in message
news:wnRKT3n%23FHA.1232@news-server...
> Mark Wood wrote:
>
>
> Ok, This is a known bug. Try this: In the subclassed report create an
> onDesignOpen event handler with the following:
>
> function form_onDesignOpen(bF
romPalette)
> set procedure to program(1) additive
> return
>
>
> If that doesn't work try adding the "set proc" line in the constructor
> like this:
>
> class my_Report of DUFLPCREPORT from "DUFLP.CRP"
> set procedure to program(1) additive
> set procedure to repcntl.cc additive
> set procedure to REPORT.CC additive
>
>
> Beware that in this second case the report designer will delete the line
> every time you modify and save the report, so you have to add the line
> every time you attempt an edit.
>


Thanks very much for your help your fix worked in my report.

Regards

Mark


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