Author | Topic: presentation space & Form Designer ? | |
---|---|---|
JAYARAM MYSORE | presentation space & Form Designer ? on Mon, 24 Aug 2009 06:03:30 +0530 I am trying to print Invoice from my application. Can I use Xbase++ Form Designer to desing my Invoice in the presentation space ? How do I do this ? Sample of my code: here I am inserting the pre-printed Invoice into the printer and the code below wiill just fill in the blanks: I want to desing the entire Invoice. DO PRINTMENU DO CASE CASE CHOI = 1 *---------------PRINT INVOICE BEGIN CL = 6 ? SPACE(CL)+MAINACC->ACCT_NAME ? SPACE(CL)+MAINACC->ACCT_ADD1 ?? SPACE(18)+ TRANSFORM(BILNO,"9999") ? SPACE(CL)+MAINACC->ACCT_ADD2 ? SPACE(CL)+MAINACC->ACCT_ADD3 ?? SPACE(CL+13) + DTOC(BILDT) ? SPACE(CL)+ALLTRIM(MAINACC->ACCT_CITY)+" - "+MAINACC->ACCT_PIN ? SPACE(CL)+MAINACC->ACCT_STATE ? ? SPACE(CL)+"Buyer's TIN: "+ALLTRIM(MAINACC->KEYWORD1)+" CST: "+MAINACC->KEYWORD2 ? ? ? ? SELECT 21 GO TOP CP = 1 DO WHILE .NOT. EOF() IF DEAL_NO > 0 ? SPACE(1)+TRANSFORM(DEAL_NO,"9999")+" "+SUBSTR(COMMODITY,1,20)+TRANSFORM(V_A_T+C_S_T,"99.99")+" "+TRANSFORM(QUANTITY,"99,999")+" "+TRANSFORM(RATE,"999.99")+" "+TRANSFORM(SUB_TOTAL,"99,99,999.99") ELSE ? SPACE(6)+SUBSTR(COMMODITY,1,20)+TRANSFORM(V_A_T+C_S_T,"99.99")+" "+TRANSFORM(QUANTITY,"99,999")+" "+TRANSFORM(RATE,"999.99")+" "+TRANSFORM(SUB_TOTAL,"99,99,999.99") ENDIF SKIP CP = CP+1 ENDDO IF CP>2 ? SPACE(33)+"-------"+SPACE(12)+"--------------" ? SPACE(34)+TRANSFORM(TQUAN,"99,999")+SPACE(14)+TRANSFORM(TCOMV,"99,99,999.99") ELSE ? ? ENDIF FOR I = CP TO 5 ? NEXT DO CASE CASE VATCST = 1 ? SPACE(CL+5)+"V A T Rs." + SPACE(35)+ TRANSFORM(VATA,"9,99,999.99") ? IF PACK>0 ? SPACE(CL+5)+"Packing & Forwarding"+SPACE(26)+ TRANSFORM(PACK,"99,999.99") ELSE ? ENDIF CASE VATCST = 2 IF PACK>0 ? SPACE(CL+5)+"Packing & Forwarding"+SPACE(26)+ TRANSFORM(PACK,"99,999.99") ELSE ? ENDIF ? ? SPACE(CL+5)+"C S T @ 2%" + SPACE(34)+ TRANSFORM(CSTA,"9,99,999.99") CASE VATCST = 3 IF PACK>0 ? SPACE(CL+5)+"Packing & Forwarding"+SPACE(26)+ TRANSFORM(PACK,"99,999.99") ELSE ? ENDIF ? ? SPACE(CL+5)+ "C S T Rs." + SPACE(37)+ TRANSFORM(CSTA,"9,99,999.99") CASE VATCST = 4 .OR. VATCST = 5 CSTR = 0 IF PACK>0 ? SPACE(CL+5)+"Packing & Forwarding"+SPACE(26)+ TRANSFORM(PACK,"99,999.99") ELSE ? ENDIF ? ? ENDCASE ? SPACE(CL)+ VATIL IF .NOT. EMPTY(DELV1) ? SPACE(CL)+"Delivery at:" ELSE ? ENDIF ? ? SPACE(CL+2)+DELV1 ? SPACE(CL+2)+DELV2 ? SPACE(CL+2)+DELV3 ? IF .NOT. EMPTY(PONUM) ? SPACE(CL+2) + "Your Purchase Order No."+PONUM ?? +SPACE(3)+TRANSFORM(TOTV,"99,99,999.99") ELSE ? SPACE(CL+48)+TRANSFORM(TOTV,"99,99,999.99") ENDIF ? ? ? SPACE(CL)+INVOLIN1 ? SPACE(CL)+INVOLIN2 ? SPACE(CL)+INVOLIN3 IF VAT515#0 ? SPACE(CL)+"Form 515 No:"+TRANSFORM(VAT515,"99999") && +" Dt.:"+DTOC(S_DATE) ELSE ? ENDIF ? SPACE(CL)+INVOLIN4 ? ? *---------------PRINT INVOICE END | |
James Loughner | Re: presentation space & Form Designer ? on Sun, 23 Aug 2009 22:13:40 -0400 Basic answer is no the FD produces static code. You can use the code below as is just like in Clipper. If you want to move to Graphical printing use Graphic functions to paint the page. Here are some function that may help. The printform.prg is an example Jim JAYARAM MYSORE wrote: > I am trying to print Invoice from my application. Can I use Xbase++ Form > Designer to desing my Invoice in the presentation space ? How do I do this ? > > Sample of my code: > > here I am inserting the pre-printed Invoice into the printer and the code > below wiill just fill in the blanks: > > I want to desing the entire Invoice. > > DO PRINTMENU > DO CASE > CASE CHOI = 1 > *---------------PRINT INVOICE BEGIN > CL = 6 > ? SPACE(CL)+MAINACC->ACCT_NAME > ? SPACE(CL)+MAINACC->ACCT_ADD1 > ?? SPACE(18)+ TRANSFORM(BILNO,"9999") > ? SPACE(CL)+MAINACC->ACCT_ADD2 > ? SPACE(CL)+MAINACC->ACCT_ADD3 > ?? SPACE(CL+13) + DTOC(BILDT) > ? SPACE(CL)+ALLTRIM(MAINACC->ACCT_CITY)+" - > "+MAINACC->ACCT_PIN > ? SPACE(CL)+MAINACC->ACCT_STATE > ? > ? SPACE(CL)+"Buyer's TIN: "+ALLTRIM(MAINACC->KEYWORD1)+" > CST: "+MAINACC->KEYWORD2 > ? > ? > ? > ? > SELECT 21 > GO TOP > CP = 1 > DO WHILE .NOT. EOF() > IF DEAL_NO > 0 > ? SPACE(1)+TRANSFORM(DEAL_NO,"9999")+" > "+SUBSTR(COMMODITY,1,20)+TRANSFORM(V_A_T+C_S_T,"99.99")+" > "+TRANSFORM(QUANTITY,"99,999")+" "+TRANSFORM(RATE,"999.99")+" > "+TRANSFORM(SUB_TOTAL,"99,99,999.99") > ELSE > ? > SPACE(6)+SUBSTR(COMMODITY,1,20)+TRANSFORM(V_A_T+C_S_T,"99.99")+" > "+TRANSFORM(QUANTITY,"99,999")+" "+TRANSFORM(RATE,"999.99")+" > "+TRANSFORM(SUB_TOTAL,"99,99,999.99") > ENDIF > SKIP > CP = CP+1 > ENDDO > IF CP>2 > ? SPACE(33)+"-------"+SPACE(12)+"--------------" > ? > SPACE(34)+TRANSFORM(TQUAN,"99,999")+SPACE(14)+TRANSFORM(TCOMV,"99,99,999.99") > ELSE > ? > ? > ENDIF > FOR I = CP TO 5 > ? > NEXT > DO CASE > CASE VATCST = 1 > ? SPACE(CL+5)+"V A T Rs." + SPACE(35)+ > TRANSFORM(VATA,"9,99,999.99") > ? > IF PACK>0 > ? SPACE(CL+5)+"Packing & Forwarding"+SPACE(26)+ > TRANSFORM(PACK,"99,999.99") > ELSE > ? > ENDIF > CASE VATCST = 2 > IF PACK>0 > ? SPACE(CL+5)+"Packing & Forwarding"+SPACE(26)+ > TRANSFORM(PACK,"99,999.99") > ELSE > ? > ENDIF > ? > ? SPACE(CL+5)+"C S T @ 2%" + SPACE(34)+ > TRANSFORM(CSTA,"9,99,999.99") > CASE VATCST = 3 > IF PACK>0 > ? SPACE(CL+5)+"Packing & Forwarding"+SPACE(26)+ > TRANSFORM(PACK,"99,999.99") > ELSE > ? > ENDIF > ? > ? SPACE(CL+5)+ "C S T Rs." + SPACE(37)+ > TRANSFORM(CSTA,"9,99,999.99") > CASE VATCST = 4 .OR. VATCST = 5 > CSTR = 0 > IF PACK>0 > ? SPACE(CL+5)+"Packing & Forwarding"+SPACE(26)+ > TRANSFORM(PACK,"99,999.99") > ELSE > ? > ENDIF > ? > ? > ENDCASE > ? SPACE(CL)+ VATIL > IF .NOT. EMPTY(DELV1) > ? SPACE(CL)+"Delivery at:" > ELSE > ? > ENDIF > ? > ? SPACE(CL+2)+DELV1 > ? SPACE(CL+2)+DELV2 > ? SPACE(CL+2)+DELV3 > ? > IF .NOT. EMPTY(PONUM) > ? SPACE(CL+2) + "Your Purchase Order No."+PONUM > ?? +SPACE(3)+TRANSFORM(TOTV,"99,99,999.99") > ELSE > ? SPACE(CL+48)+TRANSFORM(TOTV,"99,99,999.99") > ENDIF > ? > ? > ? SPACE(CL)+INVOLIN1 > ? SPACE(CL)+INVOLIN2 > ? SPACE(CL)+INVOLIN3 > IF VAT515#0 > ? SPACE(CL)+"Form 515 No:"+TRANSFORM(VAT515,"99999") && > +" Dt.:"+DTOC(S_DATE) > ELSE > ? > ENDIF > ? SPACE(CL)+INVOLIN4 > ? > ? > *---------------PRINT INVOICE END > > > ExamplePrn.zip | |
Clayton Jones | Re: presentation space & Form Designer ? on Tue, 25 Aug 2009 18:23:17 -0400 Hello Jayaram, >I want to desing the entire Invoice. There is an example of how to do this in the Top-down demo app. Sample report #2 shows an invoice that was created in a separate function. In the report the function is called for each page to "paint" the invoice, followed by code to print on the page (look for rpt2() in demPrint.prg). The code that prints the invoice is in the template file tmpFmInv3.prg (if you ran the bat file to create the demo this will have been copied into the \demosrc folder; otherwise look for it in the \tmp folder). Regards, Clayton Clayton Jones www.cjcom.net Top-Down Library for Xbase++ X-DBU Database Utility X-MEMO Memo Field Replacement |