Creating a SDD
Sometimes there exists a need to provide your users with a more flexible way of selecting documents to print or they may want to print select documents that do not fall in a range. The Select Document Dialog is an alternative Report Dialog that is very powerful in letting your user’s print how they want to.
The fields required to set this up are found in the Reports Table in your custom reports, the fields required to be set up are
DefaultType: This must be set to SDD or -1
SDDQuery: This is the SQL statement used to display the selection you want to present to the users
SDDCopiesField: Optional Field to default the number of copies field to a value in the SQL statement.
SddQueryField: Field in the Main Query to link the SDD selection on
To demonstrate how it works we will work from an example report. Here is the query for a simple sales listing report, which shows some basic order information.
“SELECT SalesOrder.SalesOrderNo, SalesOrder.EntryDate, SalesOrder.DueDate, Customers.CustomerNo, Customers.Name, SalesOrder.SubTotal
FROM Customers INNER JOIN SalesOrder ON Customers.CustomerID = SalesOrder.CustomerID”
This will be the report query and the report has one dialog assigned to it for SalesOrderNo. This is setup like any other custom report and will work as such.
Now we want to set up a SDD dialog for this report which will replace the regular dialog, please note that one report can only have one or the other that is either SDD or GRD.
In this example we will want the user to be able to select by Sales Order No, Customer name, Customer Number, Entry Date, and Customer PO.
First Step is to change the DefaultType field for this report to SDD or -1
Second Step is to develop the SDD Query.
SDDQuery = “SELECT SalesOrder.SalesOrderID, SalesOrder.SalesOrderNo, SalesOrder.EntryDate, Customers.CustomerNo, Customers.Name, SalesOrder.CustomerPO”
There is a rule about the SDD Query that must be followed or it will not work, the first field in your query MUST be an ID field as this will link back to the main report query.
In this example SddQueryField = “SalesOrder.SalesOrderID”
Once all that is setup properly the report will work with the SDDDialog. Please note that by default the SDD is only supported by printing via the Report Switchboard and NOT the transactional forms.
This dialog functions exactly like smart finder in that you can type in partial matches, ranges etc. See Smart Finder for more details
Now to print you have to press the Apply Filter to get the records you want
Finally, select which ones you wish to print via the Print Check Box. You can also over ride the default Copies field with a new qty of copies to print.
So this example will print the report for three of the sales orders and the last one will be printed 3 times
Hit the preview button to view the selected.
Binding Report Dialog Setup to the SDD
This is not required and is optional if you wish to make use of it
In the previous section there is the Sales Order No, you way want to give your users dropdowns combo boxes to facilitate finding an order. You can Bind Report Dialog Setup Records to the SDD by making a couple of changes.
The SDDField must be a non zero value that matches the position of the field you want to apply the combo to, in this example we are using sales order so it will be 1
And the Control Order field for SDD also contains the position in the query to apply the drop down to
Once that is complete you will be able to select the values via a drop down for the dialog record you supplied
|