Page 1 of 2

Report Margins

PostPosted: Sun Dec 24, 2017 8:08 pm
by Silvio.Falconi
How set and draw margins into Rpreview ?
I wish have the vertical and Hozintal lines into rpreview
How we can draw it ?

Re: Report Margins

PostPosted: Sat Dec 30, 2017 10:17 pm
by ukoenig

Re: Report Margins

PostPosted: Sun Dec 31, 2017 5:40 pm
by Silvio.Falconi
Uwe,
I not seen margins lines on Report preview

Re: Report Margins

PostPosted: Sun Dec 31, 2017 6:01 pm
by Otto
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

Re: Report Margins

PostPosted: Sun Dec 31, 2017 6:04 pm
by Silvio.Falconi
I Mean to draw dotted lines as this test

Code: Select all  Expand view
#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 ?

Re: Report Margins

PostPosted: Sun Dec 31, 2017 7:04 pm
by Otto
Silvio,
this is the Report of your program. Where do you need the margines?
Best regards,
Otto

Image

Re: Report Margins

PostPosted: Sun Dec 31, 2017 10:19 pm
by Silvio.Falconi
sorry but you d see a box arround of apage

Image

Re: Report Margins

PostPosted: Sun Dec 31, 2017 11:53 pm
by ukoenig
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.

Image

Code: Select all  Expand view

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 :D

Re: Report Margins

PostPosted: Mon Jan 01, 2018 8:12 am
by Enrico Maria Giordano
ukoenig wrote:Using pen 2 for lines I got a error, using pen 1 works.


Code: Select all  Expand view
REPORT oReport TITLE  "*** My First Report ***" PREVIEW PEN oPen[1], oPen[2]


EMG

Re: Report Margins

PostPosted: Mon Jan 01, 2018 9:38 am
by ukoenig
Enrico,

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

Image

happy new year :D

regards
Uwe :D

Re: Report Margins

PostPosted: Mon Jan 01, 2018 10:51 am
by Silvio.Falconi
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 ?)

Re: Report Margins

PostPosted: Mon Jan 01, 2018 11:11 am
by Enrico Maria Giordano
If you want to change the report left margin then try this:

Code: Select all  Expand view
oReport:Margin( nNewValue, RPT_LEFT, RPT_CMETERS )


EMG

Re: Report Margins

PostPosted: Mon Jan 01, 2018 11:17 am
by Silvio.Falconi
and on printer class ?

Re: Report Margins

PostPosted: Mon Jan 01, 2018 11:19 am
by ukoenig
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 :?:

Re: Report Margins

PostPosted: Mon Jan 01, 2018 11:24 am
by Enrico Maria Giordano
Silvio.Falconi wrote:and on printer class ?


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

EMG