using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
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 Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
                            
        private void button1_Click(object sender, EventArgs e)
        {
            if (this.comboBox1.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.comboBox1.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.comboBox1.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.comboBox1.SelectedIndex.ToString() == "3")
            {
                SectionReport1 rpt = new SectionReport1();
                viewer1.LoadDocument(rpt);
            }

        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            linkLabel1.LinkVisited = true;
            Process.Start("IExplore", "https://www.grapecity.com.cn/solutions/library");
        }

        private void linkLabel2_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e)
        {
            linkLabel2.LinkVisited = true;
            Process.Start("IExplore", "https://demo.grapecity.com.cn/activereports/aspnet/controlexplorer/");
        }
        private void linkLabel3_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e)
        {
            linkLabel3.LinkVisited = true;
            Process.Start("IExplore", "https://www.grapecity.com.cn/developer/activereports");
        }
        private void linkLabel4_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e)
        {
            linkLabel4.LinkVisited = true;
            Process.Start("IExplore", "https://www.grapecity.com.cn/blogs/categories/activereports");
        }

        private void linkLabel5_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e)
        {
            linkLabel5.LinkVisited = true;
            Process.Start("IExplore", "https://gcdn.grapecity.com.cn/forum.php?mod=forumdisplay&fid=152");
        }

        
    }
}
