ExportManager class

From Catglobe Wiki
Jump to: navigation, search

ExportManager



Export data and users.

Parent class

Inherits from object

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
  • (From object) 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
  • string Culture { get; set; } - Get/set the language used when exporting text
  • 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
  • (From object) 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 = ;
ExportManager EM = new ExportManager(ExportRId);
ExportSettingsExcelCsvFile exportSetting = EM.ExportSettingsExcelCsvFile;
exportSetting.Clear();
number questionnaireResourceId = ;
string questionLabel = "";
bool presentAsText = false;
bool exportToCsv = true;
bool exportToExcel = false;
exportSetting.AddQuestion(questionnaireResourceId, questionLabel, presentAsText, exportToCsv, exportToExcel );
exportSetting.ExcelFileOptionsUseCommaSeparatedFormat = true;
exportSetting.ExportAddressInformation= false;
exportSetting.ExportPhoneNumbers = false;
exportSetting.ExportUserAccountInformation = false;
exportSetting.ExportUserEmail = false;
EM.Save();
//EM.Export();
//create new export job
string ResourceName="Test - export";
number qnaire = 15638322;
ExportManager EM= new ExportManager (ResourceName, qnaire );
EM.AddQuestionnaire(qnaire);
ExportSettingsExcelCsvFile exportSetting = EM.ExportSettingsExcelCsvFile;
number questionnaireResourceId = qnaire;
bool presentAsText = false;
bool exportToCsv = false;
bool exportToExcel = true;
exportSetting.AddAllQuestions(questionnaireResourceId, presentAsText, exportToCsv, exportToExcel );
exportSetting.ExcelFileOptionsUseCommaSeparatedFormat = true;
EM.Language ="da-DK";
EM.Culture = "da-DK";
exportSetting.ExportAddressInformation= false;
exportSetting.ExportPhoneNumbers = false;
exportSetting.ExportUserAccountInformation = true;
exportSetting.ExportUserEmail = true;
EM.QasNotStarted = false;
EM.QasPartly = false;
EM.QasCompleted = true;
EM.QasNormal = true;
EM.QasQuotaFull = false;
EM.QasOutsideTarget = false;
EM.QasInterviewFailed = false;
EM.QasInterviewSucceded = true;
EM.IncludedTestData= false;
EM.IncludedDeletedUsers = true;
EM.IncludedDisabledUsers = true;
EM.Save();
EM.Export();