Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
3
Erster Beitrag:
vor 1 Jahr
Letzter Beitrag:
vor 1 Jahr
Beteiligte Autoren:
Mark Crichton, kingdr

iConfigure label printer

Startbeitrag von Mark Crichton am 27.07.2016 03:51

Hi Folks
Appreciate some help with the following.

using Windev 21 - label printer is Brother QL-720NW

I have app with two printers. A4 and Label whose names are stored in data table.
When user selects [Print Label] I want to select the label printer, set number of copies and print. Should be straight forward, but unless I actually run IConfigure() that displays on screen for user to click [ok] It prints with wrong parameters.

Below is my code


// Step 1 - select printer as label printer

iDestination(iPrinter,"Job lbl-62mm")
IF iConfigure(dwrcompany.DWRPRNLBL) THEN // the name of the lable printer
iParameter(iOrientation, iOrientation_Portrait) // make sure set to portrait
iParameter(iPaperSize,"62mm") // label width set to size of continuous label used
iParameter(iCopies,gnCopies) // number of copies to print



Trace("---------------- A , B ----------------")
Trace("Orientation = " + iParameter(iOrientation))
Trace("PaperSize = " + iParameter(iPaperSize))
Trace("NbCopies = " + iParameter(iCopies)) // Trace shows "changed " values

iPreview(ipvZoom100) // Just for testing
iConfigure(iInfoPrinter(True)) // tried this, but does nothing
iConfigure() // USER CLICKS OK... DO THIS AND ALL PRINTS PERFECTLY. IF NOT THERE PRINTS WITHOUT CHANGING THE PARAMETERS. SEEMS I NEED TO "SAVE" THE PARAMETERS TO THE PRINTER SOMEHOW.

iInitReportQuery(lbl_stkLabel2,TABLE_StockIssue.COL_Stkid)
iPrintReport(lbl_stkLabel2,"Test1")
ELSE
Info("Error configuring label printer... ")
END

Any tips appreciated
Thanks Mark

Antworten:

Hi

Try to use

iConfigure("Actual print Queue name defined in device and printer")

with quotes as above and it should go with your wanted printer then

and use iPreview to see if it works out and no need to use iconfigure() as

it always popup list of printQues asking to select the right one, then apply

iPreview(100) to see if it works out.

HTH

King

von kingdr - am 27.07.2016 05:55
Hi King

Thanks for help. Found the problem was 2 different problems I'll outline below in case it helps someone else

My problem was with the label format and with using iConfigure.

First I used th eBrother P-Touch Editor to check printer settings and get a label to print. That done I set Windev label up the same, and found that I needed to set paper size bigger than label size. I tested the label o ot's own and got that working.
Then ran it with no iConfigure and it worked fine. Then added no of copies an still worked fine.

Below is my code to change printers and print A4 then labels.


// Printer names are stored in data table

// Step 2 - Print report
iPreview(i100)
IF iConfigure(dwrcompany.DWRPRNA4) THEN
HExecuteQuery(QRY_Stock_CodeStatus,hQueryDefault,Null,Null,Null,1,Null)
iPrintReport(RPT_StkIssue)
ELSE
Info("Error configuring A4 printer... ")
END


// Step 3 - Print label
iDestination(iPrinter,"Job lbl-62mm")
IF iConfigure(dwrcompany.DWRPRNLBL) THEN
iParameter(iCopies,gnCopies) // global variable
iInitReportQuery(lbl_stkLabel2,TABLE_StockIssue.COL_Stkid)
iPrintReport(lbl_stkLabel2,"Test1")
ELSE
Info("Error configuring label printer... ")
END

Regards Mark

von Mark Crichton - am 31.07.2016 09:09
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.