sSrcHtm | (String) Entering an empty string "" means that the model is generated by the PROMOTIC system. |
---|---|
sDstHtm | (String) Location for saving the HTML page. It is either:
- string in the variable (String) - In this case the parameter is of the input/output type (the input is "string:") and after calling the method it contains the content of the HTML page.
- string in the variable (String) - where "return:" is the keyword, then the method returns the content of the HTML page. (The method with this parameter is functional also in JavaScript panels.)
macro expression cannot be used for input, but the EvalMacro method can be called. |
sParams | (String) Additional parameters that define the way of creating the destination file. Entries are in the KeyVal format, for example "mode:graph;view:dlg;".
"mode:xxx;" (optional) - Specifies which page is used for displaying the data of the trend viewer
table (default) - page in the table form
graph - page in the graph form of 2-dimensional graph "graphcfg:xxx;" (optional) - Specifies what setting is used for the trend viewer in graphic form (the PmgTrendViewer object) in saved HTML page.
default (default) - All settings of the viewer in the saved HTML page will be default (except for time from-to).
copy - All settings of the viewer in the saved HTML page will be taken from the viewer, that was called SaveToHtm method. "view:xxx;" (optional) - Specifies whether and how the generated page has to be displayed
no (default) - is not displayed
dlg - generated page is displayed in the window with preset size "text_xxx:yyy;" (optional) - Template (referred in the sSrcHtm parameter) contains several predefined keywords that allow to enter the designer text, which appears in the final page (referred in the sDstHtm parameter) instead of the keyword, see the description of values.
text_title - Value of the title keyword from the template (sSrcHtm) will be replaced by the string yyy.
Example: text_title:BoilerPlant 5; text_note1 - Value of the note1 keyword from the template (sSrcHst) will be replaced by the string yyy.
text_note2 - Value of the note2 keyword from the template (sSrcHst) will be replaced by the string yyy.
text_codeinit - Value of the codeinit keyword from the template (sSrcHst) will be replaced by the string yyy.
The string yyy is an initialization code in the JavaScript language that is run during reading the page. If a character ; (semicolon) occurs in the yyy string, then it is necessary to set text_codeinit:$Par:0; and the initialization code itself has to be set in the sParText parameter, see Example3. The oT reference used in the example is the reference to the PmgTrendViewer trends viewer and his name must be kept. text_userYY - Except the predefined keywords it is possible to edit the copy of the template (copied from the original template from the PROMOTIC Web folder, see the description of the sSrcHst parameter) and to add next keywords in it and to define the string for replacement in the parameter. For example, if there is the userkey keyword in the HTML template, then the parameter is:
text_userkey:text for displaying; |
sParText | [optional] (String) Text for replacing the codeinit keyword from the template. See the description of the sParams parameter, the codeinit value. |
var oTView = pMe.Items("../TrendView");
var sHtml = oTView.SaveToHtm("", "return;", "mode:graph;");
if (sHtml != "")
{
Pm.PrintHtmlPage(sHtml, "sourcetype:textstring;printer:default;width:700px;height:930px;");
}
var oTView = pMe.Items("../TrendView");
var sHtml = oTView.SaveToHtm("", "return;", "mode:graph;text_title:Factory station;text_note1:Ironware district;text_note2:Page created by John Weiss;");
if (sHtml != "")
{
Pm.PrintHtmlPage(sHtml, "sourcetype:textstring;printer:default;width:700px;height:930px;");
}
var oTView = pMe.Items("../TrendView");
var sParCode = "oT.ScaleValue.MinorTicksNum=4; oT.Draw();";
oTView.SaveToHtm("", "return;", "mode:graph;view:dlg;text_codeinit:$Par:0;", sParCode);