Exemplo n.º 1
0
        public ExportPage()
        {
            this.isCSV       = false;
            this.isEXCEL     = false;
            this.LogFileName = "";
            this._logger     = new Logging.Logging();

            this._extStorage = DependencyService.Get <IExtStorage>();

            int month       = DateTime.Now.Month;
            int year        = DateTime.Now.Year;
            int daysInMonth = DateTime.DaysInMonth(year, month);

            this.FromDate = new DateTime(year, month, 1);
            this.ToDate   = new DateTime(year, month, daysInMonth);

            InitializeComponent();

            this.BindingContext = this;
        }
Exemplo n.º 2
0
        public async void SaveExcelWoorkbook(string fileName)
        {
            IExtStorage extStorage = DependencyService.Get <IExtStorage>();

            if (!fileName.EndsWith(".xlsx"))
            {
                fileName += ".xlsx";
            }

            if (extStorage.CheckIfFileExists(fileName))
            {
                bool answer = await DisplayAlert("Überschreiben?", "Es existiert bereits" +
                                                 "eine Datei mit diesem Namen! Möchten Sie diese überschreiben?",
                                                 "Ja", "Nein");

                if (!answer)
                {
                    return;
                }
            }

            extStorage.SaveExcelWorkbook(this._wb, fileName);
        }