|
Nuts! I had this working, but when I folded my test program into the
production code, it broke. Naturally, I didn't save the test program...
What happens is that it's form-feeding to the size of a standard
green-bar form instead of the 18 lines I want (mailing labels). Can
anybody see what's wrong with this?
parms = new PrintParameterList();
parms.setParameter(PrintObject.ATTR_HOLD, "*YES");
parms.setParameter(PrintObject.ATTR_SAVE, "*YES");
parms.setParameter(PrintObject.ATTR_MEASMETHOD, "*ROWCOL");
parms.setParameter(PrintObject.ATTR_PAGELEN, 18F);
parms.setParameter(PrintObject.ATTR_PAGEWIDTH, 40F);
parms.setParameter(PrintObject.ATTR_OVERFLOW, 18);
parms.setParameter(PrintObject.ATTR_PRTQUALITY, "*NLQ");
parms.setParameter(PrintObject.ATTR_OUTPUT_QUEUE,
"/QSYS.LIB/QUSRSYS.LIB/PRT01.OUTQ");
parms.setParameter(PrintObject.ATTR_SPOOLFILE, "CUSTLBL");
parms.setParameter(PrintObject.ATTR_USERDATA, "Catalog");
try {
// args are system, options, printer file, output queue
out = new SpooledFileOutputStream(weyco400, parms, null, null);
writer = new SCS5256Writer(out, 37, weyco400);
// writer.setVerticalFormat(18);
v = database.getCustomersForSalesman(salesman,
CatalogDatabase.SORT_ZIPCODE);
for (enum = v.elements(); enum.hasMoreElements(); ) {
cc = (CatalogCustomer)enum.nextElement();
writer.write(cc.getCompany());
writer.newLine();
writer.write(cc.getAddress1());
writer.newLine();
if (!cc.getAddress2().trim().equals("")) {
writer.write(cc.getAddress2());
writer.newLine();
}
writer.write(cc.getCity() + ", " + cc.getState() + " "
+ cc.getZipCode());
writer.newLine();
writer.endPage();
}
writer.flush();
writer.close();
Glenn Holmer wrote:
> DReid@capitalfactors.com wrote:
>
>> Carriage return and line feed will do you no good.
>> Use methods newLine() and endPage()
>
>
> Thanks, that worked great.
--
____________________________________________________________
Glenn Holmer gholmer@weycogroup.com
Programmer/Analyst phone: 414.908.1809
Weyco Group, Inc. fax: 414.908.1601
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.