Difference between revisions of "ExportManager class"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "{{CGscriptClass_Template |Name=ExportManager |Description=Export data and users. |Constructors= {{CGscriptConstructors_Template|Parameters= {{CGscriptParameters_Template|Type=...")
 
(Tag: visualeditor-switched)
Line 48: Line 48:
 
{{CGscriptProperties_Template|ReturnType=string|Name=UnicodeCodePage|HasGetter=1|HasSetter=1|Description=Get/set the codepage used in the files}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=UnicodeCodePage|HasGetter=1|HasSetter=1|Description=Get/set the codepage used in the files}}
 
}}
 
}}
 +
 +
=== <span style="color:#DF8621">'''Examples'''</span> ===
 +
<source lang="javascript">
 +
//get an existing export
 +
number ExportRId = ;
 +
ExportManger EM = new ExportManger(ExportRId);
 +
ExportSettingsExcelCsvFile exportSetting = EM.ExportSettingsExcelCsvFile;
 +
exportSetting.Clear();
 +
number questionnaireResourceId = ;
 +
string questionLabel = "";
 +
bool presentAsText = false;
 +
bool exportToCsv = true;
 +
bool exportToExcel = false;
 +
exportSetting.AddAllQuestions(questionnaireResourceId, questionLabel, presentAsText, exportToCsv, exportToExcel );
 +
exportSetting.ExcelFileOptionsUseCommaSeparatedFormat = true;
 +
EM.Save();
 +
EM.Export();
 +
</source>

Revision as of 10:09, 16 May 2017

ExportManager



Export data and users.

Constructors

  • (int ResourceId "Resource Id of the Export") - Instanciate an existing instance using the resource id of an export
  • (string ResourceName "Resource name of the new export", int parentResourceId "Parent to store the DCS export under") - Create a new export

Methods

  • bool AddQuestionnaire(int questionnaireResourceId "Resource id of the questionnaire to export data from") - Add questionnaire to export data from. Return false if already added
  • string Export() - Run the export. Implicitly commits the current transaction
  • Empty Reset() - Remove all questionnaires from the export and clear all format settings
  • Empty Save() - Save the DataCache
  • string ToString() - The string representation of the object.

Properties

  • DateTime CGEndTimeFrameUTC { get; set; } - Get/set the maximum end time of QAS
  • DateTime CGStartTimeFrameUTC { get; set; } - Get/set the minimum end time of QAS
  • ExportSettingsAsciiFile ExportSettingsAsciiFile { get; } - Get settings for specific format
  • ExportSettingsExcelCsvFile ExportSettingsExcelCsvFile { get; } - Get settings for specific format
  • ExportSettingsInspireFile ExportSettingsInspireSasTraceFile { get; } - Get settings for specific format
  • ExportSettingsNipoFile ExportSettingsNipoFile { get; } - Get settings for specific format
  • ExportSettingsSpssFile ExportSettingsSpssFile { get; } - Get settings for specific format
  • ExportSettingsTripleSFile ExportSettingsTripleSFile { get; } - Get settings for specific format
  • bool IncludedDeletedUsers { get; set; } - Get/set if include QAS on deleted users or not
  • bool IncludedDisabledUsers { get; set; } - Get/set if include QAS on disabled users or not
  • bool IncludedTestData { get; set; } - Get/set if include test QAS or not
  • string Language { get; set; } - Get/set the language used when exporting text
  • int LimitToGroupResourceId { get; set; } - Get/set the group that limits the people included in the export
  • string Name { get; set; } - Get/set the name of the export
  • string ObjectTypeName { get; } - The name of the type of object.
  • bool QasCompleted { get; set; } - Get/set if include Completed QAS or not
  • bool QasInterviewFailed { get; set; } - Get/set if include QAS with interview failed status or not
  • bool QasInterviewSucceded { get; set; } - Get/set if include QAS with interview successed status or not
  • bool QasNormal { get; set; } - Get/set if include QAS with normal status or not
  • bool QasNotStarted { get; set; } - Get/set if include unstarted QAS or not
  • bool QasOutsideTarget { get; set; } - Get/set if include QAS with outside target status or not
  • bool QasPartly { get; set; } - Get/set if include partly Completed QAS or not
  • bool QasQuotaFull { get; set; } - Get/set if include QAS with quota full status or not
  • int ResourceId { get; } - Get the resource id of the export
  • array SecondaryQasMergeAvailableMethods { get; } - Get which methods are available for SecondaryQasMergeMethod
  • string SecondaryQasMergeMethod { get; set; } - Get/set which method to use to link together QAS from the secondary questionnaires to the primary, when there is more than 1
  • bool SelectTimeFrame { get; set; } - Get/set if CGStartTimeFrameUTC and CGEndTimeFrameUTC are used or not
  • TypeInformation TypeInformation { get; } - Get information about this class.
  • string UnicodeCodePage { get; set; } - Get/set the codepage used in the files


Examples

//get an existing export
number ExportRId = ;
ExportManger EM = new ExportManger(ExportRId);
ExportSettingsExcelCsvFile exportSetting = EM.ExportSettingsExcelCsvFile;
exportSetting.Clear();
number questionnaireResourceId = ;
string questionLabel = "";
bool presentAsText = false;
bool exportToCsv = true;
bool exportToExcel = false;
exportSetting.AddAllQuestions(questionnaireResourceId, questionLabel, presentAsText, exportToCsv, exportToExcel );
exportSetting.ExcelFileOptionsUseCommaSeparatedFormat = true;
EM.Save();
EM.Export();