Print from page part

Good morning everybody.
Starting from a list of data which represent shelves, i select a shelf and double clicking opens its card page, which is a documen type, that contains all the items placed on that shelf.
This document contains some general data, which are a description of the shelf, and a second area wich is a part(page) with all the rows of the items that are on that specific shelf.
All items contain columns like quantity, description, destination, etc.. but the most important column is "printLabel" which is a boolean type. My goal is to flag or unflag that boolean and use an action button to launch the print of the labels, only for the selected items. I already prepared a report with a request page with all the data i need on the labels.

My question is: i know how to create an action button and launch the report and manually fill it; but i don't know how to launch "X" reports where "X" is the number of selected items("printLabels" flagged) and autofill those reports with the data i need, it would be even better if the users don't see the reports and the labels are automatically printed with the desired data. Keep in mind also that the action has to take data from a part(page) and not directly from the main document page.
Do you have any suggestions please?




Answers

  • KTA8KTA8 Member Posts: 397
    I've a general idea that do you want to achieve but I don't have so clearly how you're trying to do.

    If you've already a field of those that you already want to print using setrange on that filter and then SETTABLEVIEW(Rec) on the report should be enough.

    If it's to know which one the user have selected, you should review markedonly or SETSELECTIONFILTER
  • MitznajMitznaj Member Posts: 11
    edited 2023-10-03
    Thank you for the answer. The problem is that if i understand well SETTABLEVIEW works only on a record and i have to select multiple(all the items where printLabel is True). Am i wrong?

    I'll explain my project better, so you understand it:
    The shelf and the items are objects from different tables.
    I created a page representing the shelf and another page containing the items.
    In my project the users should open the list of all the shelves(shelf page), selecting one of those it will open the card/document of that particular shelf and inside of it with all other fields there will be a Page part(page) invoking the list(page) of all the items.
    j9q74bsxsg5x.png
    The point is that i'm unable to select any record from the Part(Page), neither i know any function that can help me do so. Is it impossible?
    Do you have any suggestion?
  • MitznajMitznaj Member Posts: 11
    I'm not able to interact with the part page atl all. For example how can i invoke the part(page) and get the first record?

    If i have to select the first record of the primary page i just do this:

    IF Rec.FINDFIRST THEN
    MESSAGE('First record :%1',Rec);

    Which is the code for the part(page)?
  • KTA8KTA8 Member Posts: 397
    Settableview can have thousands of records. Where do you have that relationship between shelfs and items? You looks like talking being something unrelated but you must have it. Which is the name of that table?
  • MitznajMitznaj Member Posts: 11
    edited 2023-10-17
    Hello, they are related by primary key value, that indicates the shelf itselft, all other columns are unrelated. I copied the structure from an already existing table that was used for shipments.

    Table1 is the master table, Table2 is the part(page list).
    In Table2 i select all the records which have Table1 PK in common.

    Taking one step back from printing the labels, i want to interact somehow with the records of Table2(the part) in c/al code, because i'm not able to do it.
    Like sorting the records, calling another action(maybe simple report) with these reports etc... Just to be clear: all of this interactions with Table2 have to happen while i'm viewing it inside of Table1.

    Do you have any suggestion?
  • MitznajMitznaj Member Posts: 11
    UP
Sign In or Register to comment.