Ejemplo n.º 1
0
        void Open(string file)
        {
            try
            {
                OutputReaderBase reader;
                switch (Path.GetExtension(file))
                {
                case ".xnc":
                case ".xnmc":
                case ".tsv":
                    reader = new TsvReader(file);
                    OpenReportNode(file, reader);
                    break;

                case ".bnc":
                    NextGenLab.Chart.Chart c = new NextGenLab.Chart.Chart();
                    c.MdiParent = this;
                    c.Open(file, false);
                    c.Show();
                    break;

                case ".bsdr":
                    reader = new ORBBinaryReader(file, true);
                    OpenReportNode(file, reader);
                    break;

                default:

                    if (guessFileFormat)
                    {
                        rerd = RegExReaderData.GuessFormat(file);
                    }

                    if (rerd != null)
                    {
                        reader = new ORBRegExReader(file, true, rerd);
                    }
                    else
                    {
                        reader = new ORBCsvReader(file, true);
                    }
                    OpenReportNode(file, reader);


                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Exception while opening file " + Path.GetFileName(file), MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }