Remote control via the command line
Remote control of easymap via command line reference offers the possibility to control elementary functions from other applications with simple programming, e.g. opening, updating and printing maps. Remote control can also be done via a batch script.
With the appropriate programming you can make Windows start easymap, open an easymap workbook and display it on the screen. If a workbook contains linked data, easymap updates the maps automatically. If the maps contain analyses with equidistant or equally distributed classes, the classes are also updated automatically.
easymap is started from the command line with special parameters which are converted into actions by easymap. Especially for regularly recurring, automated tasks this procedure can be interesting.
The following things are possible with this approach:
- Open, save and close map folders
- Printing and graphic export of components of the map folder
- Modify the map folder within narrow limits, e.g. change visibility of objects.
If you need further access to the map folder, please use the COM-Object modell.
In the following we will give some examples of command line references (please note that these remote control commands are intended for experienced programmers).
With the help of command line parameters it is possible to process a large amount of workbookn. The control can be done e.g. via a batch script.
Each command always consists of the name of the command and a list of parameters. The parameter list is always enclosed in quotation marks and the parameters are separated by semicolons. Optional parameters (indicated by square brackets in the command reference) can be omitted. Any number of commands can be lined up.
Example:
Print a complete map folder:
Command line: EasyMap.exe open "filename.empx" print "" close ""
Command: /?
Output the command line help:
Command line: EasyMap.exe /?
Command: Open "File name;[Show];[Document name]"
Parameters:
Filename | Path to map folder (filename.empx) |
show |
(optional) 1=Program window is visible (default) 0=Program window is not visible |
document name | (optional) The document name is used in the following commands to identify the map folder. If this parameter is empty, the last opened map folder is used. |
Example:
Open the map folder invisibly and set the document name to "Doc1":
Command line: EasyMap.exe open "Dateiname.empx;0;Doc1"
Prints the complete workbook, or parts of it, to the current default printer:
Command: Print "[Sheet|Print Range Name|Report Name];[Document Name]"
Parameters:
Sheet/Print area name/Report name | (optional) Name of the sheet or print area (or report) to be printed. If this parameter is empty, all sheets are printed. |
document name | (optional) Name of the map folder. If this parameter is empty, the last opened map folder is used. |
You can only use the Document name parameter if you have opened the map folder using the Open command from the remote control via command line and have assigned a document name for the map folder there.
Example:
"Print "Print area 2" in the "Doc1" map folder:
Command line: EasyMap.exe print "Print area 2;Doc1"
Exports a sheet or a print area as a graphic. The graphic format is automatically determined by the file extension:
Command: Export "File name; Sheet|Print area name| Report name;[Image height];[Document name]"
Parameters:
Filename | File name of the graphic. The following graphic formats are supported: PNG, JPG, BMP, TIF, EMF, PDF |
Sheet/Print area name/ Report name | Name of the sheet, print area, or report to be exported. |
image height | (optional) Height of the image in pixels. The width of the image is determined automatically. If this parameter is empty, the image height is determined automatically (72 DPI). |
document name | (optional) Name of the map folder. If this parameter is empty, the last opened map folder is used. |
You can only use the Document name parameter if you have opened the map folder using the Open command from the remote control via command line and have assigned a document name for the map folder there.
Example:
"Export "Sheet 1" with an image height of 2048 pixels as PNG:
Command line: EasyMap.exe export "Sheet 1;2048"
Exports a sheet, the entire map folder or a report as an Office document. The format is determined automatically by the file extension. The other export settings depend on the settings last used in this map folder.
command: export document "File name; [sheet|report name]; [show]; [document name]"
Parameters:
Filename | File name of the Office document. The following formats are supported: DOC, PPT |
Sheet/Report name | Name of the sheet or report that is to be exported. If this parameter is empty, the entire map folder is exported. |
show | (optional) "Show" causes the subsequent opening of the export in the corresponding application. |
document name | (optional) Name of the map folder. If this parameter is empty, the last opened map folder is used. |
You can only use the Document name parameter if you have opened the map folder using the Open command from the remote control via command line and have assigned a document name for the map folder there.
Example:
"Export "Report 1" to a PowerPoint presentation and then show it:
Command line: EasyMap.exe export document "C:\Rep1.ppt;Report 1;Show"
Export the entire workbook to Word and then show it:
command line: EasyMap.exe exportdocument "C:\Karte.doc;;Show"
Exports data of a table or a query to a file. CSV and XLS/XLSX file formats are supported.
Command line: exportdata "filename; Tablename|Viewname;[DocumentName]"
Parameters:
Filename | File name of the data export. |
Tablename/Viewname | Name of the table or query to be exported. |
document name | (optional) Name of the map folder. If this parameter is empty, the last opened map folder is used. |
Replaces the text in the specified freehand text:
Command: SetText "Freehandtext;Text;[Document name]"
Parameters:
freehand text | Name of the freehand text element. Please make sure that the name of the element is unique. |
Text | Any text. "\n" creates a line break. |
document name | (optional) Name of the map folder. If this parameter is empty, the last opened map folder is used. |
You can only use the Document name parameter if you have opened the map folder using the Open command from the remote control via command line and have assigned a document name for the map folder there.
Example:
Set text to freehand text "Heading 1":
Command line: EasyMap.exe settext "Headline 1;Example 1:"
Allows you to show or hide objects:
Command: SetVisible "Object name;[true|false];[Document name]"
Parameters:
object name | Name of the object. Please make sure that the name of the object is unique. |
[true|false] |
true=Show object false=Hide object |
document name | (optional) Name of the map folder. If this parameter is empty, the last opened map folder is used. |
You can only use the Document name parameter if you have opened the map folder using the Open command from the remote control via command line and have assigned a document name for the map folder there.
Example:
"Color legend 1" invisible:
Command line: EasyMap.exe setvisible "Color legend 1;false"
Loads a classification from an XML file that was previously saved in the analysis settings dialog. Please make sure that the analysis properties are set to Custom so that the analysis is performed correctly.
Command: SetClassification "Analysis Name;Classification; Configuration File;[DocumentName] "
Parameters:
Analysis Name | Name of the analysis (e.g. area coloring 1). Please make sure that the name of the element is unique. |
Classification | Number of the classification. Corresponds to the order of the tabs in the settings dialog of the analysis. |
configuration file | Path to a saved XML file. |
document name | (optional) Name of the map folder. If this parameter is empty, the last opened map folder is used. |
You can only use the Document name parameter if you have opened the map folder using the Open command from the remote control via command line and have assigned a document name for the map folder there.
Example:
Command line: EasyMap.exe setclassification "Area coloring 1; 0;classification.xml"
Saves a map folder under the specified file name:
Command: Save "File name;[Document name]"
Parameters:
Filename | New file name of the map folder (file name.empx) |
document name | (optional) Name of the map folder. If this parameter is empty, the last opened map folder is used. |
You can only use the Document name parameter if you have opened the map folder using the Open command from the remote control via command line and have assigned a document name for the map folder there.
Example:
Save the current map folder under a new file name:
Command line: EasyMap.exe save "file_new.empx"
... all changes are discarded - if no further map folders are opened, the program is closed.
Command: Close "[Document name]"
Parameters:
document name | (optional) Name of the map folder. If this parameter is empty, the last opened map folder is used. |
You can only use the Document name parameter if you have opened the map folder using the Open command from the remote control via command line and have assigned a document name for the map folder there.
Example:
Close current map folder:
Command line: EasyMap.exe close ""
Enables you to create a workbook for the easymap explorer to release.
Command: Publish "[ID of card folder]" /instance:update /publishserver:"<Server name>" /publishusername:"<Username>" /publishpassword:"<Password>"
Parameters:
ID of the workbook | ID of the workbook to be replaced. This ID can be determined via the address when viewing the map in the browser. |
/instance:update | Specifies that an existing map folder is to be replaced. |
/publish server:"<Server name>" | Specifies the server on which the map folder is to be uploaded. |
/publishusername:"<Username>" | Defines the user name under whose authorization the release is to take place. |
/publishpassword:"<Passwort>" | Specifies the password associated with the user. |
For automated sharing, you can combine this command with the Open and Close commands.
Example:
A map folder is available on the portal at the address
https://easymap-xplorer.de/Catalog/4acbf219-ae91-4f7e-a122-2e5136323af6
is displayed. It is to be replaced. This action is to be performed under the login of a user with the e-mail benutzer@email.de and the password 123.
command line: Easymap.exe /batch /instance:update /publishserver: "https://easymap-xplorer.de" /publishusername: "benutzer@email.de" /publishpassword: "123" open "c:\easymap\Interessibles.empx;0" publish "4acbf219-ae91-4f7e-a122-2e5136323af6" close ""
Open map folder, set freehand text, export, close map folder:
Command line: EasyMap.exe open "mapfile.empx;0" settext "heading 1;example 2:" export "mapfile.empx;sheet 1;1024" close ""
Export sheet 1 from all map folders in the current directory (batch file):
FOR %%f IN (*.empx) DO start /Warte EasyMap.exe open "%%f;0" export "%%%f.png;Blatt 1" close ""