Page 1 of 1

Can I change the report viewer ?

Posted: Mon Mar 12, 2007 3:39 pm
by Milan Mehta
Dear All,

One of my client is an old one and he finds it difficult to make out the report in our Report preview dialog. He wants to view the report in slightly bigger size (bigger than 1 and smaller than 2) and with a cursor like line which show which is the current line. He tend to mix two lines when report is horizontally long.

In nut shell, is there any alternate viewer I can use only in this case.

TIA

Milanl

Posted: Mon Mar 12, 2007 3:56 pm
by James Bott
Milan,

To provide a different magnification you can modify the RPREVIEW.PRG file.

To get a highlight is more difficult. One way would be to print the report to a file, create a temp dbf with a single wide field, then read the report file and post one line to each record of the browse. Finally browse the temp.dbf with a browser with the cell lines turned off.

I don't know what your report looks like but if it is simple list, I would just create a browse instead of generating a report. Let the user just browse the data they want to see. You might be able to just set an index and scope on an existing DBF or create a temp dbf if you must.

James

Re: Can I change the report viewer ?

Posted: Mon Mar 12, 2007 4:19 pm
by Enrico Maria Giordano
Milan Mehta wrote:[...] and with a cursor like line which show which is the current line. He tend to mix two lines when report is horizontally long.
Can't you just activate lSeparator (or similar) to draw horizontal lines separating the report lines?

EMG

Posted: Mon Mar 12, 2007 6:18 pm
by Otto
For a hair cross you should try:
rpreview.prg
oMeta1:bMMoved:={|y,x,flags| oMeta1:line (y,0,y,500) }
But there is some extra work to save/restore the screen.
Otto

rpreview.prg
oMeta1:bMMoved:={|y,x,flags| oMeta1:line (y,0,y,500) }


oMeta1 := TMetaFile():New( 0, 0, 0, 0,;
aFiles[1],;
oWnd,;
CLR_BLACK,;
CLR_WHITE,;
oDevice:nHorzRes(),;
oDevice:nVertRes() )

oMeta1:oCursor := oCursor

Posted: Tue Mar 13, 2007 9:53 am
by Otto
Hello,

HairCross Cursor is working:

Insert

oMeta1:bMMoved:={|y,x,flags|hairCross(oMeta1,y,x) }

in FUNCTION RPreview( oDevice ) in rpreview.prg.

func hairCross(oMeta1,y,x)
nCount:=nCount+1
IF nCount > 5
nCount:=0
oMeta1:refresh()
sysrefresh()
oMeta1:line (0,x,1800,x)
oMeta1:line (y,0,y,1500)
ENDIF
return nil




But could someone please tell me how to save and restore a part of the canvas / screen.


oMeta1:bMMoved:={|y,x,flags| hairCross(y,x, oMeta1)}


Dim ScreenSave

func hairCross(x,y, oMeta1)

restore = ScreenSave

ScreenSave = save part of the screen where you draw the new line

oMeta1:line (y,0,y,500)

return nil

Otto

Re: Can I change the report viewer ?

Posted: Tue Mar 13, 2007 1:16 pm
by Maurilio Viana
Milan,

An interesting feature we found in Crystal Report were you can navigate in the report page like a browse.
Many months ago I tryed to adapt it to RPreview but without success :-(
If anybody know how...
But I think Otto's idea very good.

Regards
Maurilio