HMG Print Samples

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

ROBROS
Posts: 256
Joined: Thu May 25, 2017 6:30 pm
DBs Used: DBF
Location: D 83071 Stephanskirchen

Re: HMG Print Samples

Post by ROBROS »

Hi esgici,
so far I never felt in need to print data via dbase, clipper etc. I always opened data with excel and made them fit for printing. Or I transferred data to other people who were able to output them fitting their needs. Now I am helping a 2 people company to make their day a bit easier. They can use programs (excel is used to create forms, but not with filling these forms with data), so I decided to try it with hmg. The job is to fill forms with data. Thank you so much for your print samples, it brought me confidence, I can do that with hmg.
Your samples are very useful for me.

Thank you

Robert
ROBROS
Posts: 256
Joined: Thu May 25, 2017 6:30 pm
DBs Used: DBF
Location: D 83071 Stephanskirchen

Re: HMG Print Samples

Post by ROBROS »

Hi, Ihave a question:
Does printsystem work with windows 10? I mean is the default printer recognized? I can't try, because I use win 7 in VirtualBox.

Thx
Robert
User avatar
dragancesu
Posts: 929
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: HMG Print Samples

Post by dragancesu »

No worries, recognizes all printers as well as pdf printers (print to pdf)
ROBROS
Posts: 256
Joined: Thu May 25, 2017 6:30 pm
DBs Used: DBF
Location: D 83071 Stephanskirchen

Re: HMG Print Samples

Post by ROBROS »

Thx, Dragan, I was hoping this.

Robert
Templar
Posts: 51
Joined: Sun Apr 01, 2018 5:37 pm
DBs Used: DBF

Re: HMG Print Samples

Post by Templar »

Printing certainly is one of the hardest things, and can i ask for some help, please?

The samples are very useful, but I am struggling with trying to right-justify text. Any tips on this?

I've used <RightMargin> - LEN( TextString ) + nCharWidth
but it still isn't quite right.
Yemplar
User avatar
dragancesu
Posts: 929
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: HMG Print Samples

Post by dragancesu »

Try demo, prtest01.prg

Code: Select all

#include <hmg.ch>

*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.

/*

   HMG Print ( Mini Print ) for beginners in 10 easy steps
   
   Step #1  :
   
   Use everything with default values,
   
   write only "This is a test"  
   
   to four corners and center of paper.
   
*/

PROCEDURE  PrintTest()

   /*
      Default paper size is A4 Sheet; 210- by 297-millimeters
   */
   
   LOCAL lSuccess := .F.,;
         cTestString   := "This is a test",;
         nMostRightCol := 210,;  // Default page size is A4 : 210 x 297 mm
         nMostBottmRow := 297
   
   SELECT PRINTER DEFAULT TO lSuccess PREVIEW 
   
   IF lSuccess
      START PRINTDOC 
         START PRINTPAGE
             @ 0, 0 PRINT cTestString                                    // Top Left   
             @ 0, nMostRightCol PRINT cTestString  RIGHT                    // Top Right
             @ nMostBottmRow / 2, nMostRightCol / 2  PRINT cTestString CENTER  // Center of paper
             @ nMostBottmRow - 4, 0 PRINT cTestString                       // Bottom Left   
             @ nMostBottmRow - 4, nMostRightCol PRINT cTestString RIGHT       // Bottom Right
         END PRINTPAGE             
      END PRINTDOC
   ELSE
      MsgStop( "Couldn't select default printer !", "ERROR !" )
   ENDIF   
   
RETURN  // PrintTest()

*-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.
dimensions are in mm, just adjust where to print and add RIGHT or CENTER, LEFT is defaults
FONT and SIZE are some of the windows fonts
Post Reply