Page 1 of 5

How to print an image & data on it

Posted: Sat Mar 06, 2010 10:47 am
by swapan
Dear All:

Plz. go thru the attached image file....

Its meant for label printing.....

On the label sheet (A4 size with two labels) I've to print this image file & the user's data as entered...........

1 entry program in hmg with dbf as backend can be made for this.
But how to print user's those data on this image??

Thanks!

Swapan

Re: How to print an image & data on it

Posted: Sat Mar 06, 2010 12:29 pm
by Roberto Lopez
swapan wrote:Dear All:

Plz. go thru the attached image file....

Its meant for label printing.....

On the label sheet (A4 size with two labels) I've to print this image file & the user's data as entered...........

1 entry program in hmg with dbf as backend can be made for this.
But how to print user's those data on this image??

Thanks!

Swapan
You have full control of the print output via @...PRINT commands, you can print images besides text and lines.

You can position the text and images exactly in the place you want without regarding printer or paper size used.

Please, take a look at 'Print Commands' at HMG docs: hmgdoc/hmgdoc.htm

Re: How to print an image & data on it

Posted: Sat Mar 06, 2010 6:09 pm
by mol
Here is my application, which can print labels.
Maybe it will be useful for you.
You need to recompile it.

Re: How to print an image & data on it

Posted: Sun Mar 07, 2010 6:02 am
by swapan
Thanks Roberto Sir for your reply..........
And Mol its a great gesture on your part to share your label program with us.

Will revert after going through the project..

Thanks & Regards,

Swapan

Re: How to print an image & data on it

Posted: Wed Mar 10, 2010 12:32 pm
by swapan
Can I accomplish the job using Report Writer?

I've used this kind of code:

DEFINE REPORT Report1
* Report Layout ***********************************************
BEGIN LAYOUT
PAPERSIZE PRINTER_PAPER_A4
ORIENTATION PRINTER_ORIENT_PORTRAIT
END LAYOUT
* Header Band *************************************************
BEGIN HEADER
BANDHEIGHT 25


Its generating 2 labels in 1 A4 sized sheet, but no. of copies option is disabled, how can I initialize this value and the user can put values for No. of copies??

For Dot Matrix Printer (local) its coming, but for others (network printers) which are deskjets - no. of copies is disabled.... Not sure if the network printers at my office are right now offline or not....

Re: How to print an image & data on it

Posted: Thu Mar 11, 2010 3:16 pm
by swapan
swapan wrote:Can I accomplish the job using Report Writer?

I've used this kind of code:

DEFINE REPORT Report1
* Report Layout ***********************************************
BEGIN LAYOUT
PAPERSIZE PRINTER_PAPER_A4
ORIENTATION PRINTER_ORIENT_PORTRAIT
END LAYOUT
* Header Band *************************************************
BEGIN HEADER
BANDHEIGHT 25


Its generating 2 labels in 1 A4 sized sheet, but no. of copies option is disabled, how can I initialize this value and the user can put values for No. of copies??

For Dot Matrix Printer (local) its coming, but for others (network printers) which are deskjets - no. of copies is disabled.... Not sure if the network printers at my office are right now offline or not....
How to enable the option 'No. of Copies' in the printer dialog with above kind of coding.....?

thanks,

Swapan

Re: How to print an image & data on it

Posted: Thu Mar 11, 2010 5:14 pm
by sudip
Dear Swapan,

You can set number of copies to be printed from print preview.

You can also find some helpful codes from \hmg\samples\print folder.

Please check following codes taken from that folder:

Code: Select all

*------------------------------------------------------------------------------*
Procedure PrintTest3()
*------------------------------------------------------------------------------*
Local i 
Local lSuccess

	// Measure Units Are Millimeters

	SELECT PRINTER DIALOG TO lSuccess 

	If lSuccess == .T.
		PrintDoc()
		MsgInfo('Print Finished')
	EndIf

Return
With best regards.

Sudip

Re: How to print an image & data on it

Posted: Thu Mar 11, 2010 6:09 pm
by swapan
sudip wrote:Dear Swapan,

You can set number of copies to be printed from print preview.

You can also find some helpful codes from \hmg\samples\print folder.

Please check following codes taken from that folder:

Code: Select all

*------------------------------------------------------------------------------*
Procedure PrintTest3()
*------------------------------------------------------------------------------*
Local i 
Local lSuccess

	// Measure Units Are Millimeters

	SELECT PRINTER DIALOG TO lSuccess 

	If lSuccess == .T.
		PrintDoc()
		MsgInfo('Print Finished')
	EndIf

Return
With best regards.

Sudip
Sudip........Thanks for your attention.

I've taken help from hmg\samples\report.advanced1\demo.prg

But its - the no. of copies option is in disabled state in Print Preview in my coding:

DEFINE REPORT Report1
* Report Layout ***********************************************
BEGIN LAYOUT
PAPERSIZE PRINTER_PAPER_A4
ORIENTATION PRINTER_ORIENT_PORTRAIT
END LAYOUT
* Header Band *************************************************
BEGIN HEADER
BANDHEIGHT 25

Re: How to print an image & data on it

Posted: Fri Mar 12, 2010 12:48 am
by sudip
Hi Swapan,

I have 3 local (virtual) printers installed in my computer. No. of copies is enabled in only one of them (BULLZIP PDF PRINTER).

But I just tested C:\hmg\SAMPLES\PRINT\ImageFromResource\Bmp. When I choose select printer with settings, it gave me option for specifying no. of copies as follows.
printcopy.jpg
printcopy.jpg (31.1 KiB) Viewed 4563 times
So, IMHO, there is a problem in case of preview (if I am not wrong).

With best regards.

Sudip

Re: How to print an image & data on it

Posted: Fri Mar 12, 2010 7:55 pm
by Roberto Lopez
swapan wrote:Can I accomplish the job using Report Writer?

I've used this kind of code:

DEFINE REPORT Report1
* Report Layout ***********************************************
BEGIN LAYOUT
PAPERSIZE PRINTER_PAPER_A4
ORIENTATION PRINTER_ORIENT_PORTRAIT
END LAYOUT
* Header Band *************************************************
BEGIN HEADER
BANDHEIGHT 25


Its generating 2 labels in 1 A4 sized sheet, but no. of copies option is disabled, how can I initialize this value and the user can put values for No. of copies??

For Dot Matrix Printer (local) its coming, but for others (network printers) which are deskjets - no. of copies is disabled.... Not sure if the network printers at my office are right now offline or not....
Number of copies will be enabled only when the printer driver supports it, so it depends upon the printer you are using.