sCfg | (String) Location for saving the configuration data. It is either:
"input:" - Selection from the list. Before saving the list of existing configurations is displayed. This allows to select existing file or create new.
- If the trend viewer runs in local panel on the server:
The configurations list is read from the folder defined after the "input:" text. The selected file will be saved there.. - If the trend viewer runs in the Web browser:
The configurations list is read from the temporary storage of the Web browser. The selected file is saved into this temporary storage. In this case the string defined after the "input:" text is ignored. Example: "input:#cfg:" , see Example1."file:" - File on the disk. The configuration data will be saved into the specified file, that is defined after the "file:" text.
- If the trend viewer runs in local panel on the server:
The file name is displayed including the complete file path.. - If the trend viewer runs in the Web browser:
This option currently is not functional for Web browsers. Example: "file:#cfg:config.tg" , see Example2."string:" - Text string. In this case, the parameter is of the input/output type and the output contains the specified configuration data - a XML formatted text.
The value "string:" is obsolete and it is better to use the GetCfg method. |
---|---|
nStyle | (Long) Specifies how the data have to be saved.
0 - Save always.
1 - If the file already exists, then a question is displayed whether the existing file to overwrite (if the answer is NO, then the configuration is not saved).
2 - If the file already exists, then the configuration is not saved. |
sFilter | (String) Specifies which of the viewer properties are saved into the configuration data.
The individual values can be concatenated. Example: "View;Trends;TimeMinMax;". "View;" - Save the viewer appearance apart the tvTrend objects and apart the time of the left and right edge of the viewer.
"Trends;" - Save only the configuration of tvTrend objects without data points
"TrendsNoConnect;" - Save only the configuration of tvTrend objects without data points and without parameters of the connection. The connection parameters are specified by the ConnectionType, ConnectionServer, ConnectionGroup and ConnectionItem properties of the tvTrend object. This option is suitable for generating the configuration file for printing. Note! If some of the following trend properties (for example tvTrend.Name, tvTrend.Unit, tvTrend.ValueMin, tvTrend.ValueMax or tvGraph.Color), contains the $default flag indicating reading the value from server), then the flag will be replaced by the real value that was read (cannot be read without the connection).
"TrendsData;" - Save only data points currently read by the viewer of the tvTrend object without the configuration of this object. This option is suitable for generating the configuration file for printing.
"TimeMinMax;" - Save the time of the left and right edge of the viewer.
"TimeZoom;" - Save only the time axis length of the viewer. |
var oTView = pMe.Items("../TrendView");
oTView.SaveCfg("input:#cfg:", 1, "Trends;");
var oTView = pMe.Items("../TrendView");
oTView.SaveCfg("file:#cfg:mycfg.tg", 0, "Trends;");