Пример #1
0
        RibbonListItem AppendListItem(RibbonItemCollection ribbonItems, int num, string path)
        {
            var rli = new C1.Win.Ribbon.RibbonListItem();

            var sb = new StringBuilder();

            if (num < 10)
            {
                sb.Append('&').Append(num).Append("  ");
            }
            else
            {
                sb.Append(num).Append(' ');
            }
            sb.Append(Path.GetFileNameWithoutExtension(path));
            rli.Items.Add(new RibbonLabel(sb.ToString()));

            var delButton = new C1.Win.Ribbon.RibbonButton();

            if (num < 10)
            {
                delButton.KeyTip = "Y" + num.ToString();
            }
            delButton.SelectableInListItem = true;
            delButton.SmallImage           = Properties.Resources.Delete16x16;
            delButton.ToolTip = "Remove from list";
            delButton.Click  += new System.EventHandler(this.DelButton_Click);
            rli.Items.Add(delButton);

            ribbonItems.Add(rli);

            rli.ToolTip = path;
            rli.Click  += RibbonListItem_Click;
            return(rli);
        }
Пример #2
0
        public FlexSsrsViewer()
        {
            InitializeComponent();
            C1Zoom.Target = null;

            var selReportLabel = new C1.Win.Ribbon.RibbonButton();

            c1FlexViewer1.Ribbon.QatItemsHolder.Add(selReportLabel);
            c1FlexViewer1.Ribbon.Qat.ItemLinks.Add(selReportLabel);
            selReportLabel.Text   = "Select Report:";
            selReportLabel.Click += selReportLabel_Click;

            comboReports = new RibbonComboBox();
            comboReports.GripHandleVisible     = true;
            comboReports.TextAreaWidth         = 170;
            comboReports.MaxDropDownItems      = 12;
            comboReports.DropDownStyle         = RibbonComboBoxStyle.DropDownList;
            comboReports.SelectedIndexChanged += comboReports_SelectedIndexChanged;

            var coll = comboReports.Items;

            coll.Add(new RibbonButton("Company Sales"));
            coll.Add(new RibbonButton("Customers Near Stores"));
            coll.Add(new RibbonButton("Employee Sales Summary"));
            coll.Add(new RibbonButton("Employee Sales Summary Detail"));
            coll.Add(new RibbonButton("Product Catalog"));
            coll.Add(new RibbonButton("Product Line Sales"));
            coll.Add(new RibbonButton("Sales by Region"));
            coll.Add(new RibbonButton("Sales Order Detail"));
            coll.Add(new RibbonButton("Store Contacts"));
            coll.Add(new RibbonButton("Territory Sales Drilldown"));

            c1FlexViewer1.Ribbon.QatItemsHolder.Add(comboReports);
            c1FlexViewer1.Ribbon.Qat.ItemLinks.Add(comboReports);

            ssrs            = new C1SSRSDocumentSource();
            ssrs.Credential = new System.Net.NetworkCredential("ssrs_demo", "bjqveS5gh89BH1Q", "");
        }
Пример #3
0
        public CommonReports()
        {
            InitializeComponent();
            C1Zoom.Target = null;

            // put C1TopicBur in the C1FlexViewer control
            tbReports.Parent = null;
            splitter1.Parent = null;

            var viewerControls = c1FlexViewer1.Controls;
            var c1             = viewerControls[0];
            var c2             = viewerControls[1];
            var c3             = viewerControls[2];

            viewerControls.Clear();

            viewerControls.Add(c1);
            viewerControls.Add(splitter1);
            viewerControls.Add(tbReports);
            viewerControls.Add(c2);
            viewerControls.Add(c3);

            // prepare the list of reports
            doc = new XmlDocument();
            doc.PreserveWhitespace = true;
            doc.LoadXml(ControlExplorer.Properties.Resources.FlexCommonTasks);

            // get the list of reports in the file
            string[] reports = C1FlexReport.GetReportList(doc);

            //
            // go over reports and get category from C1FlexReport.ReportInfo.Keywords
            using (C1FlexReport fr = new C1FlexReport())
            {
                foreach (string reportName in reports)
                {
                    fr.Load(doc, reportName);

                    string   keywords = fr.ReportInfo.Keywords;
                    string[] ss       = keywords.Split(new string[] { "\r\n" }, StringSplitOptions.None);
                    for (int i = 0; i < ss.Length; i++)
                    {
                        List <string> reps;
                        if (!categories.TryGetValue(ss[i], out reps))
                        {
                            reps = new List <string>();
                            categories.Add(ss[i], reps);
                        }
                        reps.Add(reportName);
                    }
                }

                // now categories dictionary contains list of categories and list of the reports in the each category
                // build content of the C1TopicBar
                foreach (KeyValuePair <string, List <string> > kvp in categories)
                {
                    C1TopicPage tp = new C1TopicPage(kvp.Key);
                    tp.ImageIndex = 0;
                    tp.ImageList  = imageList1;
                    foreach (string s in kvp.Value)
                    {
                        C1TopicLink tl = new C1TopicLink(s);
                        tp.Links.Add(tl);
                    }
                    tbReports.Pages.Add(tp);
                }
            }

            // add list of the reports to the ribbon

            var ribbon = c1FlexViewer1.Ribbon;

            tbMoreReports                 = new RibbonToggleButton();
            tbMoreReports.Pressed         = true;
            tbMoreReports.SmallImage      = ControlExplorer.Properties.Resources.MoreReports;
            tbMoreReports.Text            = "Reports panel";
            tbMoreReports.PressedChanged += MoreReports_PressedChanged;

            ribbon.QatItemsHolder.Insert(0, tbMoreReports);
            ribbon.Qat.Items.Insert(0, tbMoreReports);
            ribbon.Qat.MenuItems.Insert(0, tbMoreReports);

            comboReports = new RibbonComboBox();
            comboReports.GripHandleVisible     = true;
            comboReports.TextAreaWidth         = 170;
            comboReports.MaxDropDownItems      = 12;
            comboReports.DropDownStyle         = RibbonComboBoxStyle.DropDownList;
            comboReports.SelectedIndexChanged += comboReports_SelectedIndexChanged;

            var coll = comboReports.Items;

            foreach (string rn in reports)
            {
                coll.Add(new RibbonButton(rn));
            }

            ribbon.QatItemsHolder.Insert(0, comboReports);
            ribbon.Qat.ItemLinks.Insert(0, comboReports);

            var selReportLabel = new C1.Win.Ribbon.RibbonButton();

            ribbon.QatItemsHolder.Insert(0, selReportLabel);
            ribbon.Qat.ItemLinks.Insert(0, selReportLabel);
            selReportLabel.Text   = "Select Report:";
            selReportLabel.Click += selReportLabel_Click;

            report = new C1FlexReport();
        }