problem with report

Post Reply
davor0501
Posts: 23
Joined: Thu Apr 21, 2011 6:02 pm

problem with report

Post by davor0501 »

The problem with reports for. When printing multiple pages every second, third page is blank. Does anyone encountered a similar problem.
Thank you.
User avatar
Antonio Linares
Site Admin
Posts: 42597
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 40 times
Been thanked: 86 times
Contact:

Re: problem with report

Post by Antonio Linares »

Davor,

Could you please provide an example to reproduce it here ?

many thanks,
regards, saludos

Antonio Linares
www.fivetechsoft.com
davor0501
Posts: 23
Joined: Thu Apr 21, 2011 6:02 pm

Re: problem with report

Post by davor0501 »

Antonio,
this is a small example.
I noticed that the problem occurs when I turn in report function cellView ().
Thank you for your help.


// Testing FiveWin built-in report engine and print preview

#include "FiveWin.ch"
#include "Report.ch"

static oWnd, lPreview := .F.

Image

function Main()

local oBar, oCursorHand

DEFINE WINDOW oWnd ;
TITLE "Testing FiveWin Report-Engine and Print-Preview" ;
MENU BuildMenu()

DEFINE BUTTONBAR oBar _3D SIZE 26, 27 OF oWnd

DEFINE BUTTON OF oBar FLAT TOOLTIP "Generate report" ;
ACTION DoReport() RESOURCE "Report"

DEFINE BUTTON OF oBar FLAT GROUP TOOLTIP "Exit" ;
ACTION oWnd:End() RESOURCE "Exit"

DEFINE CURSOR oCursorHand HAND

AEval( oBar:aControls, { | o | o:oCursor := oCursorHand } )

DEFINE MESSAGE BAR OF oWnd TITLE FWCOPYRIGHT ;
NOINSET DATE CLOCK KEYBOARD

ACTIVATE WINDOW oWnd ;
VALID ! lPreview .and. MsgYesNo( "Want to exit ?" )

return nil

function BuildMenu()

local oMenu

MENU oMenu
MENUITEM "&Generate Report" ACTION DoReport() ;
MESSAGE "Open customers database and generate a report"

MENUITEM "&Exit" ACTION oWnd:End() ;
MESSAGE "Terminate the application and exit"
ENDMENU

return oMenu

function DoReport()

local oRpt

lPreview = .T.

USE Customer

REPORT oRpt;
TITLE "Print" ;
HEADER "Report" ;
FOOTER "Page: "+str(oRpt:nPage,3) RIGHT;
PREVIEW
COLUMN TITLE "First" DATA Customer->First
COLUMN TITLE "Last" DATA Customer->Last
COLUMN TITLE "State" DATA Customer->State
END REPORT
oRpt:CellView()
ACTIVATE REPORT oRpt

USE

lPreview = .F.

return nil
User avatar
karinha
Posts: 7948
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: problem with report

Post by karinha »

Code: Select all | Expand

#include "FiveWin.ch"#Include "Report.Ch"STATIC oWnd, lPreview := .F.function Main()   local oBar, oCursorHand   DEFINE CURSOR oCursorHand HAND   DEFINE WINDOW oWnd ;          TITLE "Testing FiveWin Report-Engine and Print-Preview" ;          MENU BuildMenu()   DEFINE BUTTONBAR oBar _3D SIZE 26, 27 OF oWnd   AEval( oBar:aControls, { | o | o:oCursor := oCursorHand } )   DEFINE BUTTON OF oBar FLAT TOOLTIP "Generate report" ;          ACTION DoReport() RESOURCE "Report"   DEFINE BUTTON OF oBar FLAT GROUP TOOLTIP "Exit" ;          ACTION oWnd:End() RESOURCE "Exit"   DEFINE MESSAGE BAR OF oWnd TITLE FWCOPYRIGHT ;          NOINSET DATE CLOCK KEYBOARD   WndCenter( oWnd:hWnd )   ACTIVATE WINDOW oWnd ;            VALID ! lPreview .and. MsgYesNo( "Want to exit ?" )return nilfunction BuildMenu()   local oMenu   MENU oMenu      MENUITEM "&Generate Report" ACTION DoReport() ;      MESSAGE "Open customers database and generate a report"   MENUITEM "&Exit" ACTION oWnd:End() ;      MESSAGE "Terminate the application and exit"   ENDMENUreturn oMenufunction DoReport()   LOCAL oPen1, oPen2, oFont1, oFont2, oFont3, oRpt   lPreview = .T.  //??   USE Customer   GO TOP   DEFINE PEN oPen1 WIDTH 2   DEFINE PEN oPen2 WIDTH 1        DEFINE FONT oFont1 NAME "Arial"       SIZE 0, -11   DEFINE FONT oFont2 NAME "Arial"       SIZE 0, -11   DEFINE FONT oFont3 NAME "Courier New" SIZE 0,  09 BOLD   REPORT oRpt TITLE "Print - Report Name"                                   ;      CAPTION "Report Text Caption"                                          ;      HEADER "Preview Header - Name Company"                               , ;      "Date: "   + DTOC( DATE() )                                          , ;      "Page: "   + STR( oRpt:nPage, 3 )                                      ;      FOOTER "- Report Text Footer - " CENTER                                ;      FONT oFont1, oFont2, oFont3                                            ;      PEN oPen1, oPen2                                                       ;      PREVIEW      oRpt:oDevice:lPrvModal := .T.      oRpt:oDevice:SetPage(9)      COLUMN TITLE "First" DATA Customer->First      COLUMN TITLE "Last"  DATA Customer->Last      COLUMN TITLE "State" DATA Customer->State   END REPORT   IF !oRpt:lCreated      RETURN NIL    ENDIF   oRpt:CellView()   ACTIVATE REPORT oRpt ON INIT oRpt:oTitle:aFont[1] := { || 3 }   oPen1:End()     oPen2:End()     oFont1:End()    oFont2:End()    oFont3:End()   USE   lPreview = .F.return nil// END 


Regards,

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
davor0501
Posts: 23
Joined: Thu Apr 21, 2011 6:02 pm

Re: problem with report

Post by davor0501 »

Mr. Karinha thanks for your help, now everything works ok.
Regards Davor.
User avatar
karinha
Posts: 7948
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: problem with report

Post by karinha »

Congratulations.

I was happy now.

Regards,
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Post Reply