Jack
I have changed the html to include my raw time.frx
http://www.calcpay.co.uk/info/hockeytime/cursorrowtoinlinereport.html
The time.frx is taken from XFRX demo\sales.frx, thus open that adjust it 
re the image & save to time.frx

If you have downloaded XFRX then just put time.frx on the same folder, 
ie where the 'demoN.scx' is. (the 'N' for me is 9)
run demoN.scx & choose the 'Sales summary with graphs, sent to XFRX 
previewer'. This is where I got my inspiration.

Save the code below into a prg, 'hockeytime.prg' in the same folder as 
'demoN.scx'
You will thus have 'demoN.scx', 'time.frx' & 'hockeytime.prg' all in the 
one folder. That should fix any pathing problems.

The code below is pretty procedural, no giggling please
*************
****** hockeytime


CREATE CURSOR 'hocktime' ;
        ( ;
        shirt i ,;
        tstart i , ;
        sused   i ,;
        ctype   c(1) ;
        )

* enter raw info
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (4,0,50,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (4,125,100,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (4,280,50,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (4,360,59,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (4,500,60,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (4,660,60,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (4,840,70,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (4,950,45,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (4,1050,10,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (4,1141,59,'P')

INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (9,60,45,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (9,320,40,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (9,405,10,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (9,415,120,'N')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (9,535,70,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (9,710,50,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (9,890,10,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (9,1080,60,'P')

INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (41,0,50,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (41,125,100,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (41,280,50,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (41,360,59,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (41,500,60,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (41,660,60,'P')

INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (91,60,45,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (91,320,40,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (91,405,10,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (91,415,120,'N')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (91,535,70,'P')
INSERT INTO 'hocktime'  (shirt,tstart,sused,ctype) VALUES (91,710,50,'P')

BROWSE

* get maximum number of ON Ice events
SELECT shirt, COUNT(shirt) as cntshirtno;
        FROM hocktime ;
        GROUP BY shirt ;
        ORDER BY shirt ;
        INTO CURSOR curgroupno

CALCULATE MAX(curgroupno.cntshirtno) TO maxnofield
? maxnofield

* convert tstart,sused,ctype to 1 field
* use space between them as we unparse with GETWORDNUM
SELECT shirt, ;
        TRANSFORM(tStart,'999999') + ' ' + TRANSFORM(sUsed,'9999') + ' ' + 
cType as combinfo ;
        FROM hocktime ;
        ORDER BY shirt , tstart ;
        INTO CURSOR curpreconvert
        
* create a cursor with the number of fields we need
ltext = "create cursor 'crostab' ( shirt I, "
FOR lnum =1 TO maxNoField -1
        lText = ltext + 'fldno'+TRANSFORM(lNum) + ' C(15), '
ENDFOR
lText = lText + 'fldno'+TRANSFORM(maxNoField) + ' C(15) )'
? lText
* Run the cursor
&lText
RELEASE lText

** fill the working cursor
* add record
APPEND BLANK
SELECT ('curpreconvert')
* identifier for shirt number
lshirt = curpreconvert.shirt
* add first one
replace Shirt WITH CurPreconvert.shirt IN 'crostab'
* number to enter the info into the correct field
lNum = 1
SCAN
        IF lShirt <> CurPreconvert.shirt
                lShirt = CurPreconvert.shirt
                lNum = 1
                INSERT INTO 'crostab' (shirt) VALUES (CurPreconvert.shirt)
        ENDIF
        lFldNo = 'FldNo'+TRANSFORM(lNum)
        replace &lFldno WITH CurPreconvert.combinfo IN 'crostab'
        lNum = lNum + 1
ENDSCAN


* display it on the screen just for a laugh
SELECT ('Crostab')
SCAN
        ? TRANSFORM(shirt)
        FOR lnum = 1 TO maxNoField
         lfield =  EVALUATE('fldno' + TRANSFORM(lNum))
         lstart = GETWORDNUM(lfield,1)
         lWidth = GETWORDNUM(lfield,2)
         lType  = GETWORDNUM(lfield,3)
         lDisplay = '------------'
         lDisplay = LEFT(ldisplay,VAL(lWidth)/10)
         ?? lDisplay at VAL(lStart)/10 + 10
        ENDFOR
        ?
ENDSCAN

******
* useing XFRX
* this comes from their sales graphics example
** create report
SET PATH TO xfrxlib, src, libs
SET CLASSLIB TO xfrxlib ADDITIVE
SET LIBRARY TO xfrxlib.fll

local loSession, lnRetval, loXFF, loPreview, loScripts
loSession=EVALUATE([xfrx("XFRX#LISTENER")])
lnRetVal = loSession.SetParams(,,,,,,"XFF") && no name = just in memory
If lnRetVal = 0
        loScripts = createobject("myXFRXScripts")
        *
        * rectangle-bound scripts
        *
        loSession.registerScript(loScripts,"displayGraph")
        REPORT FORM time object loSession
        *
        * the XFRX#DRAW object reference is stored in oxfDocument property
        *
        loXFF = loSession.oxfDocument
        *
        * initialize the previewer
        *
        SET PATH TO xfrxlib
        SET CLASSLIB TO xfrxlib ADDITIVE
        loPreview = CREATEOBJECT("frmMPPreviewer")
        loPreview.windowtype = 1
        loPreview.PreviewXFF(loXFF)
        loPreview.show(1)
ENDIF

DEFINE CLASS myXFRXScripts as Custom

        PROCEDURE DisplayGraph
        LPARAMETERS oXFD
        oXFD.setUnit("pt")
        oXFD.setFont("Arial",10)
        LOCAL loBox, i, lnBarWidth, lnInnerLeft, lnInnerTop, lnInnerWidth, 
lnInnerHeight
        loBox = oXFD.getBoundingRectangle()
        oXFD.setColor(0,0,0, -1,-1,-1)
        oXFD.drawRectangle(0,0,loBox.nWidth,loBox.nHeight,0,0,2)
        oXFD.setColor(0,0,0,0,0,0,0,1)
        * go through all the fields & parse out the Time Start/Time On 
Ice/Playing or Naughty Step
        FOR i = 1 TO maxNoField
                lHeight = 10
                lfield  =  EVALUATE('crostab.fldno' + TRANSFORM(i))
                IF NOT EMPTY(lField)
                 lstart = VAL(GETWORDNUM(lfield,1))/5
                 lLenght= VAL(GETWORDNUM(lfield,2))/5
                 lType  = GETWORDNUM(lfield,3)
                 IF lType = 'P'
                        oXFD.setBackColor(255,0,0)
                 ELSE
                        oXFD.setBackColor(255,255,0)
                 ENDIF
                 oXFD.drawRectangle(1+lstart, 2,lLenght, lHeight)
                ENDIF
        endfor
endproc

* DONE

************

Andrew Stirling
01250 874580
http://www.calcpay.co.uk
HMRC Accredited UK payroll program

Jack Skelley wrote:
> Good Afternoon Andrew:
> WOW! Impressive is an understatement.
> So I downloaded the files and extracted them and then could get nothing to 
> work.
> I need to spend more with this and if you could point me in correct direction 
> on how to make this work I would be a 
> happy camper. Thanks for your demo.
> I also spent some time trying to append records to the .FRX with the 
> rectangle size and position and called the REPORT. 
> This works ok but is a real PITA. I like your solution better.
> And I know you can't alter the .FRX after the REPORT is called. If you could 
> that would be really sweet to call a UDF 
> out of the detail band and change your objects then resume.
> No shirt (called a sweater in hockey circles) swap at the end. But at the end 
> of each Stanley Cup round all the players 
> line up on the ice and shake hands. I think it is the only sport that does 
> this.
> Again thanks for your input.
> Regards,
> 
> Jack
> 
> 
> Andrew Stirling wrote:
>> Jack wanted this reproduced
>> http://www.nhl.com/scores/htmlreports/20062007/SC030125.HTM
>>
>> Here is my raw interpretation
>> http://www.calcpay.co.uk/info/hockeytime/cursorrowtoinlinereport.html
>>
>> I finished up using XFRX.
>>
>> So this girly hockey thing, do the guys swap shirts at the end?
>>
>>
>> Andrew Stirling
>> 01250 874580
>> http://www.calcpay.co.uk
>> HMRC Accredited UK payroll program



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/%(messageid)s
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to