Customer Labels

MatteMatte Member Posts: 2
I have to make a report that prints Customer Labels like Report 110 "Customer-Labels" but I want the user to have the possibility to choose which customers and how many labels of the specific customer will be printed. My Intention was to create a temporary table and then let the user edit this temp. table on the request Form of the report with a table box. So the user can choose the customer No. and the number of labels to be printed.

Cust.No | Quantity
1000 | 15
2000 | 25
3000 | 3
.
.
.

The problem is that I can't set the source table of the request form to the temporary Table and then the table box isn't editable.

Is it possible to make a report in this way or is it better to do in a different way?

The easiest way would be to create a new table but I can't to that due to license.

I' ve tried a lot of things but none of them worked.

Thanks

Comments

  • krikikriki Member, Moderator Posts: 9,118
    You can use the customer table itself.
    -Add an extra field on the table. This field will contain the no. of labels in your temptable. (you can also use it as a default).
    -Make a new form with the customer code, name, other info in it and the new field. Insert and Delete are not allowed; Modify is only allowed on the new field.
    -make a report with 2 dataitems:
    -first dataitem is to SELECT some customers.
    -These you save in a temptable in the "OnAfterGetRecord()"-trigger.
    tmpCustomer := Customer;
    tmpCustomer.INSERT(FALSE);
    

    -"OnPostDataItem()" :
    FORM.RUNMODAL(FORM::"your new form",tmpCustomer);
    
    Your form will run and behave as a normal form on a real table. BUT it will work on the temptable! Be sure not to do DB-writes, because this creates a transaction and RUNMODAL will give an error (INSERT in a temptable does NOT create a transaction)

    -second dataitem is to process the customers in the temptable. So let the table run on virtual table "Integer".
    OnPreDataItem():
    tmpCustomer.RESET;
    tmpCustomer.SETFILTER("New Field",'<>0');
    RESET;
    SETRANGE(Number,1,tmpCustomer.COUNT);
    
    OnAfterGetRecord():
    IF Number = 1 THEN
      tmpCustomer.FIND('-')
    ELSE
      tmpCustomer.NEXT;
    
    -third dataitem
    Probably you need another dataitem for printing the requested number of labels.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.