Difference between revisions of "ReportTemplate class"
Nguyenduyan (talk | contribs) (Created page with "{{CGscriptClass_Template |Name=<nowiki>ReportTemplate</nowiki> |Description=<nowiki>A report template</nowiki> |Constructors= {{CGscriptConstructors_Template|Parameters= {{CGs...") |
|||
(One intermediate revision by one other user not shown) | |||
Line 2: | Line 2: | ||
|Name=<nowiki>ReportTemplate</nowiki> | |Name=<nowiki>ReportTemplate</nowiki> | ||
|Description=<nowiki>A report template</nowiki> | |Description=<nowiki>A report template</nowiki> | ||
− | |Constructors= | + | |InheritsFrom=object|Constructors= |
{{CGscriptConstructors_Template|Parameters= | {{CGscriptConstructors_Template|Parameters= | ||
{{CGscriptParameters_Template|Type=int|Name=<nowiki>resourceId</nowiki>|Description=<nowiki>ResourceId of existing template</nowiki>}} | {{CGscriptParameters_Template|Type=int|Name=<nowiki>resourceId</nowiki>|Description=<nowiki>ResourceId of existing template</nowiki>}} | ||
Line 14: | Line 14: | ||
|Description=<nowiki>Which content is the default</nowiki>}} | |Description=<nowiki>Which content is the default</nowiki>}} | ||
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>Save</nowiki>|Description=<nowiki>Save the template</nowiki>}} | {{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>Save</nowiki>|Description=<nowiki>Save the template</nowiki>}} | ||
− | {{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}} | + | {{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}} |
|Properties= | |Properties= | ||
{{CGscriptProperties_Template|ReturnType=Dictionary|Name=<nowiki>LocalizedContent</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Localized content of the template</nowiki>}} | {{CGscriptProperties_Template|ReturnType=Dictionary|Name=<nowiki>LocalizedContent</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Localized content of the template</nowiki>}} | ||
+ | {{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>Name</nowiki>|HasGetter=1|Description=<nowiki>Name of the template</nowiki>}} | ||
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}} | {{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}} | ||
− | {{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Description=<nowiki>Get information about this class.</nowiki>}} | + | {{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ResourceId</nowiki>|HasGetter=1|Description=<nowiki>Resource Id of the template</nowiki>}} |
+ | {{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}} | ||
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ViewUrl</nowiki>|HasGetter=1|Description=<nowiki>Url to use to view template</nowiki>}} | {{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ViewUrl</nowiki>|HasGetter=1|Description=<nowiki>Url to use to view template</nowiki>}} | ||
}} | }} | ||
+ | |||
+ | === <span style="color:#DF8621">'''Examples'''</span> === | ||
+ | |||
+ | <source lang="javascript"> | ||
+ | //Create new report template: | ||
+ | ReportTemplate rt = new ReportTemplate ("Antest1",11088827); | ||
+ | Dictionary content = { | ||
+ | "da-DK":"content in DK", | ||
+ | "en-US":"content in US" | ||
+ | }; | ||
+ | rt.LocalizedContent=content; | ||
+ | rt.DefaultLanguage("en-US"); | ||
+ | rt.Save(); | ||
+ | print(rt.ResourceId);//15550190 | ||
+ | </source> | ||
+ | |||
+ | <source lang="javascript"> | ||
+ | //Get an existing report template: | ||
+ | ReportTemplate rt = new ReportTemplate (15550190); | ||
+ | print(rt.ViewUrl);///CatglobeInABox/#Cross/15550190 | ||
+ | print(rt.ResourceId);//15550190 | ||
+ | print(rt.Name);//Antest1 | ||
+ | </source> |
Latest revision as of 08:44, 2 July 2020
ReportTemplate
A report template
Parent class
Inherits from object
Constructors
- (int resourceId "ResourceId of existing template") - Fetch existing template
- (string name "Resource name", int parentResourceId "Parent resource") - Create new template
Methods
- Empty DefaultLanguage(string isocode "Iso code to set as default") - Which content is the default
- Empty Save() - Save the template
- (From object) string ToString() - The string representation of the object.
Properties
- Dictionary LocalizedContent { get; set; } - Localized content of the template
- string Name { get; } - Name of the template
- string ObjectTypeName { get; } - The name of the type of object.
- int ResourceId { get; } - Resource Id of the template
- (From object) TypeInformation TypeInformation { get; } - Get information about this class.
- string ViewUrl { get; } - Url to use to view template
Examples
//Create new report template:
ReportTemplate rt = new ReportTemplate ("Antest1",11088827);
Dictionary content = {
"da-DK":"content in DK",
"en-US":"content in US"
};
rt.LocalizedContent=content;
rt.DefaultLanguage("en-US");
rt.Save();
print(rt.ResourceId);//15550190
//Get an existing report template:
ReportTemplate rt = new ReportTemplate (15550190);
print(rt.ViewUrl);///CatglobeInABox/#Cross/15550190
print(rt.ResourceId);//15550190
print(rt.Name);//Antest1