Ejemplo n.º 1
0
        private void LoadExtraFields(Survey survey)
        {
            // load translation languages
            List <string> langs = DBAction.GetLanguages(survey);

            lstTransFields.Items.Clear();
            foreach (string s in langs)
            {
                lstTransFields.Items.Add(s);
            }
        }
Ejemplo n.º 2
0
        private void exportToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            // check which are checked
            bool q = questionToolStripMenuItem.Checked;
            bool t = translationsToolStripMenuItem1.Checked;

            SurveyReport sr = new SurveyReport();

            sr.AddSurvey(new ReportSurvey(CurrentSurvey.SurveyCode));
            sr.Surveys[0].AddQuestion(CurrentQuestion);
            if (t)
            {
                sr.Surveys[0].Questions[0].Translations.AddRange(DBAction.GetQuestionTranslations(sr.Surveys[0].Questions[0].ID));
                sr.Surveys[0].TransFields.AddRange(DBAction.GetLanguages(CurrentSurvey));
            }

            sr.FileName = "\\\\psychfile\\psych$\\psych-lab-gfong\\SMG\\Access\\Reports\\ISR\\" + "Survey Entry Export - " + DateTime.Today.ToString("d").Replace("-", "");
            sr.GenerateReport();

            sr.OutputReportTableXML();
            // TODO export items if each type is checked
        }
Ejemplo n.º 3
0
        private void RunWebReport(bool withTranslation = false)
        {
            string mode;
            bool   englishRouting;

            mode = SR.Surveys[0].Mode.ModeAbbrev;

            SR.QNInsertion = true;
            SR.LayoutOptions.FileFormat = FileFormats.PDF;
            SR.LayoutOptions.ToC        = TableOfContents.PageNums;
            SR.Web = true;
            SR.LayoutOptions.CoverPage = true;
            SR.VarChangesCol           = true;
            SR.ExcludeTempChanges      = true;
            SR.VarChangesApp           = true;
            SR.Details       = "";
            SR.ShowLongLists = true;

            switch (mode)
            {
            case "F2F":
            case "mail":
            case "semi-tel":
                SR.NrFormat = ReadOutOptions.DontReadOut;
                break;
            }

            if (withTranslation)
            {
                foreach (ReportSurvey rs in SR.Surveys)
                {
                    rs.TransFields = DBAction.GetLanguages(rs);
                }
            }

            // get the survey data for all chosen surveys
            PopulateSurveys();

            int          result;
            SurveyReport survReport = new SurveyReport(SR)
            {
                SurveyCompare = compare
            };

            // bind status label to survey report's status property
            lblStatus.DataBindings.Clear();
            lblStatus.DataBindings.Add(new Binding("Text", survReport, "ReportStatus"));

            result = survReport.GenerateReport();
            switch (result)
            {
            case 1:
                MessageBox.Show("One or more surveys contain no records.");
                // TODO if a backup was chosen, show a form for selecting a different survey code from that date
                break;

            default:
                break;
            }


            // output report to Word/PDF
            survReport.OutputReportTableXML();
        }
Ejemplo n.º 4
0
        private void RunStandardReport(bool withTranslation = false)
        {
            string mode;
            bool   englishRouting;

            mode = SR.Surveys[0].Mode.ModeAbbrev;
            if (SR.Surveys.Count == 1)
            {
                englishRouting = SR.Surveys[0].EnglishRouting;

                SR.Surveys[0].Qnum = true;
            }
            else
            {
                int primeID = 0;
                if (SR.Surveys.Count >= 3)
                {
                    primeID = 1;
                }
                else
                {
                    primeID = 2;
                }

                SR.SetPrimary(primeID);

                SR.Surveys[0].Qnum = true;

                SR.CompareWordings           = true;
                compare.ShowDeletedQuestions = true;
                compare.ShowDeletedFields    = true;
                compare.ReInsertDeletions    = true;
                compare.Highlight            = true;
            }

            if (withTranslation)
            {
                foreach (ReportSurvey rs in SR.Surveys)
                {
                    rs.TransFields = DBAction.GetLanguages(rs);
                }
            }

            switch (mode)
            {
            case "F2F":
            case "mail":
            case "semi-tel":
                SR.QNInsertion = true;
                SR.NrFormat    = ReadOutOptions.DontReadOut;
                break;

            case "CATI":
            case "web":
            case "tel":
            case "CAPI":
                SR.QNInsertion = false;
                SR.NrFormat    = ReadOutOptions.Neither;
                break;
            }

            SR.LayoutOptions.BlankColumn = true;
            SR.VarChangesCol             = true;
            SR.ExcludeTempChanges        = true;
            SR.Details = "";

            // get the survey data for all chosen surveys
            PopulateSurveys();

            int          result;
            SurveyReport survReport = new SurveyReport(SR)
            {
                SurveyCompare = compare
            };

            // bind status label to survey report's status property
            lblStatus.DataBindings.Clear();
            lblStatus.DataBindings.Add(new Binding("Text", survReport, "ReportStatus"));

            result = survReport.GenerateReport();
            switch (result)
            {
            case 1:
                MessageBox.Show("One or more surveys contain no records.");
                // TODO if a backup was chosen, show a form for selecting a different survey code from that date
                break;

            default:
                break;
            }


            // output report to Word/PDF
            survReport.OutputReportTableXML();
        }