FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Report Margins
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Report Margins
Posted: Sun Dec 24, 2017 08:08 PM

How set and draw margins into Rpreview ?
I wish have the vertical and Hozintal lines into rpreview
How we can draw it ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Report Margins
Posted: Sat Dec 30, 2017 10:17 PM
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Report Margins
Posted: Sun Dec 31, 2017 05:40 PM

Uwe,
I not seen margins lines on Report preview

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Report Margins
Posted: Sun Dec 31, 2017 06:01 PM

Hello Silvio,
please can you post a screenshot of what you want.
Preview is an object. You can paint lines on it.
But I am not sure what you exactly need.
Best regards,
Otto

Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Report Margins
Posted: Sun Dec 31, 2017 06:04 PM
I Mean to draw dotted lines as this test

Code (fw): Select all Collapse
#include <FiveWin.ch>
#include <Report.ch>
//test to draw lines margins

request DBFCDX

Function Test()
Local oReport
  LOCAL oPen1, oPen2

     DEFINE PEN oPen1 WIDTH 1
     DEFINE PEN oPen2 WIDTH 2

USE TEST NEW VIA "DBFCDX"

     REPORT oReport TITLE  "*** My First Report ***" PREVIEW ;
      PEN oPen1, oPen2

     COLUMN TITLE "St"         DATA Test->State
     COLUMN TITLE "First Name" DATA Test->First
     COLUMN TITLE "   Salary"  DATA Test->Salary

     END REPORT

      oReport:CellView()



    ACTIVATE REPORT oReport ;
    ON STARTPAGE  LinBox(oReport)


      CLOSE TEST
return nil
//------------------------------------------------------//



STATIC Function LinBox(oReport)

     LOCAL nInchWidth, nInchHeight


     nInchWidth  := oReport:PhyWidth(RPT_INCHES)
     nInchHeight := oReport:PhyHeight(RPT_INCHES)

     oReport:Box(.1                ,;            // nRow
                 .1                ,;            // nCol
                 nInchHeight-.1    ,;            // nBottom
                 nInchWidth-.1     ,;            // nRight
                 1       ,;                      // first pen created
                 RPT_INCHES)




RETURN NIL

this test use report class and draw line taking pen definitions from report class
but I need draw 4 lines ( 2 vertical and 2 Horizontal) dotted and it must be set from a menu fron RPreview for all print class ( report and print)
Any solution ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Report Margins
Posted: Sun Dec 31, 2017 07:04 PM
Silvio,
this is the Report of your program. Where do you need the margines?
Best regards,
Otto

Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Report Margins
Posted: Sun Dec 31, 2017 10:19 PM
sorry but you d see a box arround of apage

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Report Margins
Posted: Sun Dec 31, 2017 11:53 PM
Now I understand what You mean
a painted box as a border

Using pen 2 for lines I got a error, using pen 1 works.
I added 2 lines to the box as a test. One at left and one at bottom.



Code (fw): Select all Collapse
FUNCTION MAIN()
LOCAL oReport, oPen[2]

DEFINE PEN oPen[1] WIDTH 3
DEFINE PEN oPen[2] WIDTH 2

USE TEST NEW VIA "DBFCDX"

REPORT oReport TITLE  "*** My First Report ***" PREVIEW PEN oPen[1], oPen[2]

    COLUMN TITLE "St"           DATA Test->State
    COLUMN TITLE "First Name"   DATA Test->First
    COLUMN TITLE "   Salary"        DATA Test->Salary

    END REPORT

    oReport:CellView()

ACTIVATE REPORT oReport ;
ON STARTPAGE LINBOX(oReport)

CLOSE TEST

RETURN NIL

// -------------

STATIC FUNCTION LINBOX(oReport)
LOCAL nInchWidth, nInchHeight

nInchWidth  := oReport:PhyWidth(RPT_INCHES)
nInchHeight := oReport:PhyHeight(RPT_INCHES)

oReport:Box( 0.3 ,;         // top
                    1.0  ,;         // left
                    nInchHeight -.3 ,;   // Bottom
                    nInchWidth  -.3 ,;   // Right
                    1       ,;          // first pen created
                    RPT_INCHES )

// vertical line
oReport:Line( 0.3    ,;                  // nTop
                     0.9   ,;                   // nLeft
                     nInchHeight -.2 ,;    // nBottom
                     0.9   ,;                   // nRight
                     2      ,;                   // second pen created
                     RPT_INCHES )

// horizontal line
// horizontal line
oReport:Line( nInchHeight -.2 ,;    // nTop
                     0.9   ,;                   // nLeft
                     nInchHeight -.2 ,;  // nBottom
                     nInchWidth  -.3 ,;    // nRight
                     2      ,;                   // second pen created
                     RPT_INCHES )

RETURN NIL


regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Report Margins
Posted: Mon Jan 01, 2018 08:12 AM
ukoenig wrote:Using pen 2 for lines I got a error, using pen 1 works.


Code (fw): Select all Collapse
REPORT oReport TITLE  "*** My First Report ***" PREVIEW PEN oPen[1], oPen[2]


EMG
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Report Margins
Posted: Mon Jan 01, 2018 09:38 AM
Enrico,

thank You it is working now ( using 2 pensizes ).
I updated the example shown above.



happy new year :-)

regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Report Margins
Posted: Mon Jan 01, 2018 10:51 AM

but it is not that I searching
the lines must be dotted and it must run on Report class and printer class only on Rpreview . the user can show it from rpreview menu or not
I hope someone understand the problem ( do you use winword ?)

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Report Margins
Posted: Mon Jan 01, 2018 11:11 AM
If you want to change the report left margin then try this:

Code (fw): Select all Collapse
oReport:Margin( nNewValue, RPT_LEFT, RPT_CMETERS )


EMG
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Report Margins
Posted: Mon Jan 01, 2018 11:17 AM

and on printer class ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Report Margins
Posted: Mon Jan 01, 2018 11:19 AM
I tested changing the STYLE expecting maybe to show lines dotted
but there are only solid lines, COLOR works

DEFINE PEN oPen[1] STYLE 0 WIDTH 3 COLOR CLR_RED
DEFINE PEN oPen[2] STYLE 1 WIDTH 2 COLOR CLR_BLUE

regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Report Margins
Posted: Mon Jan 01, 2018 11:24 AM
Silvio.Falconi wrote:and on printer class ?


TPrinter has no margins. You have to change the print column.

EMG