Precisions for label report
jezabel
Angers, France
Hello,
I've red the topic on labels in binaries newsgroup but I can't run delphi to understand what it contains.
I run FR designer from the program.
I have to create a report for article labels with a name, a code and a price, with 3 columns and 21 labels/column (63 labels on the sheet, 21 x 29.7 cm).
The setting is ok.
But :
1) I can't see where to set the vertical gap between labels (the gap between 2 bands in View > Options only affects the design page).
I only have a masterdata band in my report.
2) I have to set a number of missing labels (labels which already have been printed on the sheet and removed) to restart on first remain label.
3) I have to set a number of copy for the band (for example : we want 3 labels of each article).
Could you help without transfering me a delphi source file ?
Thanks a lot
Jez.
I've red the topic on labels in binaries newsgroup but I can't run delphi to understand what it contains.
I run FR designer from the program.
I have to create a report for article labels with a name, a code and a price, with 3 columns and 21 labels/column (63 labels on the sheet, 21 x 29.7 cm).
The setting is ok.
But :
1) I can't see where to set the vertical gap between labels (the gap between 2 bands in View > Options only affects the design page).
I only have a masterdata band in my report.
2) I have to set a number of missing labels (labels which already have been printed on the sheet and removed) to restart on first remain label.
3) I have to set a number of copy for the band (for example : we want 3 labels of each article).
Could you help without transfering me a delphi source file ?
Thanks a lot
Jez.
Comments
the vertical gap is set by making the band height equal to label height + gap, leave bottom page margin at 0.
this will give horizontal out put 1, 2, 3
for vertical
1,5
2,6
3,7
4,8
use page columns
add a memo object in the band the size of the label turn its frame lines on make it non printable
it is just a guide to show the bounds of the label while designing
you will need some variables to track the num of labels to print, the start position( the num of labels to skip), numberof lables printed, do not set the band's dataset property you will control it's position from your code.
you set the band's rowcount to the record count of the dataset * the numcopies required,
if you look way back in the binaries news group you will find a selfcontained label demo that i posted. just open the .fr3 file in your designer.
I set the row gap succesfully.
The skip feature is working but not the copy number.
The reason is I can't use the Datarow property because my masterdata band is connected to the dataset. This dataset comes from dephi and is the result of a stored procedure.
Is there a solution ?
Thanks again
Jez.
declare a variable of type tfrxdataset
var
ds: TfrxDataSet;
use this code either in the empty "begin end." block of code or in the onstart report event.
ds := Report.GetDataset('frxDBDataSet1'); // use either the name or username of the dataset.
you can then get the record count of the dataset and move it using next prior first
ie masterdata1 .rowcount := ds.recordcount * numcopy variable.
But I still have problem :
I changed the code because the "ds.next" was already done automaticaly and my copy number depend of each label.
The result is ok until one asks more skip labels than the dataset recordcount. The engine stops at the recordcount number of skip labels.
For example, if I ask 20 skip labels and the dataset counts 7 records, it displays only 7 skip labels.
It would be easier if I could send you my FR file.
Here is my code yet :
But I don't understand how this can work without using the OnManualBuild event.
Thank for your advice.
JEz.
the demo you downloaded runs fine, so you must be doing something wrong.
zip and post your demo app in the binaries news group.
in the meantime i will look at your code.
the ds variable is initialized in the report.onstartpage. You said in previous post that it could be done there as well.
I don't understand the second part of your sentence :
'and set on first record not in the event of the databand'
You did make a Table1.First in the masterdataonbeforeprint in your demo. [img]style_emoticons/<#EMO_DIR#>/blink.gif" style="vertical-align:middle" emoid=":blink:" border="0" alt="blink.gif" /> My file is posted on binaries newsgroup. thanks Jez[/img]
the sample code and dialog from the demo should be ok for the skip portion.
without data i can't test your data portion.
the only reason i was able to move the ds as table1.next is the fact it was an internal table.
Also since you appear to have a varying no of copies required for each record, you will have to determine a new rowcount prop value for the masterdataband before the report runs, you may need to make this value = to the num to skip + sum of the values in each record of the main dataset,
this may require you to iterate through that table at the start of the report to determine that value, and of course when ever you move to the next record when running you will need to change the numcopy variable to suit.
btw what is actual height width of a label in cm? , also when working with labels better to use pixels in design mode for better accuracy.
Otherwise, I had a blank page : the MasterdataBand.OnBeforePrint event is not fired.
That's why my databand is connected too. If it's not, the result is the same that your demo.
Should I try with manual build now ?
Label creation is not easy with FR
at my latest reply.
I realized that it was maybe the onstartreport event so I put its code in the main proc and the masterdataonbeforeprint event fired.
Labels print correctly now. Thanks.
Everything was correct until I re opened the program :
Now the recordcount number is wrong !
1 record is counted.
I created another report with masterdataband connected to the dataset in the same form (in a list) and then the recordcount number increases when I preview the connected report ! I must clic on each report several times to get the correct dataset records number in my first report.
[img]style_emoticons/<#EMO_DIR#>/blink.gif" style="vertical-align:middle" emoid=":blink:" border="0" alt="blink.gif" /> Can you see where the problem is ? Thanks again Jez[/img]