Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QReport Label input?

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
Hello all,

I have a procedure that takes information from a text file and uploads it to the database. During the upload a unique id field is determined (the procedure finds the max number in the database and adds 1 to it for the next record and loops). When the upload has completed, I need to print out labels of each unique id as a BARCODE on the 8 1/2 x 11 pages of little labels.

Can someone point me in the right direction? Thanks for any assistance!

leslie
 
I had a similar situation, and luckily we weren't doing barcoding. I used a line printer, and tractor feed labels. I set up the page size for the labels, and print one label per page. Hopefully this helps,

PC
 
Lucky you! Unfortunately, it has to be BARCODE with laser printer!

leslie

P.S. I'm a Delphi newbie, if you have some help please be as detailed as possible! Thanks
 
To print labels, take a quickreport and add a QRBand to it. Now click on the quickreport and expand the page section of the object inspector. In here increase the number of columns from 1 to however many labels you have running across your sheet. You can play with the page settings for the quickreport to make it fit the printer correctly (change the margin settings) and make the details band the size of you labels.

As for printing the bar code onto these labels, I recommend getting down on your knees and parying to a higher power because off the top of my head I have absolutley no idea how codes are transformed into barcodes. A little research is required on the topic methinks. Arte Et Labore
 
Thanks! We have a Windows BarCode font installed, I just need to use it! Do I just set the QReport font to the barcode?

leslie

(While learning Delphi I have been praying to the higher power constantly!!)
 
In that case, set your quickreports dataset to whatever table you are using and place a QRDBLabel on your detailband. Set this labels font to your barcode font and set the data properties for the label. To call this report from your aplication use QuickRep1.Preview to see it on screen before printing. Arte Et Labore
 
Except I don't have a table! I am trying to populate an array of integers with all the numbers I need, then I want to pass the array in and for each item in the array, print the label. Is this possible?

leslie

p.s what's wrong with this code??? It's bombing on the barcode(j) := JurNum. Thanks!

procedure TfrmMainMenu.UploadVenire1Click(Sender: TObject);
var
F: TextFile;
S: string;
FullName, LastName: string;
j, i, JurNum: integer;
barcode: array[1..350] of integer;
begin
if OpenDialog1.Execute then { Display Open dialog box }
begin
AssignFile(F, OpenDialog1.FileName); { File selected in dialog }
Reset(F);
qryMaxJuror.Active := True;
JurNum := qryMaxJuror.FieldByName('JURNUM').AsInteger;
JurNum := JurNum + 1;
{JurNum := 1;}
for j := 1 to 350 do
begin
Readln(F, S); { Read first line of file }
FullName := Copy(S, 160,30); // extract name
i := Pos( ',', FullName);
qryVenireUpdate.ParamByName('LASTNAME').AsString := Copy(FullName,0,i-1);
qryVenireUpdate.ParamByName('FIRSTNAME').AsString := Copy(FullName, (i+2), (30 - Length(LastName)));
qryVenireUpdate.ParamByName('ADDRESS').AsString := copy(S,190,25); // extract address
qryVenireUpdate.ParamByName('CITY').AsString := copy(S,215,15); //extract city
qryVenireUpdate.ParamByName('STATE').AsString := copy(S,230,2);
qryVenireUpdate.ParamByName('ZIPCODE').AsString := copy(S,232,9);
qryVenireUpdate.ParamByName('SSN').AsString := copy(S,151,9);
qryVenireUpdate.ParamByName('TERMDATE').AsInteger := StrToInt ('20' + (copy(S,16,6)));
qryVenireUpdate.ParamByName('ORGPOST').AsInteger := StrToInt('20' + (copy(S,16,6)));
qryVenireUpdate.ParamByName('JURNUM').AsInteger := JurNum;
qryVenireUpdate.ParamByName('STATUSCD').AsString := 'NR';
qryVenireUpdate.ExecSQL;
barcode(j) := JurorNum;
JurNum := JurNum + 1;
end;
CloseFile(F);
end;
end;
 
So I figured out what was wrong with the code! I now have an array filled with all the numbers I need to have a Barcode label printed!

leslie
 
I would imagine that when you enter these numbers into a caption property, the label it relates to will display the correct barcode. Without a table, you may be better off actually designing the report yourself. Drop a detail band onto a quickreport and resize it so that it fills the report. Now use the measurement markings on the report to design a full page of labels. Once you have done this you can create a repeat loop and add your numbers from your array to a corresponding label on the report until all the label births are full. once they are full repeat until your arry is empty. Also, after each cycle of the repeat loop call the QuickReport1.Print method (Dont use prview as if you have a lot of pages then a preview will close and be replaced by another one imediatley slowing everthing down). Hope this helps! Arte Et Labore
 
Eric it is Ora Et Labora (Pray and work)


Steven van Els
SAvanEls@cq-link.sr
 
Svanels - It is Arte Et Labore but your on the right tracks, it is latin and it means Art and Labour. Arte Et Labore
 
Leslie did you get your barcode working? some time ago I experimented with a barcode component, and I was able to print 1 code, I traded my epson for a HP printer, and the bar-reader got confused. Just stopped it and put in the file of "Things to do when I have time" Steven van Els
SAvanEls@cq-link.sr
 
I actually did! I ended up creating a Word document with a table layout matching the label and entering my array in the cells! (see Delphi and MS Word VBA for that epic posting!!). Thanks for your help and I appreciate your concern that I got it working.

Leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top