More actions
Nguyenduyan (talk | contribs) Created page with "{{CGscriptClass_Template |Name=<nowiki>ReportTemplate</nowiki> |Description=<nowiki>A report template</nowiki> |Constructors= {{CGscriptConstructors_Template|Parameters= {{CGs..." |
Nguyenduyan (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
{{CGscriptClass_Template | {{CGscriptClass_Template | ||
|Name= | |Name=ReportTemplate | ||
|Description= | |Description=A report template | ||
|Constructors= | |Constructors= | ||
{{CGscriptConstructors_Template|Parameters= | {{CGscriptConstructors_Template|Parameters= | ||
{{CGscriptParameters_Template|Type=int|Name= | {{CGscriptParameters_Template|Type=int|Name=resourceId|Description=ResourceId of existing template}} | ||
|Description= | |Description=Fetch existing template}} | ||
{{CGscriptConstructors_Template|Parameters= | {{CGscriptConstructors_Template|Parameters= | ||
{{CGscriptParameters_Template|Type=string|Name= | {{CGscriptParameters_Template|Type=string|Name=name|Description=Resource name|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=parentResourceId|Description=Parent resource}} | ||
|Description= | |Description=Create new template}} | ||
|Methods= | |Methods= | ||
{{CGscriptMethods_Template|ReturnType=Empty|Name= | {{CGscriptMethods_Template|ReturnType=Empty|Name=DefaultLanguage|Parameters= | ||
{{CGscriptParameters_Template|Type=string|Name= | {{CGscriptParameters_Template|Type=string|Name=isocode|Description=Iso code to set as default}} | ||
|Description= | |Description=Which content is the default}} | ||
{{CGscriptMethods_Template|ReturnType=Empty|Name= | {{CGscriptMethods_Template|ReturnType=Empty|Name=Save|Description=Save the template}} | ||
{{CGscriptMethods_Template|ReturnType=string|Name= | {{CGscriptMethods_Template|ReturnType=string|Name=ToString|Description=The string representation of the object.}} | ||
|Properties= | |Properties= | ||
{{CGscriptProperties_Template|ReturnType=Dictionary|Name= | {{CGscriptProperties_Template|ReturnType=Dictionary|Name=LocalizedContent|HasGetter=1|HasSetter=1|Description=Localized content of the template}} | ||
{{CGscriptProperties_Template|ReturnType=string|Name= | {{CGscriptProperties_Template|ReturnType=string|Name=Name|HasGetter=1|Description=Name of the template}} | ||
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name= | {{CGscriptProperties_Template|ReturnType=string|Name=ObjectTypeName|HasGetter=1|Description=The name of the type of object.}} | ||
{{CGscriptProperties_Template|ReturnType=string|Name= | {{CGscriptProperties_Template|ReturnType=int|Name=ResourceId|HasGetter=1|Description=Resource Id of the template}} | ||
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}} | |||
{{CGscriptProperties_Template|ReturnType=string|Name=ViewUrl|HasGetter=1|Description=Url to use to view template}} | |||
}} | }} | ||
=== <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> |
Revision as of 05:03, 7 December 2016
ReportTemplate
A report template
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
- 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
- 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