FastReport icon indicating copy to clipboard operation
FastReport copied to clipboard

Did FR Open Source have Report-Viewer (Preview) component? or just show images for each page?

Open matanyacohen opened this issue 3 years ago • 0 comments

I digging in demo folder, like WinFormsOpenSourceViewer. I supposed to find code use with some 'Report Viewer' component.
instead, I find export to image, and brows between images. See code bellow.

My questions is:

  1. FastReport not have Report Viewer?
  2. Export Pdf is Text? or just image of pages sit in PDF?

Thenks

private void toolStripOpnBtn_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog dialog = new OpenFileDialog())
            {
                dialog.Filter = "Prapared reprt(*.fpx)|*.fpx";
                dialog.Multiselect = false;
                if (dialog.ShowDialog() == DialogResult.OK)
                {                   
                    Report.LoadPrepared(dialog.FileName);
                    ReportExport();
                    ShowReport();
                }
            }
        }

        public void ReportExport()
        {
            DeleteTempFiles();
                exp.ImageFormat = ImageExportFormat.Png; //Устанавливаем для изображения формат png
                exp.Export(Report, Directory.GetCurrentDirectory() + "/" + System.Guid.NewGuid() + ".png"); //Выполняем экспорт отчета в файл
                foreach (string fileName in exp.GeneratedFiles)
                {
                    using (var img = File.OpenRead(fileName))
                    {
                        pages.Add(Image.FromStream(img));
                    }
                }
                CurrentPage = 0;
        }

matanyacohen avatar Jul 25 '22 20:07 matanyacohen