Advanced reports management
The Advanced Reports Management window lists the advanced templates saved in the file. You can rename a template and change its two options, duplicate it, delete it, export it to a file, and import a template from a file. You do not design the template here: design is in the advanced report designer and viewer. The windows say "template" in counts and messages and "report" in titles. Both mean the same thing.
For short steps, see Manage advanced reports. For printing with them, see Print documents with advanced reports.
Opening the window
Click Management > Procedures > Advanced Reports Management on the ribbon.
- The button appears when a file is open in the program and the Procedures group exists on the Management page. If the group does not exist, the program does not add the button.
- The window opens without blocking the other windows. If you click the button while the window is already open, the program brings it to the front and does not open a second one.
- The program records the command in Recent Commands.
- The window opens at eighty percent of the screen size, and you can maximize it. It has no Ok or Cancel button at the bottom; close it with the close button in the title bar.
The window
The window shows the templates you created, and the templates whose owners ticked Shared. You do not see another user's template unless they share it. Templates are saved in the open company file, so each file has its own list.
While the list loads, a picture fades in and out. After loading:
- If the file has no templates, only a picture and the message "You have not added any reports yet." appear. The toolbar and the status bar are not shown.
- If the file has at least one template, the toolbar appears at the top, the list in the middle, and the status bar at the bottom.
Toolbar
| Button | What it does | When it is disabled |
|---|---|---|
| Create a Duplicate | Copies the selected template after you choose a name. See Create a duplicate. | Unless exactly one template is selected. |
| Edit | Changes the name and options of the selected template. See Edit. | Unless exactly one template is selected. |
| Delete | Deletes all selected templates after a question. See Delete. | When no template is selected. |
| Import | Opens the Import window. | Never. |
| Export | Saves the selected template to a file. See Export. | Unless exactly one template is selected. |
| Grouping | A list that groups the templates by one column: None (the default), Type, Shared, Right-to-Left Layout. | Never. |
| Select All | Selects every template shown. | Never. |
| Invert Selection | Selects what was not selected and clears what was. | Never. |
| Clear Selection | Clears the selection. | Never. |
| Search | Shows the search bar above the list. | Never. |
The search bar shows the text "Enter what you want to search for here (Ctrl+F)". The search filters the templates by the text and highlights the match in the name.
Status bar
| Item | What it shows |
|---|---|
| Template count | The total, as a number followed by the word قالب, for example "12 قالب". |
| Selected count | Appears after you select one or more templates, as a number followed by "قالب محدد". |
| Tile View | A check button that shows the templates as cards with pictures. The window opens in this view. |
| Details View | A check button that shows the templates as a table. |
Tile view
Each template is a card with a thumbnail of a fixed size. At the top of the card are the document type icon and the type name, and at the other end the sharing icon if the template is shared. The template name is under the thumbnail.
Details view
| Column | What it shows |
|---|---|
| Name | The template name, preceded by the icon of its type. |
| Type | The document the template prints. Only Invoice, Order and Voucher are shown by name. All other types show the text Unknown. Tile view shows the name of every type. |
| Shared | The sharing icon if the template is shared, and an empty cell if not. |
| Right-to-Left Layout | A ticked box if the template prints right to left, and an unticked box if not. |
The table is grouped by the column you choose in Grouping. The group headings are the values themselves: the type name (all types other than the three under Unknown), the sharing icon, or the direction box.
Column headers have a filter button. Click a header to sort by that column.
Neither view shows the name of the template's owner.
Right-click menu
Right-click a card in tile view, or a row in details view. The same menu appears:
| Item | What it does |
|---|---|
| Create a Duplicate | Same as the toolbar button. |
| Edit | Same as the toolbar button. |
| Delete | Same as the toolbar button. |
| Export | Same as the toolbar button. |
A line separates Create a Duplicate from Edit and Delete, and another line comes before Export. The items are disabled under the same conditions as the toolbar buttons.
Commands
Edit
This opens a window titled Edit with the template name and its options, described in the save window. When you click Ok, the program checks that no other template of the same type uses the name, and then saves the name and the two options. The edit does not touch the template design or its thumbnail. The template updates in the list at once. If saving fails, the error appears and the list still shows the new values until you open the window again.
You can edit any template you see in the window, including a shared template that another user created.
Create a duplicate
This opens the same window titled Create a Duplicate, with the template name and a number added by the program. If the name ends with a number, the program adds one to it. If not, it adds a space and 1. So "Sales Invoice" becomes "Sales Invoice 1", and "Invoice 3" becomes "Invoice 4". When you click Ok, the program checks that no template of the same type uses the name, creates the new template with the same design and thumbnail and the name and options you chose, and adds it to the list.
The copy stays assigned to the owner of the original template, not to the user who copied it.
Delete
The program first asks with the usual delete confirmation window. Its title is "Are you sure you want to delete?" and its button is Delete All. When you confirm, the program deletes all selected templates from the file and removes them from the list. If deleting a template fails, a message with the error text appears.
You can delete any template you see, including a shared template another user created. If deleting fails, the template still disappears from the list and comes back when you open the window again.
If the deleted template was the one a user had chosen for printing a type of document, the program no longer finds it, so the next preview opens the print options window for the user to choose another template.
Export
Click Export with one template selected. The Export window appears.
| Field | Description | Required | Values and rules |
|---|---|---|---|
| File Path | The full path of the file to create. | Yes | The default is the desktop, with the template name and the extension .amnarx, such as Sales Invoice.amnarx. Type the path, or click the browse button to choose it in the usual Export window, which asks before it replaces an existing file. The program does not ask about replacing if you type the path yourself. |
| Export Data Source Code | Adds to the file the code of the data source the template reads from. | No | Not ticked by default. |
The program saves one compressed file that holds the template, its thumbnail, its name, type and options, and the data source code if you ticked the option. It also saves a .png picture with the same name beside it.
| Button | What it does |
|---|---|
| Ok | Saves the file. |
| Cancel | Closes the window and saves nothing. |
Import
Click Import. The Import window appears. It is 640 wide and 480 high and cannot be resized, and Ok stays disabled until a valid file is opened.
Before you choose a file: The window shows the File Path field and, under it, a link that reads "Please select the file you want to import". Click the link, or the browse button in the field, to choose a file with the extension .amnarx (the filter "alameen Advanced Report"). The choose window starts at the desktop. If you type the file path yourself, the program opens the file as soon as the path is that of an existing file. If the file cannot be opened, a message with the error text appears.
After the file opens, these details appear:
| Field | Description | Required | Values and rules |
|---|---|---|---|
| Type | The icon and name of the document type, as in the file. | Display only | The program reads it from the file. |
| Name | The template name after the import. | Yes | The program fills in the template name from the file, and you can change it. It must not be empty, and must not be used by another template of the same type. |
| Data Source | The name of the procedure the template reads its data from. | Display only | It starts with prcPrintAR_ and then the type name, such as prcPrintAR_Bill_Default. A View button appears beside it if the file carries the data source code. |
| Right-to-Left Layout | The template prints right to left. | No | Takes its value from the file, and you can change it. |
| Shared | Makes the template available to all users of the file. | No | Takes its value from the file, and you can change it. |
| Replace the data source if it exists | Relates to the data source code in the file. | No | Shown only if the file carries the data source code. Ticked by default. |
| Picture | The thumbnail saved in the file. | Display only | — |
| Error list | The validation errors, each with an error icon and text. | Display only | Shown if there is an error. Ok stays disabled while it has items. |
The program validates as soon as the file opens, and the list shows the errors it found:
- The template type is unknown.
- The data source name is not specified, or does not start with the prefix the type requires.
- The data source does not exist in the open company file, and its code is not in the imported file.
- The data source code is invalid, contains a delete statement (
DELETE), or does not contain a statement that creates a stored procedure. - The procedure name in the code does not match the name specified in the template.
- The procedure parameters are incompatible: the first parameter must be of the unique identifier type.
The texts of these errors are in Messages.
When you click Ok, the program checks the name, then saves the template in the file and assigns it to the current user. If the imported file has data source code and the data source does not exist in the company file, the program creates it. If it exists and you left Replace the data source if it exists ticked, the program tries to create it again without deleting the old one, so an error from SQL Server appears and the template is not imported. If it exists and you cleared the option, the program does not touch it and uses the existing one.
| Button | What it does |
|---|---|
| View (beside Data Source) | Opens the data source code window. |
| Ok | Checks the name and imports the template. |
| Cancel | Closes the window and imports nothing. |
Data source code window
This opens from the View button in the Import window. Its title is the data source name. It holds a read-only editor, left to right, with line numbers and colouring for SQL statements and no word wrap. It has a single Close button, and you can maximize the window.
Messages
| Message | When it appears | What to do |
|---|---|---|
| Are you sure you want to delete? | You clicked Delete with one or more templates selected. | Click Delete All to delete, or cancel. |
| The template name is already in use. Choose another name | The name you typed in Edit, Create a Duplicate or Import is used by another template of the same type. | Type another name. |
| The template name is invalid | You clicked Ok in the import and the name is empty. | Type a name. |
| The template type is unknown | The type number in the file is outside the types the program knows. | Use a file exported by the program itself. |
| The data source name is not specified | The file has no data source name. | Export the template again. |
| The data source name is invalid. It must start with '…' | The source name does not start with prcPrintAR_ followed by the template type name and an underscore. | Correct the name in the exported file. |
| The data source does not exist | The file has no code, and the procedure does not exist in the company file. | Export the template with Export Data Source Code. |
| The data source code is invalid | SQL Server cannot parse the code in the file. | Correct it, or export again. |
| The data source code is unsafe | The code contains a DELETE statement. | Remove it. |
| The data source code does not contain a statement to create a stored procedure | The code has no statement that creates a procedure. | Export again. |
| The data source name does not match the name specified in the template | The procedure name in the code differs from the source name in the file data. | Export again. |
| The stored procedure parameters are incompatible | The first parameter of the procedure is not of the unique identifier type. | Change the code. |
| The error text returned by the system | The file cannot be opened, or saving the template, creating the procedure, or deleting, copying or editing the template failed. | Read the text, fix the cause and try again. |
Related
This page applies to alameen ERP 10, version 10.1.79.764.