Page 1 of 1

POS Reporting

Posted: Mon May 22, 2017 1:53 am
by ampandya
Hi
I have a question about the POS reporting screen.

has any one used the crystal report within xbase application? could i see some sample code?
i have attached a screen of the other program we use and i want to make similar screen to that for report showing on the screen and then Print!

Many Thanks

Re: POS Reporting

Posted: Mon May 22, 2017 6:16 am
by rdonnay
Give this a try:

Code: Select all

#INCLUDE "dcprint.CH"

FUNCTION Main()

LOCAL cLargeFont := '24.Courier New Bold', ;
      cSmallFont := '12.Courier New', nRow, aOptions

aOptions := { 0, nil, '5', nil, nil, .f., 'Microsoft Print to PDF', 3, nil, .F., .F. }

DC_PrintPreviewAcrobatOpt( aOptions )

DCPRINT ON ACROBAT SIZE 50,50

DCPRINT FONT cLargeFont

nRow := 1
@ nRow,15 DCPRINT SAY 'GROUP / DEPARTMENT' ALIGN DCPRINT_ALIGN_HCENTER

@ nRow+2,0 DCPRINT SAY 'From:   04/04/2017'
@ nRow+4,0 DCPRINT SAY '  To:   22/05/2017'

@ nRow+6,0 DCPRINT SAY '  Branch: 001' FONT cSmallFont
@ nRow+7,0 DCPRINT SAY 'Terminal: 1' FONT cSmallFont

@ nRow+8,0 DCPRINT SAY Repl('-',50) FONT cSmallFont
@ nRow+9.5,15 DCPRINT SAY 'GROUP REPORT' ALIGN DCPRINT_ALIGN_HCENTER
@ nRow+11,0 DCPRINT SAY Repl('-',50) FONT cSmallFont

DCPRINT FONT cSmallFont

nRow := 13
@ nRow,0 DCPRINT SAY '0001'
@ nRow,15 DCPRINT SAY 520 PICTURE '9999'
@ nRow,20 DCPRINT SAY '(93.04%)'
@ nRow+1,0 DCPRINT SAY 'Impulse Ice Cream'
@ nRow+1,24 DCPRINT SAY 8545.41 PICTURE '99999.99'

nRow += 2
@ nRow,0 DCPRINT SAY '0002'
@ nRow,15 DCPRINT SAY 31 PICTURE '9999'
@ nRow,20 DCPRINT SAY '( 4.31%)'
@ nRow+1,0 DCPRINT SAY 'Scoop'
@ nRow+1,24 DCPRINT SAY 395.67 PICTURE '99999.99'

nRow += 2
@ nRow,0 DCPRINT SAY 'More ......'

DCPRINT OFF

RETURN nil

PROC appsys ; RETURN

Re: POS Reporting

Posted: Mon May 22, 2017 8:27 am
by ampandya
Thanks Roger,

This open the pdf file in acrobat reader now.

can i show this same file on the Form like the screen shot i have attached?

Thanks

Re: POS Reporting

Posted: Tue May 23, 2017 7:55 am
by ampandya
Hi

i want to stop the acrobat reader opening, so if i change the code to :

aOptions := { 1,, '5', nil, nil, .f., 'Bullzip PDF Printer', 1, nil, .t., .t. }

it gives me the attached error.

can you tell me what is wrong here?

Thanks

Re: POS Reporting

Posted: Tue May 23, 2017 8:10 am
by ampandya
Hi
Please ignore my last message.

i have got it working by the following code, I just wanted the pdf to not open.

DCPRINT ON ACROBAT NOSPAWN SIZE 50,50

Many Thanks

Re: POS Reporting

Posted: Tue May 23, 2017 10:16 pm
by c-tec
Hello,
I do this with a ActiveX and Acrobat on a static or rendering the PDF to a JPG with QUICKPDF (free version available).
regards
Rudolf