private void ReportWorkerRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (currentGenerationContext != null && currentGenerationContext.EndGeneration != null)
            {
                currentGenerationContext.EndGeneration();
            }

            var fileName = currentGenerationContext.ReportFileName;

            currentGenerationContext = null;
            generationForm.Hide();
            Process.Start(fileName);
        }
        public void StartGeneration(ReportGenerationContext context)
        {
            if (reportWorker.IsBusy)
            {
                return;
            }

            var fileName = OpenFileSelection();

            if (!string.IsNullOrEmpty(fileName))
            {
                context.ReportFileName = fileName;
                generationForm.Show();
                currentGenerationContext = context;
                reportWorker.RunWorkerAsync();
            }
            else
            {
                if (context.EndGeneration != null)
                {
                    context.EndGeneration();
                }
            }
        }