FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Can I change the report viewer ?
Posts: 115
Joined: Mon Oct 17, 2005 04:42 AM
Can I change the report viewer ?
Posted: Mon Mar 12, 2007 03:39 PM

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

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Can I change the report viewer ?
Posted: Mon Mar 12, 2007 03:56 PM

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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Can I change the report viewer ?
Posted: Mon Mar 12, 2007 04:19 PM
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
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Can I change the report viewer ?
Posted: Mon Mar 12, 2007 06:18 PM

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
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Can I change the report viewer ?
Posted: Tue Mar 13, 2007 09:53 AM

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

Posts: 252
Joined: Tue Oct 25, 2005 02:48 PM
Re: Can I change the report viewer ?
Posted: Tue Mar 13, 2007 01:16 PM

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

Continue the discussion