Looking for a PRINT-sample ( invoices )

Looking for a PRINT-sample ( invoices )

Postby ukoenig » Mon Sep 07, 2015 2:41 pm

Hello,

I want to change a report using PRINT.

Because I don't want to start from zero, I'm looking for a small sample

I've been looking inside the forum, but couldn't find something.
As well ( much better ) would be, using TREPORT
but all samples I found, are the same : only listings

using

TITLE
HEAD
DATA-area
FOOTER
some horizontal / vertical lines
a pagebreak on bill-number

the used REPORT ( from old CARET.exe )

Image

best regards
Uwe :?:
Last edited by ukoenig on Mon Sep 07, 2015 5:01 pm, edited 1 time in total.
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Looking for a PRINT-sample ( invoices )

Postby Rick Lipkin » Mon Sep 07, 2015 4:14 pm

Uwe

See your e-mail .. I sent you a working version of an invoice print routine that creates the output from code and does not use any form editors. The example takes advantage of the horizontal and vertical properties of the print driver to allow the output to resolve and look ( almost ) identical on any printer.

I would share the code here, but it is quite long due to the table logic. The example takes advantage of multiple fonts, lines and pens. The guts of the printing code uses this calculation :

Code: Select all  Expand view

oFont8b   := TFont():New( "Times New Roman", 0,-8, .F.,.T. , , , ,.F.,,,,,,, oPRINT, )
oFont10   := TFont():New( "Times New Roman", 0,-10,.F.,.F. , , , ,.F.,,,,,,, oPRINT, )
oFont10b  := TFont():New( "Times New Roman", 0,-10,.F.,.T. , , , ,.F.,,,,,,, oPRINT, )
oFont12ib := TFont():New( "Times New Roman", 0,-12,.F.,.T. , , , ,.T.,,,,,,, oPRINT, )
oFont12b  := TFont():New( "Times New Roman", 0,-12,.F.,.T. , , , ,.F.,,,,,,, oPRINT, )
oFont14b  := TFont():New( "Times New Roman", 0,-14,.F.,.T. , , , ,.F.,,,,,,, oPRINT, )
oFont24b  := TFont():New( "Times New Roman", 0,-24,.F.,.T. , , , ,.F.,,,,,,, oPRINT, )

DEFINE FONT oFont10d  NAME "Courier New" SIZE 0,-10 of oPRINT
DEFINE PEN oPen1 WIDTH 5 //10

nLines    := 0
nPages    := 1

nRowStep := oPrint:nVertRes() / 55      // pixel per line = 57.65 @ 55
nColStep := oPrint:nHorzRes() /130      // columns

oPRINT:StartPage()

nMargin := Int(oPrint:nLogPixelX()*0.5)      // *0.2
LINE    := nMargin
nPage   := 1


...
...

// company
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), cOwner, oFONT14b )
Line += oFont8b:nHeight
Line += oFont10b:nHeight

oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), cDivision , oFONT12b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.69),cInvoiceType, oFONT12b )
Line += oFont10b:nHeight

oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), cAdd1 , oFONT12b )

oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.69),"INVOICE", oFONT24b )
Line += oFont10b:nHeight

oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), cAdd2 , oFONT12b )
Line += oFont10b:nHeight

oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), alltrim(cCity)+", "+cState+" "+cZip, oFONT12b )
Line += oFont12b:nHeight
Line -= oFont8b:nHeight

oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.69),cRepairNumber, oFONT14b )

Line += oFont24b:nHeight
Line += oFont24b:nHeight
Line += oFont8b:nHeight

Line += oFont12b:nHeight
Line += oFont12b:nHeight

oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), cCustName, oFONT12b  )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.69),"Cust Id     :", oFONT10b )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.79),cCustomerId, oFONT10 )
Line += oFont12b:nHeight

oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.07), cCustAdd1, oFONT12b  )
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.69),"Bill Date   :", oFONT10b ) // 775
oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.79),dtoc( dInvDate ), oFONT10 )
Line += oFont12b:nHeight

...
...
 


Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2633
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Looking for a PRINT-sample ( invoices )

Postby TimStone » Mon Sep 07, 2015 4:23 pm

Uwe,

I do not use REPORT in any of my output. It is all hand coded with the print routine. Thus I can easily define boxes, shading, use graphics, etc. I also define and use multiple FONTs. I have a line counter that then ejects a page at the end and puts in a new header and continues. Some are reports, but when it comes to Invoices I have a multitude of data to be included: customer, service item, parts, labor, recommendations, signature lines, credit card receipt, disclaimers, advertising lines, and even post sale checklist.

My code would be far too long and complicated to post, but if I get a chance I'm happy to make a significantly cut down sample and would post that. Maybe I can do that sometime today.

There is a lot of power in the PRINT system within FWH.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2905
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Looking for a PRINT-sample ( invoices )

Postby ukoenig » Mon Sep 07, 2015 4:44 pm

Rick, Tim

thank You very much.

I'm just working on a program, it is one of the most complicated invoice -systems
we have in Germany. A extrem-situation must write up to 8 bills the same time for a customer, going to different places.

My screenshot shows this situation. Bills < 41 - 50 > must be written

home nursing

Image

The calculated results of the different bills, must be written for the defined customer.
altogether with the left situation, there are 13 possible bills to be calculated.

Image

best regards
Uwe :roll:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Looking for a PRINT-sample ( invoices )

Postby TimStone » Mon Sep 07, 2015 9:43 pm

I hope this gives you an idea:

Code: Select all  Expand view

/*
    This is a sample framework ... you will need to declare your variables, and otherwise access the data
*/


// Declare include files
#include "tdata.ch"
#include "fivewin.ch"



FUNCTION pro1110( oWrk, aConst )

    // Declare LOCAL variables
    LOCAL ...
   
  nPageCount := 1
  cPRNTYP := " "

    // Open databases here, and get basic configuration data from memory, such as
    // your printer settings, etc.  
   
    // Declare a header array and load the variables:  aHead[x]  

   // Present the print selection option window and find the type
   nPrnOpt := PRNSEL()
   IF nPrnOpt = 0                               // If Exit is specified, leave the print report function
      RETURN NIL
   ENDIF
 
   // Set the number of copies
   IF oDcf:InvPr4 = .T. .AND. cPRNTYP $ "EIC"
      nPrnCopies := 2
   ELSE
      nPrnCopies :=  1
   ENDIF
 
   // Now tell the print engine the type of format to use
   IF nPrnOpt = 1
      PRINT oPrn NAME "Invoice Printing" PREVIEW FROM USER MODAL // Preview with alternate printer selection
   ELSEIF nPrnOpt = 2
      PRINT oPrn NAME "Invoice Printing" PREVIEW MODAL // Preview with default printer
   ELSEIF nPrnOpt = 3
      PRINT oPrn NAME "Invoice Printing" FROM USER // Send to user selected printer
   ELSEIF nPrnOpt = 4
      PRINT oPrn NAME "Invoice Printing"      // Send to default printer
   ENDIF

   // Define the fonts to be used
   DEFINE FONT oFnorm NAME "Courier New" SIZE 0, - 12 OF oPrn
   DEFINE FONT oFbold NAME "Courier New" SIZE 0, - 12 BOLD OF oPrn
   DEFINE FONT oFundl NAME "Courier New" SIZE 0, - 12 UNDERLINE OF oPrn
   DEFINE FONT oFwide NAME "Courier New" SIZE 0, - 18 BOLD ITALIC OF oPrn
   DEFINE FONT oFboun NAME "Courier New" SIZE 0, - 12 BOLD UNDERLINE OF oPrn
   DEFINE FONT oFcond NAME "Courier New" SIZE 0, - 8 OF oPrn

   // Background brush
   DEFINE BRUSH oPrnBrush COLOR CLR_LIGHTGRAY
   // Define the pen
   DEFINE PEN oPen STYLE PS_SOLID WIDTH 5 OF oPrn
   DEFINE PEN oPben STYLE PS_SOLID WIDTH 10 OF oPrn

   // Set the resolution divided by the standard 8.5x11 inch paper rows/columns
   nRsp := oPrn:nVertRes() / 66                 // Number of rows
   nCsp := oPrn:nHorzRes() / 85                 // Number of columns
   // Now send the number of copies to the printer
   oPrn:SetCopies( nPrnCopies )

   // Turn on the first page - print the header data
   PAGE
   HEADINV( oPrn, aHead )

   // PRINT INVOICE HEADING
      // Lets create a watermark if the file exists in the main file directory
      IF lPrnWtrmrk
         oPrn:SayBitMap(21*nRsp,nCsp,cPath+"wtrmk.bmp", nCsp*84, 24*nRsp )
      ENDIF
      // Print the title for an Invoice
      oPrn:Say( nRow, 30 * nCsp, "INVOICE FOR SERVICES", oFboun )
      // After the title, we skip 2 lines
      nRow += 2 * nRsp

      // Greyscale the customer information if flagged
      IF oDcf:InvPr3 = .T.
         oPrn:FillRect( { nRow - ( 1 * nRsp ), 5, nRow + ( 8.0 * nRsp ), 84.8 * nCsp }, oPrnBrush )
      ENDIF
      // Box the customer information
      oPrn:Box( nRow, nCsp, nRow + ( 7 * nRsp ), 39 * nCsp, oPben )
      oPrn:Box( nRow, nCsp * 40, nRow + ( 7 * nRsp ), 83 * nCsp, oPben )
      nRow += .4 * nRsp

      // Now print the customer and service item information
      oPrn:Say( nRow, 2 * nCsp, "CUSTOMER:", oFbold )
      oPrn:Say( nRow, 13 * nCsp, m_cliwho, oFnorm )
      oPrn:Say( nRow, 41 * nCsp, UPPER( sLbl[4]), oFbold )
      oPrn:Say( nRow, 54 * nCsp, m_vehlif, oFnorm )
      nRow += nRsp
      oPrn:Say( nRow, 2 * nCsp, "ADDRESS:", oFbold )
      oPrn:Say( nRow, 13 * nCsp, m_cliadd, oFnorm )
      oPrn:Say( nRow, 41 * nCsp, UPPER( sLbl[1]), oFbold )
      oPrn:Say( nRow, 54 * nCsp, m_vehstr, oFnorm )
      nRow += nRsp
      oPrn:Say( nRow, 2 * nCsp, "CITY:", oFbold )
      oPrn:Say( nRow, 13 * nCsp, m_clicty, oFnorm )
      oPrn:Say( nRow, 41 * nCsp, UPPER(TRIM(sLbl[2])) + ":", oFbold )
      oPrn:Say( nRow, 54 * nCsp, m_vehidn, oFnorm )
      nRow += nRsp
      oPrn:Say( nRow, 2 * nCsp, "HOME:", oFbold )
      oPrn:Say( nRow, 13 * nCsp, m_clipho, oFnorm )
      oPrn:Say( nRow, 41 * nCsp, UPPER(TRIM(sLbl[3])) + ":", oFbold )
      oPrn:Say( nRow, 54 * nCsp, "In:" + TRIM(oWrk:SrvMil) + "  Out:" + TRIM(oWrk:SrvMio), oFnorm )
      nRow += nRsp
      oPrn:Say( nRow, 2 * nCsp, "BUSINESS:", oFbold )
      oPrn:Say( nRow, 13 * nCsp, m_clibus, oFnorm )
      oPrn:Say( nRow, 41 * nCsp, "TAG/COLOR", oFbold )
      oPrn:Say( nRow, 54 * nCsp, TRIM( oWrk:SrvHat ) + "  " + TRIM( m_vehcol ), oFnorm )
      nRow += nRsp
      oPrn:Say( nRow, 2 * nCsp, "CELL:", oFbold )
      oPrn:Say( nRow, 13 * nCsp, m_clicel, oFnorm )
      oPrn:Say( nRow, 41 * nCsp, "EMAIL:", oFbold )
      oPrn:Say( nRow, 54 * nCsp, m_clieml, oFnorm )
      nRow += nRsp * 3
      IF ! EMPTY( oWrk:AltBil )                 // Provide for alternate billing if appropriate
         oPrn:Say( nRow, 2 * nCsp, m_altcom, oFnorm )
         nRow += nRsp
         oPrn:Say( nRow, 2 * nCsp, m_altadd, oFnorm )
         nRow += nRsp * 2
      ENDIF
      IF ! EMPTY( oWrk:PurOrd )                 // Provide for purchase order if appropriate
         oPrn:Say( nRow, 2 * nCsp, "REFERENCE PURCHASE ORDER NO. " + oWrk:PurOrd, oFnorm )
         nRow += nRsp
      ENDIF





   // PRINT PARTS
   // Locate the first part for the workorder, and if found put a flag on retention
   oTdpa:seek( oWrk:wrkord )
   IF oTdpa:FOUND()                             // If parts are found
      // Print the retain option
         oPrn:Say( nRow, 2 * nCsp, "The following parts were used on this service:", sFont  )
         nRow += nRsp
         oPrn:Say( nRow, 2 * nCsp, "Quan.  Part #               Description                      Charge Extended", oFundl )
         nRow += 1.4 * nRsp
   ENDIF

   // Now print the actual parts
   DO WHILE oTdpa:wrkord = oWrk:wrkord .AND. !oTdpa:eof()
      // Check the page header first
      PAGEHEAD( oPrn, aHead )
      // If the quantity is not zero
      IF oTdpa:parqun <> 0.00
          oPrn:Say( nRow, 2 * nCsp, STR( oTdpa:parqun, 6, 2 ) + " " + oTdpa:parnum + " " + oTdpa:pardes + " " + STR( oTdpa:parchg, 8, 2 ) + " " + STR( oTdpa:partot, 8, 2 ), oFnorm )
          nRow += nRsp
      ENDIF
      // Nextg part
      oTdpa:skip()
   ENDDO


   // PRINT LABOR
   IF cPRNTYP $ 'EIWC'
      // Position the labor file to the first workorder entry
      oTdla:seek( oWrk:wrkord )
      IF oTdla:found()
         // Print labor heading
         nRow += nRsp
         oPrn:Say( nRow, 2 * nCsp, "The labor performed, and the charges, are:", sFont  )
         nRow += 2 * nRsp
      ENDIF
      // Now obtrain the information on the labor record
      DO WHILE oTdla:wrkord = oWrk:wrkord .AND. !oTdla:eof()
         oPrn:Say( nRow, 3 * nCsp, MEMOLINE( m_labtxt, 60, 1,, .t. ) + IIF( m_platot = 0, SPACE( 15 ), STR( m_platot, 15, 2 ) ), oFnorm )
         nRow += nRsp
         PAGEHEAD( oPrn, aHead )
         // Move to the next record
         oTdla:skip()
      ENDDO
   ENDIF

   // PRINT RECOMMENDATIONS
   // If there are recommendations
      oTrec:seek( oWrk:wrkord )
      IF oTrec:FOUND()                          // Print the header
         nRow += nRsp
         oPrn:Say( nRow, 2 * nCsp, "The following recommendations are offered based on work performed:", sFont  )
         nRow += 1.4 * nRsp
         lPrntRecs := .t.
      ENDIF
      // Now print the actual recommendations
      DO WHILE oTrec:wrkord = oWrk:wrkord .AND. !oTrec:eof()
         IF ! oTrec:deleted( )
            FOR lx := 1 TO MLCount( oTrec:rectxt, 60,, .t. )
               PAGEHEAD( oPrn, aHead )
               oPrn:Say( nRow, 2 * nCsp, MEMOLINE( oTrec:rectxt, 60, lx,, .t. ), oFnorm )
               nRow += nRsp
            NEXT
            IF oTrec:labtot <> 0.00
               oPrn:Say( nRow, 9 * nCsp, "The approximate cost will be $" + STR( oTrec:labtot, 10, 2 ) + ' plus taxes and supplies', oFnorm )
               nRow += nRsp
            ENDIF
         ENDIF
         oTrec:skip()
      ENDDO
     

   // PRINT TOTALS
            /*  Use the same principles to format and print totals.  Remember you can do running calculations
            in the steps above, and use those variables to hold the totals which depend on the info in the
            printout.  
           
            Also, you can do credit card transaction receipts in this area with signature lines ... all done
            with the same methods
            */



   // PRINT DISCLAIMERS - Use Memo text fields, then print them in condensed print


   // End of print
   ENDPAGE
   oPrn:SetCopies( 1 )
   ENDPRINT

   // Close databases
   // Close fonts
   oFnorm:end()
   oFbold:end()
   oFwide:end()
   oFcond:end()
   oFundl:end()

RETURN NIL

STATIC FUNCTION HEADINV( oPrn, aHead )

   // Starting Row
   nRow := 2 * nRsp

   // Outer frame box
   nRow += 2 * nRsp
   oPrn:Box( nRow, 0, nRow + ( 63 * nRsp ), 85 * nCsp, oPen )
   // Background for header
   oPrn:FillRect( { nRow + 5, 5, nRow + ( 9 * nRsp ), 84.8 * nCsp }, oPrnBrush )
   nRow += 2 * nRsp

   // Box Both Sides
   oPrn:Box( nRow, nCsp * 1, nRow + ( 6 * nRsp ), 38 * nCsp, oPben )
   oPrn:Box( nRow, nCsp * 40, nRow + ( 6 * nRsp ), 83 * nCsp, oPben )
   nRow += nRsp * .4

   // Now print  the invoice detail
   oPrn:Say( nRow, 0, aHead[ 1 ], oFbold )
   nRow += nRsp

   oPrn:Say( nRow, 41 * nCsp, "INVOICE:  ", oFbold )
   oPrn:Say( nRow, 54 * nCsp, aHead[ 8 ], oFbold )
   oPrn:Say( nRow, 62 * nCsp, "Page:", oFnorm )
   oPrn:Say( nRow, 68 * nCsp, STR( nPageCount, 3), oFnorm )
   nRow += nRsp

RETURN NIL


STATIC FUNCTION pagehead( oPrn, aHead )
   IF nRow >= 60 * nRsp
      ENDPAGE
      PAGE
      nPageCount ++
      HEADINV( oPrn, aHead )
   ENDIF
RETURN NIL

 
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2905
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Looking for a PRINT-sample ( invoices )

Postby ukoenig » Tue Sep 08, 2015 5:34 pm

Rick, Tim

thank You very much.
With the samples and informations I could create the form.
The job is nearly finished and it works like expected.

I noticed a small problem with the adjustment of numeric values.
I still have to calculate the different values used for the footer.

Image

best 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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Looking for a PRINT-sample ( invoices )

Postby cdmmaui » Wed Sep 09, 2015 5:16 am

Dear Uwe,

We actually create invoices in PDF format. The main reason is because we want to have the same print and e-mail version. We use a third party PDF creator. We have built a library of over 50 invoices related to international logistics industry which include various currencies and languages.

Please send me an e-mail (darrell DOT ortiz AT cdmsoft DOT com) and I would be happy to send you samples from our system.

Sincerely,
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Re: Looking for a PRINT-sample ( invoices )

Postby ukoenig » Wed Sep 09, 2015 7:01 am

Darell,

thank You very much.
It is a temporary solution for me for the moment.
Later on, maybe I will change to something different.

My mistake I made for numeric field-adjustments
I changed to :

oPRINT:cmSay( nLine1, 15.5, STR(("REDRUCK")->LSTG_PREIS), oFont1,,CLR_BLACK,, PAD_RIGHT )
oPRINT:cmSay( nLine1, 17.5, STR(("REDRUCK")->LSTG_SUMME), oFont1,,CLR_BLACK,, PAD_RIGHT )

best regards
Uwe :D
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Looking for a PRINT-sample ( invoices )

Postby Rick Lipkin » Wed Sep 09, 2015 12:19 pm

Uwe

Be careful using 'hard coded' cmSay co-ordinants
Code: Select all  Expand view

oPRINT:cmSay( nLine1, 15.5, STR(("REDRUCK")->LSTG_PREIS), oFont1,,CLR_BLACK,, PAD_RIGHT )
oPRINT:cmSay( nLine1, 17.5, STR(("REDRUCK")->LSTG_SUMME), oFont1,,CLR_BLACK,, PAD_RIGHT )
 

You will find if you change printers the output may be in a different location on the printed page due to each printers unique horizontal and vertical alignments .. best to use a calculated location on the page based on the actual printer horizontal and vertical specs .. see my example on the calculation.

Rick Lipkin

ps .. use Transform() to punctuate your numeric values .. and yes .. you will have to play with the alignment some based on the length of the values
Code: Select all  Expand view

Do Case
Case nTotal = 0
        oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.9105),Transform(nTtotal,"9,999,999.99"), oFONT10  )  // 4370
Case nTotal > 0 .and. nTotal < 10
        oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.9097),Transform(nTtotal,"9,999,999.99"), oFont10)
Case nTotal >= 10 .and. nTotal < 100
       oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.9063),Transform(nTtotal,"9,999,999.99"), oFont10)
Case nTotal >= 100 .and. nTotal < 1000
        oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.9015),Transform(nTtotal,"9,999,999.99"), oFont10) // 9015
Case nTotal >= 1000 .and. nTotal < 10000
       oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.8973),Transform(nTtotal,"9,999,999.99"), oFont10)
Case nTotal >= 10000 .and. nTotal < 100000
        oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.8900),Transform(nTtotal,"9,999,999.99"), oFont10)
Case nTotal >= 100000 .and. nTotal < 1000000
        oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.8875),Transform(nTtotal,"9,999,999.99"), oFont10)
Case nTotal >= 1000000 .and. nTotal < 10000000
        oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.8834),Transform(nTtotal,"9,999,999.99"), oFont10)
Case nTotal >= 10000000 .and. nTotal < 100000000 // max
        oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.875),  Transform(nTtotal,"99,999,999.99"), oFont10)

Case nTotal < 0 .and. nTotal > -100
       oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.8855), Transform(nTtotal,"@)"), oFont10)
Case nTotal <= -100 .and. nTotal > -1000
        oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.8855), Transform(nTtotal,"@)"), oFont10)
OtherWise
        oPRINT:SAY ( LINE, (oPrint:nHorzRes()*.8973), Transform(nTtotal,"9,999,999.99"), oFont10)
End Case
 
User avatar
Rick Lipkin
 
Posts: 2633
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Looking for a PRINT-sample ( invoices )

Postby ukoenig » Thu Sep 10, 2015 2:58 pm

Rick,

thank You very much. It is nearly finished.

I noticed a problem.
Calling the PRINT-preview, the windows printer-config opens.
It is not needed, because it can be selected from inside the preview.
Choosing print, the dialog closes and the print-preview opens. Nothing happens.
Selecting exit, the program crashes.

Image

Image

Is it possible, to disable the shown system printer-dialog ?

best regards
Uwe :?:
Last edited by ukoenig on Thu Sep 10, 2015 3:28 pm, edited 2 times in total.
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Looking for a PRINT-sample ( invoices )

Postby Rick Lipkin » Thu Sep 10, 2015 3:07 pm

Uwe

Initialize oPrint like this and remove the 'from USER' .. that will not bring up the Printer properties screen.

Rick Lipkin

Code: Select all  Expand view

PRINTER oPRINT ; //from USER                ;
   NAME "Print Routine for INVOICE "+cRepairNumber

   IF EMPTY( oPRINT:hDC )
      MsgStop ( "Printer not Ready !" )
      RETURN(.f.)
   ENDIF
 
User avatar
Rick Lipkin
 
Posts: 2633
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Looking for a PRINT-sample ( invoices )

Postby ukoenig » Thu Sep 10, 2015 3:21 pm

Rick,

thank You very much,
it works fine, but funny that closing the window-dialog, a crash happens.

My first result
the footer includes many calculations up to 4 lines with different informations
and belongs to the receptor : private, health insurance fund, nursing care insurance .....

the letter head changes related to a private or insurance bill.
It is very complicated.
I think creating a report using a reportgenerator, would be a hard job.
Each bill looks different but only ONE form is used with the same data-area
but different head and footer like You can see on the page-selector.

Just one question
will there be a memory-problem with many pages ?

Image

best regards
Uwe :D
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Looking for a PRINT-sample ( invoices )

Postby Otto » Thu Sep 10, 2015 4:01 pm

Hallo Uwe,

warum hast du für den Rechnungsdruck nicht EASYREPORT verwendet?
Gibt es einen Grund?

Lg
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6044
Joined: Fri Oct 07, 2005 7:07 pm

Re: Looking for a PRINT-sample ( invoices )

Postby ukoenig » Thu Sep 10, 2015 4:17 pm

Otto,

I started with EASYREPORT,
but creating this kind of report with just a single report,
was a bit to complicated for me for the moment.
As well I got same crashes testing it.
It was the reason to change to the PRINT-class for a quick result.

With more time, I will try to use the logic using EASYREPORT.

best 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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Looking for a PRINT-sample ( invoices )

Postby TimStone » Thu Sep 10, 2015 4:29 pm

Uwe,

I've never had a problem with memory, and I've had some reports generate 100's of pages.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2905
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 51 guests