Report
Previous topic  First topic  Next topic












Define and Properties


Properties
Status
Default
Planned
Started
Ready
Comments
CREATE REPORT cName | (cVarName) | &(cExpression) 
      [ ; OF cWindow | (cVarName) | &(cExpression) ]
Parent.Name
  
A reference to the Parent Window
      [ FONTNAME "cFontName" ]
Parent.Fontname
  
Font family for control text
      [ FONTSIZE nPoints ]
Parent.FontSize
  
Font size for control text
      [ FONTBOLD .T. | .F. ]
.F.
  
Set Bold attribute to control text
      [ FONTITALIC .T. | .F. ]
.F.
  
Set Italic attribute to control text
      [ FONTUNDERLINE .T. | .F. ]
.F.
  
Set Underline attribute to control text
      [ FONTSTRIKEOUT .T. | .F. ]
.F.
  
Set Strikeout attribute to control text
      [ FONTCOLOR {aFontColor} | aVarFontColor ]
{0,0,0}
  
Set foreground color (text color)
      [ BACKCOLOR {aBackColor} | aVarBackColor ]
n/a
  Set background color
      [ PARENT cControlParent ]   
Get or Set the control name of parent widget
      [ PARENTTYPE n/a ]   
Only for mg_get() function, this property returns the PARENT control type or "" if the parent was not set.
      [ [ CREATE ] PRINT [ TEXT ] "Text" ]   
Print a text
      [ or ]   
 
      [ [ CREATE ] PRINT LINE ]   
Print a Line
      [ or ]   
 
      [ [ CREATE ] PRINT RECTANGLE ]   
Print a rectangle
      [ or ]   
 
      [ [ CREATE ] PRINT ELLIPSE ]   
Print an ellipse
      [ or ]   
 
      [ [ CREATE ] PRINT IMAGE "cImageName" ]   
Print an image
      [ or ]   
 
      [ [ CREATE ] PRINT BARCODE "cText" ]   
Print an barcode (similar to BARCODE control)
            [ ROW nTop ]
0
  
TOP position on container page in default units (see SET PRINTER UNITS command).
            [ COL nLeft ]
0
  
LEFT position on container page in default units (see SET PRINTER UNITS command).
            [ TOROW nBottom ]
n/a
  
BOTTOM position on container page in default units (see SET PRINTER UNITS command). Usually used with ROW, COL and TOCOL
            [ TOCOL nRight ]
n/a
  
RIGHT position on container page in default units (see SET PRINTER UNITS command). Usually used with ROW, COL and TOROW
            [ COORD { nLeft , nTop , nRight , nBottom } ]
n/a
  
Coordenates to print area
            [ FROMXY { nLeft , nTop } ]
n/a
  
Coordenates to print area (Usually used with TOXY property)
            [ TOXY { nRight , nBottom } ]
n/a
  
Coordenates to print area (Usually used with FROMXY property)
            [ WIDTH nWidth ]
?
  
The desired width size of the Control in default units (see SET PRINTER UNITS command)
            [ BARWIDTH nBarWidth ]
1
  
Only used in PRINT BARCODE. The desired bar width size of the BARCODE graph
            [ TYPE cType ]
"Code128"
  
Only used in PRINT BARCODE. The desired barcode type. (see the TYPE property of BARCODE control )
            [ HEIGHT nHeight ]
?
  
The desired height size of the Control in default units (see SET PRINTER UNITS command)
            [ ROWBOTTOM nRow ]
n/a
  
Bottom Row position on container window in pixels coordinates. This property adjust the HEIGHT property according the ROW property.
            [ COLRIGHT nCol ]
n/a
  
Right Col position on container window in pixels coordinates. This property adjust the WIDTH property according the COL property.
            [ FONTNAME "cFontName" ]
Parent.Fontname
  
Font family for control text
            [ FONTSIZE nPoints ]
Parent.FontSize
  
Font size for control text
            [ FONTBOLD .T. | .F. ]
.F.
  
Set Bold attribute to control text
            [ FONTITALIC .T. | .F. ]
.F.
  
Set Italic attribute to control text
            [ FONTUNDERLINE .T. | .F. ]
.F.
  
Set Underline attribute to control text
            [ FONTSTRIKEOUT .T. | .F. ]
.F.
  
Set Strikeout attribute to control text
            [ FONTCOLOR {aFontColor} | aVarFontColor ]
{0,0,0}
  
Set foreground color for PRINT TEXT
            [ BACKCOLOR {aBackColor} | aVarBackColor ]
n/a
  Set background color
            [ COLOR {aColor} | aVarColor ]
{0,0,0}
  
Set foreground color for PRINT RECTANGLE, ELLIPSE or LINE (for PRINT TEXT color use FONTCOLOR)
            [ ALIGN nAlign ]
Qt_AlignLeft
  
Align text, most common value are Qt_AlignLeft , Qt_AlignCenter and Qt_AlignRight
            [ STYLEFONT cStyleFont ]
n/a
  
Override properties from command with StyleFont properties. Go to
            [ STYLEPEN cStylePen ]
n/a
  
Override properties from command with StylePen properties. Go to
            [ STRETCH .T. | .F. ]
.F.
  
Used only in PRINT IMAGE. Sets a value that image to stretch to completely fill the destination rectangle.
            [ ASPECTRATIO nAspectRatio ]
n/a
  
Used only in PRINT IMAGE. This property is used in conjuction with STRETCH property. This enum type defines what happens to the aspect ratio when scaling an rectangle.
Values:
Qt_IgnoreAspectRatio: The size is scaled freely. The aspect ratio is not preserved.
Qt_KeepAspectRatio: The size is scaled to a rectangle as large as possible inside a given rectangle, preserving the aspect ratio.
Qt_KeepAspectRatioByExpanding: The size is scaled to a rectangle as small as possible outside a given rectangle, preserving the aspect ratio.
            [ FILLED .T. | .F. ]
.F.
  
Used only in PRINT RECTANGLE or PRINT ELLIPSE. Fill the given area.
            [ PENWIDTH nPenWidth ]
1
  
Width of Pen used to draw
            [ ROUNDED nRounded ]
0
  
Used only in PRINT RECTANGLE to make soft corners. Try with value of 30 in Millimeters
            [ ROTATE nAngle ]
0
  
Used only in PRINT TEXT, rotates the text the given nAngle clockwise.
      [ END PRINT ]   
End PRINT Control
END REPORT 



Methods


Methods
Status
Default
Planned
Started
Ready
Comments
    RELEASE
n/a
  
This method Destroy the report
    EXEC
n/a
  
This method Execute the report





STYLEFONT and STYLEPEN


StylePen and StyleFont controls are used to create models of fonts or pens intended for use in PRINT commands of control REPORT. However, these controls can be defined outside reports or inside them.
Los controles StyleFont y StylePen son usados para crear modelos de fonts o pens para ser usados en los comandos PRINT del control REPORT. Sin embargo, estos controles pueden ser definidos fuera de los reportes o dentro de ellos.

The place of definition will determine the persistence or not of the control during the execution of the program in wich you have defined it. That is, if we define the STYLE inside our main window, or outside of all windows, the STYLE will be available while the application is alive. However, if we define the STYLE in a sub-window or in a control REPORT, the STYLE will be available until RELEASE of the window is not executed or control REPORT is not destroyed.
El lugar de definición determinará la persistencia o no del control en lo que dure la ejecución del programa que lo haya definido.
Es decir, si definimos el STYLE dentro de la ventana main de nuestro programa, o fuera de todas las ventanas del programa, el STYLE estará disponible mientras este viva la aplicacion. En cambio, si lo definimos en una sub-ventana o dentro de un control REPORT, el STYLE estará disponible mientras no se haga RELEASE de la ventana o no se destruya el control REPORT



BARCODE


You can learn more about BARCODE at the Barcode topic (press
here to go)
Para saber más sobre el uso de Códigos de Barra vaya al tópico Barcode (presione aquí para ir)


Define and Properties


Properties
Status
Default
Planned
Started
Ready
Comments
CREATE STYLEFONT cName | (cVarName) | &(cExpression) 
      [ FONTNAME "cFontName" ]
Parent.Fontname
  
Font family for control text
      [ FONTSIZE nPoints ]
Parent.FontSize
  
Font size for control text
      [ FONTBOLD .T. | .F. ]
.F.
  
Set Bold attribute to control text
      [ FONTITALIC .T. | .F. ]
.F.
  
Set Italic attribute to control text
      [ FONTUNDERLINE .T. | .F. ]
.F.
  
Set Underline attribute to control text
      [ FONTSTRIKEOUT .T. | .F. ]
.F.
  
Set Strikeout attribute to control text
      [ FONTCOLOR {aFontColor} | aVarFontColor ]
OS.FontColor
  
Set foreground color (text color)
      [ BACKCOLOR {aBackColor} | aVarBackColor ]
OS.BackColor
  
Set background color
END STYLEFONT 



Methods


Methods
Status
Default
Planned
Started
Ready
Comments
    RELEASE
n/a
  
This method is used to destroy the control.





Define and Properties


Properties
Status
Default
Planned
Started
Ready
Comments
CREATE STYLEPEN cName | (cVarName) | &(cExpression) 
      [ COLOR {aColor} | aVarColor ]
{0,0,0}
  
Set foreground color for PRINT RECTANGLE, ELLIPSE or LINE (for PRINT TEXT color use FONTCOLOR)
      [ PENWIDTH nPenWidth ]
1
  
Width of Pen used to draw
END STYLEPEN 



Methods


Methods
Status
Default
Planned
Started
Ready
Comments
    RELEASE
n/a
  
This method is used to destroy the control.




Example:

File: d_report.prg


#include "marinas-gui.ch"

Function main()

   SET APPLSTYLE TO "MarinasLooks"

   CREATE WINDOW d_window
      ROW 0 ; COL 0
      WIDTH 820 ; HEIGHT 480
      CAPTION "Marinas-GUI Sample for Report Control"
      ICON "../resource/d_test.ico"
      BACKCOLOR {216,237,236}
      MAIN .T.

      d_report_def()

   END WINDOW

   mg_Do( "d_window" , "center" )

   mg_Do( "d_window" , "activate" )

Return .T.


File: d_report_def.prg

#include "marinas-gui.ch"

Function d_report_def()
   Local cAux

#define PREPORT_RG_DEFAULT   1
#define PREPORT_RG_DIALOG    2
#define PREPORT_RG_PRINTER   3
#define PREPORT_RG_PDF       4

   CREATE STYLEFONT Style_0
      FONTSIZE 70
      FONTCOLOR {0,255,0}
      FONTUNDERLINE .T.
      FONTNAME "mg_monospace"
   END STYLEFONT

   CREATE FRAMEBOX Report_Quality_FrameBox
          ROW    40
          COL    50
          WIDTH  236
          HEIGHT 104
          CAPTION "Quality"
   END FRAMEBOX

   CREATE RADIOGROUP Report_Quality_RadioGroup
          ROW    61
          COL    61
          WIDTH  222
          HEIGHT 70
          ITEMS {'Default (QPrinter_ScreenResolution)','QPrinter_ScreenResolution','QPrinter_HighResolution'}
          VALUE 1
   END RADIOGROUP

   CREATE FRAMEBOX Report_Orientation_FrameBox
          ROW    40
          COL    310
          WIDTH  194
          HEIGHT 103
          CAPTION "Orientation"
   END FRAMEBOX

   CREATE RADIOGROUP Report_Orientation_RadioGroup
          ROW    61
          COL    321
          WIDTH  171
          HEIGHT 70
          ITEMS {'Default (QPrinter_Portrait)','QPrinter_Portrait','QPrinter_Landscape'}
          VALUE 1
   END RADIOGROUP

   CREATE FRAMEBOX Report_Copies_FrameBox
          ROW    40
          COL    530
          WIDTH  82
          HEIGHT 67
          CAPTION "Copies"
   END FRAMEBOX

   CREATE SPINNER Report_Copies_Spinner
          ROW    70
          COL    540
          WIDTH  61
          HEIGHT 25
          RANGEMIN 1
          RANGEMAX 10
          VALUE 1
   END SPINNER

   CREATE FRAMEBOX Report_Duplex_FrameBox
          ROW    40
          COL    640
          WIDTH  133
          HEIGHT 68
          CAPTION "Duplex Mode"
   END FRAMEBOX

   CREATE COMBOBOX Report_Duplex_ComboBox
          ROW    70
          COL    655
          WIDTH  100
          HEIGHT 25
          ITEMS {'QPrinter_DuplexNone (Default)','QPrinter_DuplexAuto','QPrinter_DuplexLongSide','QPrinter_DuplexShortSide'}
          VALUE 1
   END COMBOBOX

   CREATE FRAMEBOX Report_Color_FrameBox
          ROW    150
          COL    50
          WIDTH  236
          HEIGHT 104
          CAPTION "Color Mode"
   END FRAMEBOX

   CREATE RADIOGROUP Report_Color_RadioGroup
          ROW    171
          COL    61
          WIDTH  211
          HEIGHT 70
          ITEMS {'Default (QPrinter_Color)','QPrinter_Color','QPrinter_GrayScale'}
          VALUE 1
   END RADIOGROUP

   CREATE FRAMEBOX Report_Collate_FrameBox
          ROW    150
          COL    310
          WIDTH  197
          HEIGHT 103
          CAPTION "Collate Copies"
   END FRAMEBOX

   CREATE RADIOGROUP Report_Collate_RadioGroup
          ROW    171
          COL    321
          WIDTH  179
          HEIGHT 70
          ITEMS {'Default (QPrinter_NoCollate)','QPrinter_NoCollate','QPrinter_Collate'}
          VALUE 1
   END RADIOGROUP

   CREATE FRAMEBOX Report_PaperSize_FrameBox
          ROW    120
          COL    530
          WIDTH  242
          HEIGHT 133
          CAPTION "Paper Size"
   END FRAMEBOX

   CREATE GRID Report_PaperSize_Grid
          ROW    140
          COL    540
          WIDTH  222
          HEIGHT 101
          COLUMNHEADERALL {'Paper','Code','Width MM','Height MM','Width Inch','Height Inch'}
          COLUMNWIDTHALL  {100,40,80,80,80,80}
          ITEMS  mg_GetPrinterPaperSizeList()
          VALUE  5
   END GRID

   CREATE FRAMEBOX Report_Frame_Graphic
            ROW    40 + 230
            COL    50
            WIDTH  728
            HEIGHT 82
        //  CAPTION "Graphic oriented report"
   END FRAMEBOX

   CREATE BUTTON Report_Button_gra_go
            ROW    55 + 230
            COL    90
            WIDTH  118
            HEIGHT 31
            CAPTION "GO!"
            FONTSIZE 18
            FONTCOLOR {0,0,255}
            FONTNAME "mg_monospace"
            ONCLICK myReport()
            TOOLTIP "Start report"
   END BUTTON

   CREATE CHECKBOX Report_Ch_rule
            ROW    90 + 230
            COL    110
            WIDTH  118
            HEIGHT 20
            VALUE .F.
            CAPTION "Add Rule"
            TOOLTIP "Add Rule to Report to see coordinates"
   END CHECKBOX

   CREATE IMAGE Report_Image_gra_arrow_1
            ROW    70 + 230
            COL    280
            WIDTH  32
            HEIGHT 32
            PICTURE "../resource/d_report_arrow.png"
   END IMAGE

   CREATE RADIOGROUP Report_RG_gra_printer
            ROW    55 + 230
            COL    360
            WIDTH  110
            HEIGHT 62
            ITEMS { "Default Printer" , "Printer Dialog" , "Printer Name" , "PDF file" }
            VALUE 1
            TOOLTIP "Select printer method"
            ONCHANGE Report_OnChange()
   END RADIOGROUP

   CREATE IMAGE Report_Image_gra_arrow_2
            ROW    70 + 230
            COL    520
            WIDTH  32
            HEIGHT 32
            PICTURE "../resource/d_report_arrow.png"
   END IMAGE

   CREATE CHECKBOX Report_Ch_gra_preview
            ROW    76 + 230
            COL    620
            WIDTH  20
            HEIGHT 20
            VALUE .T.
            TOOLTIP "Activate preview dialog previous print"
   END CHECKBOX

   CREATE IMAGE Report_Image_gra_preview
            ROW    70 + 230
            COL    640
            WIDTH  32
            HEIGHT 32
            PICTURE "../resource/d_report_preview.png"
            TOOLTIP mg_Get( "d_window" , "Report_Ch_gra_preview" , "tooltip" )
   END IMAGE

   CREATE BUTTON Report_Button_GetPrinters
      ROW 400
      WIDTH 170
      COL ( mg_Get( "d_window" , "width" ) / 2 ) - 13 - mg_Get( "d_window" , "Report_Button_GetPrinters" , "width" ) - 26 - mg_Get( "d_window" , "Report_Button_GetPrinters" , "width" )
      CAPTION "Get Printers"
      ONCLICK mg_msgInfo( mg_AllStr( my_GetPrinters() ) )
   END BUTTON

   CREATE BUTTON Report_Button_GetPrinterDefault
      ROW 400
      WIDTH 170
      COL ( mg_Get( "d_window" , "width" ) / 2 ) - 13 - mg_Get( "d_window" , "Report_Button_GetPrinterDefault" , "width" )
      CAPTION "Get Printer Default"
      ONCLICK mg_msgInfo( my_GetPrinterDefault() )
   END BUTTON

   CREATE BUTTON Report_Button_GetPrinter
      ROW 400
      WIDTH 170
      COL ( mg_Get( "d_window" , "width" ) / 2 ) + 13
      CAPTION "Select Printer from List"
      ONCLICK mg_msgInfo( if( !empty( cAux := my_GetPrinterList() ) , cAux , "Selection canceled" ) )
   END BUTTON

   CREATE BUTTON Report_Button_GetPrinterDialog
      ROW 400
      WIDTH 170
      COL mg_Get( "d_window" , "Report_Button_GetPrinter" , "col" ) + mg_Get( "d_window" , "Report_Button_GetPrinter" , "width" ) + 26
      CAPTION "Select Printer from Dialog"
      ONCLICK mg_msgInfo( if( my_GetPrinterDialog() , "Printer Object has set" , "Printer Object Set Canceled" ) )
   END BUTTON

Return .T.

Function Report_OnChange()
   if mg_Get( "d_window" , "Report_RG_gra_printer" , "value" ) == PREPORT_RG_PDF
      mg_Set( "d_window" , "Report_Ch_gra_preview" , "tooltip" , "Open pdf file with associated application (if it is posible on your Operative System)" )
      mg_Set( "d_window" , "Report_Image_gra_preview" , "picture" , "../resource/d_report_pdf.png" )
   else
      mg_Set( "d_window" , "Report_Ch_gra_preview" , "tooltip" , "Activate preview dialog previous print" )
      mg_Set( "d_window" , "Report_Image_gra_preview" , "picture" , "../resource/d_report_preview.png" )
   endif
   mg_Set( "d_window" , "Report_Image_gra_preview" , "tooltip" , mg_Get( "d_window" , "Report_Ch_gra_preview" , "tooltip" ) )
Return NIL

Function myReport()
   LOCAL cImage , lSuccess , cPrinterName
   LOCAL nInx
   LOCAL nWidthAux
   LOCAL nHeightAux
   lSuccess := .T.
   cImage := mg_GetTempFolder() + HB_OsPathSeparator() + "__mg_temp_for_report.png"

   SAVESCREEN "d_window" TO ( cImage )

   RESET PRINTER

   SET PRINTER RULE TO mg_Get( "d_window" , "Report_Ch_rule" , "value" )

   SET PRINTER UNITS TO QPrinter_Millimeter     // Default

   do case
      case mg_Get( "d_window" , "Report_Quality_RadioGroup" , "value" ) == 2
         SET PRINTER QUALITY TO QPrinter_ScreenResolution
      case mg_Get( "d_window" , "Report_Quality_RadioGroup" , "value" ) == 3
         SET PRINTER QUALITY TO QPrinter_HighResolution
   endcase

   do case
      case mg_Get( "d_window" , "Report_Orientation_RadioGroup" , "value" ) == 2
         SET PRINTER ORIENTATION TO QPrinter_Portrait
      case mg_Get( "d_window" , "Report_Orientation_RadioGroup" , "value" ) == 3
         SET PRINTER ORIENTATION TO QPrinter_Landscape
   endcase

   do case
      case mg_Get( "d_window" , "Report_Color_RadioGroup" , "value" ) == 2
         SET PRINTER COLORMODE TO QPrinter_Color
      case mg_Get( "d_window" , "Report_Color_RadioGroup" , "value" ) == 3
         SET PRINTER COLORMODE TO QPrinter_GrayScale
   endcase

   do case
      case mg_Get( "d_window" , "Report_Collate_RadioGroup" , "value" ) == 2
         SET PRINTER COLLATE TO QPrinter_NoCollate
      case mg_Get( "d_window" , "Report_Collate_RadioGroup" , "value" ) == 3
         SET PRINTER COLLATE TO QPrinter_Collate
   endcase

   if mg_Get( "d_window" , "Report_Copies_Spinner" , "value" ) > 1
      SET PRINTER COPIES TO mg_Get( "d_window" , "Report_Copies_Spinner" , "value" )
   endif

   do case
      case mg_Get( "d_window" , "Report_Duplex_ComboBox" , "value" ) == 2
         SET PRINTER DUPLEX TO QPrinter_DuplexAuto
      case mg_Get( "d_window" , "Report_Duplex_ComboBox" , "value" ) == 3
         SET PRINTER DUPLEX TO QPrinter_DuplexLongSide
      case mg_Get( "d_window" , "Report_Duplex_ComboBox" , "value" ) == 4
         SET PRINTER DUPLEX TO QPrinter_DuplexShortSide
   endcase

   IF val( mg_get( "d_window" , "Report_PaperSize_Grid" , "cell" , mg_Get( "d_window" , "Report_PaperSize_Grid" , "value" ) , 2 ) ) == QPrinter_Custom
      IF empty( nWidthAux := mg_inputDialog( "Custom Page Size" , "Enter Width:" , 600 ) )
         nWidthAux := 300
         nHeightAux := 500
      ELSE
         IF empty( nHeightAux := mg_inputDialog( "Custom Page Size" , "Enter Height:" , 800 ) )
            nWidthAux := 300
            nHeightAux := 500
         ENDIF
      ENDIF
      SET PRINTER CUSTOMPAPERSIZE TO nWidthAux , nHeightAux
   ENDIF

   SET PRINTER PAPERSIZE TO val( mg_Get( "d_window" , "Report_PaperSize_Grid" , "cell" , mg_Get( "d_window" , "Report_PaperSize_Grid" , "value" ) , 2 ) )

   do case
      case mg_Get( "d_window" , "Report_RG_gra_printer" , "value" ) == PREPORT_RG_DIALOG
         SELECT PRINTER TO DIALOG
      case mg_Get( "d_window" , "Report_RG_gra_printer" , "value" ) == PREPORT_RG_PRINTER
         cPrinterName := mg_GetPrinterList()
         if !empty( cPrinterName )
            SELECT PRINTER cPrinterName
         else
            lSuccess := .F.
         endif
      case mg_Get( "d_window" , "Report_RG_gra_printer" , "value" ) == PREPORT_RG_PDF
         SELECT PRINTER TO PDF
      otherwise
         SELECT PRINTER TO DEFAULT
   endcase

   if !lSuccess
      mg_msgStop( "Process canceled by user" )
      return .F.
   endif

   SET PRINTER PREVIEW TO mg_Get( "d_window" , "Report_Ch_gra_preview" , "value" )
/*
   SET PRINTER MARGIN TOP    TO 20
   SET PRINTER MARGIN LEFT   TO 20
   SET PRINTER MARGIN BOTTOM TO 20
   SET PRINTER MARGIN RIGHT  TO 20
*/
   CREATE REPORT myReport_1

      CREATE STYLEFONT Style_1
         FONTSIZE 48
         FONTCOLOR {0,255,0}
         FONTUNDERLINE .T.
         FONTNAME "mg_monospace"
      END STYLEFONT

      CREATE STYLEPEN pen_1
         PENWIDTH 3
         COLOR {0,0,255}
      END STYLEPEN

      SET STYLEFONT TO "Style_1"
      SET STYLEFONT TO

      CREATE PAGEREPORT "myPage_1"

         PRINT "Hello From Marinas-GUI!!!"
            ROW 20
            fontitalic .t.
            fontsize 40
            COL 20
         END PRINT

         CREATE PRINT TEXT "EAN13:"
            ROW 45
            COL 45
            STYLEFONT "Style_1"
         END PRINT

         CREATE PRINT BARCODE "123456789012"
            ROW 45
            COL 125
            TYPE "ean13"
            HEIGHT 15
            BARWIDTH 2.5
         END PRINT

         CREATE PRINT LINE
            ROW 80
            COL 20
            TOROW 80
            TOCOL 100
            STYLEPEN  "pen_1"
         END PRINT

         PRINT LINE
            FROMXY { 20 , 100 }
            TOXY { 100 , 100 }
         END PRINT

         SET STYLEPEN TO "PEN_1"

         PRINT LINE
            COORD { 20 , 120 , 100 , 120 }
            COLOR {0,255,0}
            penwidth 10
         END PRINT

         PRINT RECTANGLE
            COORD { 20 , 140 , 100 , 160 }
         END PRINT

         CREATE PRINT IMAGE "../resource/marinas-gui.png"
            row     85
            col     125
            torow   149
            tocol   189
         // width   32
         // height  32
            stretch .T.
         END PRINT

         PRINT RECTANGLE
            COORD { 120 , 80 , 200 , 160 }
            COLOR {255,0,0}
            ROUNDED 10
         END PRINT

         SET STYLEPEN TO

         PRINT ELLIPSE
            COORD { 20 , 180 , 100 , 200 }
         END PRINT

         PRINT ELLIPSE
            FILLED .T.
            COORD { 20 , 220 , 40 , 240 }
            COLOR { 255 , 128 , 64 }
         END PRINT

         PRINT ELLIPSE
            PENWIDTH 14
            COORD { 60 , 220 , 100 , 260 }
         END PRINT

         PRINT RECTANGLE
            COORD { 120 , 180 , 200 , 260 }
            COLOR {255,0,255}
            ROUNDED 30
         END PRINT

         CREATE PRINT BARCODE "www.marinas-gui.org"
            ROW 195
            COL 135
            BARWIDTH 8
            TYPE "QRCODE"
         END PRINT

      END PAGEREPORT

      CREATE PAGEREPORT "myPage_2"

         PRINT "Hello2 From Marinas-GUI!!!"
            ROW 5
            fontitalic .t.
            fontsize 40
            COL 20
         END PRINT

         For nInx := 1 to 13

            CREATE PRINT "line " + mg_AllStr( nInx + 1 )
               ROW 5 + ( nInx * 21 )
               COL 20
               fontsize 40
               fontcolor { nInx * 10 , 0 , 255 - ( nInx * 10 ) }
            END PRINT

          next

      END PAGEREPORT

      CREATE STYLEFONT Style_33
         FONTSIZE 40
         FONTCOLOR {0,255,0}
         FONTNAME "mg_monospace"
      END STYLEFONT

      SET STYLEFONT TO "Style_33"

      CREATE PAGEREPORT "myPage_3"

         PRINT "one"
            ROW 20
            COL 20
         end print

         print "two"
            ROW 40
            COL 20
         end print

         print "tree"
            ROW 60
            COL 20
         end print

         PRINT "four"
            ROW 80
            COL 100
            ROTATE 270
         END PRINT

         print "five"
            ROW 100
            COL 20
         end print

         print "six"
            ROW 120
            COL 20
         end print

         print "seven"
            ROW 140
            COL 20
         end print

         print rectangle
            ROW 170
            COL 20
            TOROW 230
            TOCOL 130
            FONTCOLOR {0,0,255}
         end print

         print "This line show the automatic WRAP mode, in addition," + HB_EOL() + "you can use the HB_EOL() function to force line break"
            ROW 170
            COL 20
            TOROW 230
            TOCOL 130
            FONTSIZE 20
            FONTCOLOR {0,0,255}
         // ALIGN Qt_AlignJustify
         end print

      END PAGEREPORT

      CREATE PAGEREPORT "myPage_4"

         CREATE PRINT IMAGE ( cImage )
            ROW 40
         END PRINT

         PRINT "Background image"
            fontitalic .F.
            fontBOLD   .T.
            fontsize 40
            FONTCOLOR {255,0,0}
            ROW 80
            COL 30
         END PRINT

      END PAGEREPORT

   END REPORT

   EXEC REPORT myReport_1 RETO lSuccess

   if lSuccess
      if mg_Get( "d_window" , "Report_RG_gra_printer" , "value" ) == PREPORT_RG_PDF
         if mg_Get( "d_window" , "Report_Ch_gra_preview" , "value" )
            OPEN FILE mg_GetPrinterName()
         else
            mg_msgInfo( "Print to PDF generated to file: " + mg_GetPrinterName() )
         endif
      endif
   else
      mg_msgStop( "Print canceled by user" )
   endif

   DESTROY REPORT myReport_1

   ferase( cImage )

Return NIL

STATIC Function my_GetPrinters()
   Local aReto
   GET PRINTERS TO aReto
Return aReto

STATIC Function my_GetPrinterDefault()
   Local cReto
   GET PRINTER DEFAULT TO cReto
Return cReto

STATIC Function my_GetPrinterList()
   Local cReto
   GET PRINTER LIST TO cReto
Return cReto

STATIC Function my_GetPrinterDialog()
   Local lReto
   GET PRINTER DIALOG RETO lReto
Return lReto



Marinas-GUI Version 03.06 and
Marinas-IDE Version 05.06 and
LEX Files Version 02.06


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
last update: April 27
2017
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------




A Harbour/QT framework to make multiplatform programs

(©) Copyright 2009-2017 by Fernando Santolin (aka CarozoDeQuilmes)
CarozoDeQuilmes@gmail.com

2009-2017 Beta tester and full English translator: Bruno Luciani
Bruno.Luciani@gmail.com

2014-2015 Final English corrector: David Worboys
DavidWorboys@hotmail.com

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

www.marinas-gui.org


www.marinas-gui.org  

Previous topic  First topic  Next topic