Table of Contents

Print Configuration Examples

This topic provides examples of how to configure COSMO Mobile Solution to print PDF, Business Central, and label reports.

Configure PDF Report Printing

This example demonstrates the process of configuring PDF report printing within COSMO Mobile Solution.

The goal is to print a warehouse shipment document and to print the posted warehouse shipment document following its posting.

Add a Printer

In the first step, a printer needs to be added for PDF printing done through the network.

  1. In the Printers page, choose the New action.
  2. In the Description field, enter a unique identifier.
  3. In the Printer Type field, choose Generic Printer.
  4. In the Connection Type field, choose TCP/IP.
  5. In the Address field, enter the address of the printer.

PDF printing requires a printer that supports PDF files. Check your printer manual or specifications to confirm this capability.

PDF printer setup


Enable Printing for Users

The next step is to configure the COSMO Mobile Solution users to access the new printer.

  1. In the Users page, select the Enable Report Printing checkbox for the user.
  2. Choose the User Printers action.
  3. Select the Assigned and Default Printer checkboxes for the new printer.

With this setup, report printing is enabled for the user and they can use the new printer can be used.

User settings page


Set Up PDF Function in Page Customization

In this step, the PDF function is set up for the warehouse shipment page customization, CCSMSWhseShipmentHeadWS. The PDF function will generate the PDF that will be either printed by the mobile application or will be shown in the mobile application as a preview.

After opening the CCSMSWhseShipmentHeadWS page customization, the first step is to add an unbound function to the page. This must be done for a PDF function to work with the custom report functionality.

  1. Open the CCSMSWhseShipmentHeadWS Global Page Customization (Object ID 5308012).
  2. In the Card View FastTab, choose the Add Unbound Function action.
  3. In the Function Browser page, select CCSMSServiceFunctionsWS_PrintReport.
  4. Choose the OK button.
  5. In the General FastTab, set this function in the PDF Function field (within the Page Level Functions field group).

WhseShipmentCustomization

Add Custom Reports

Now the reports must be defined. On the Actions menu, choose Printing > Custom Report Settings.

WhseShipmentCustomization2


Warehouse Shipment Report

First add the Warehouse Shipment report.

  1. In the Report ID field, enter 7317. This will fill in some fields, such as First Data Table ID and Report Caption.
  2. It is a good practice to use a meaningful name for the report in the Description field; in this case, the default Warehouse Shipment is sufficient.
  3. In the Query Type field, choose First and then leave the Query Amount field set to 1. This ensures that the first record based on the specified filters will be used when generating the report in this case.
  4. Select the Default checkbox to make this the default report. This setting automatically selects the Visible checkbox.
  5. Leave the Number of Copies Type and the Number of Copies fields as they are because only one copy of this document is needed.
  6. Leave the Printer Variable field empty; the default printer is already defined and sufficient for this example.

The last step of setting up this report is to set a filter on the No. field. It is important to mention that when you want to create a custom report filter, you will always set filters on the report's First Data Table ID, which in this case means 7320, the Warehouse Shipment Header. If you are going to filter based on a field, this typically means that the value is coming from the service page, in this case "WhseShipmentHeader".

  1. In the Custom Report Filters FastTab, enter No. in the Field Name field.
  2. In the Filter Type field, choose Field.
  3. In the Filter field, enter No (without the period (.)).

This set up means the system will set a filter on table 7320 table's No. field with the value of the current Warehouse Shipment from COSMO Mobile Solution.

If you have followed the above instructions, your custom report setting should look like this:

Custom Report Settings


Posted Warehouse Shipment Report

Now add the Posted Warehouse Shipment report. The process is the same as described for the Warehouse Shipment report so the steps are shortened.

  1. In the Report ID field, enter 7309 and leave the Description field set as Warehouse Posted Shipment.
  2. In the Query Type field, choose Last and then leave the Query Amount field set to 1. This ensures that the last record based on the specified filters will be used when generating the report.
  3. Select the Visible checkbox.
  4. Leave the Number of Copies Type and the Number of Copies fields as they are because only one copy of this document is needed.
  5. To ensure that the posted document is always printed on a specific printer instead of the default printer, enter the desired printer variable in the Printer Variable field.
  6. In the Custom Report Filters FastTab, enter Whse. Shipment No. in the Field Name field.
  7. In the Filter Type field, choose Field.
  8. In the Filter field, enter No (without the period (.)).

If you have followed the above instructions, your custom report setting should look like this:

CustomReportOverview


Settings in Mobile Application

At this point, when choosing the Report print button or the Print Preview button in the mobile application, the default report will be printed to the default printer (based on user settings). Since the posted report was set to be visible, if the user long taps on the Report print button, a page will open that allows the user to change the target printer, select a report, or change the number of copies. Changing the report will automatically update the printer to the corresponding value configured on the Custom Reports page.

PDF Print


Set Automatic Printing after Posting

For this example, the posted shipment needs to be automatically printed after choosing the Post button on the page.

  1. Go back to the Global Page Customization page.
  2. In the Card View FastTab, choose the WhseShipPostShipment line within the Function List group, and then choose the Function Actions action on the Manage menu.
  3. In the Run Time field, choose After Action Successful.
  4. In the Function Action field, choose Print Document.
  5. In the Action Parameter field, choose Warehouse Posted Shipment.

Function action


With the setups in this example, users can print on demand the shipment document and the posted shipment, and when the shipment is posted, the posted document is printed.