using GrapeCity.ActiveReports;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WinformFourReports.Reports;

namespace WinformFourReports
{
    public partial class Main : Form
    {
        public Main()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (this.comboBox2.SelectedIndex.ToString() =="0")
            {
                GrapeCity.ActiveReports.PageReport rpt = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(@"Reports\RDL报表.rdlx"));
                GrapeCity.ActiveReports.Document.PageDocument rptb = new GrapeCity.ActiveReports.Document.PageDocument(rpt);
                this.viewer1.LoadDocument(rptb);
            }
            if (this.comboBox2.SelectedIndex.ToString() == "1")
            {
                GrapeCity.ActiveReports.PageReport rpt = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(@"Reports\页面报表.rdlx"));
                GrapeCity.ActiveReports.Document.PageDocument rptb = new GrapeCity.ActiveReports.Document.PageDocument(rpt);
                this.viewer1.LoadDocument(rptb);
            }
            if (this.comboBox2.SelectedIndex.ToString() == "2")
            {
                GrapeCity.ActiveReports.SectionReport sectionReport = new GrapeCity.ActiveReports.SectionReport();
                System.Xml.XmlTextReader xtr = new System.Xml.XmlTextReader(@"Reports\区域报表.rpx");
                sectionReport.LoadLayout(xtr);
                xtr.Close();
                viewer1.LoadDocument(sectionReport);

            }
            if (this.comboBox2.SelectedIndex.ToString() == "3")
            {
                 SectionReport1  rpt= new SectionReport1();
                viewer1.LoadDocument(rpt);
            }
        }

        private void btnDataSet_Click(object sender, EventArgs e)
        {

        }

        private void Main_Load(object sender, EventArgs e)
        {

        }

        private void link_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("iexplore.exe", "https://www.cnblogs.com/arxive/p/5849672.html");
        }
    }
}
