Beispiel #1
0
        private void createReportToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            ListView.SelectedIndexCollection indexes = this.listViewHeap.SelectedIndices;

            int indexesCount = indexes.Count;

            if (indexesCount == 0) return;

            request RQuest = new request();
            Control[] ButtonControl = RQuest.Controls.Find("buttonCreateGrid", false);
            ButtonControl[0].Text = "Create Report";

            Control[] ButtonControl1 = RQuest.Controls.Find("label1", false);
            ButtonControl1[0].Text = "Zoom (%)";

            ButtonControl = RQuest.Controls.Find("numericUpDownGridSize", false);
            NumericUpDown TmpNum = (NumericUpDown)ButtonControl[0];
            TmpNum.Maximum = 100;
            TmpNum.Value = 100;

            ButtonControl = RQuest.Controls.Find("numericUpDownImPerLine", false);
            TmpNum = (NumericUpDown)ButtonControl[0];
            TmpNum.Visible = true;
            TmpNum.Maximum = TmpNum.Value = indexesCount;

            ButtonControl = RQuest.Controls.Find("label2", false);
            System.Windows.Forms.Label Tmplabel = (System.Windows.Forms.Label)ButtonControl[0];
            Tmplabel.Visible = true;

            if (RQuest.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            string sTime = DateTime.Now.ToString("yyyy-MM-dd mm-ss");
            ReportWriter rw = new ReportWriter(sTime);

            rw.create("HeapReport" + sTime + ".xml");
            rw.setInfo("Image Heap Report", "Report" + sTime, "", (int)TmpNum.Value, (int)RQuest.numericUpDownGridSizeValue);

            for (int i = 0; i < indexesCount; i++)
            {
                Image3D TmpIm = ((Image3D)(this.listViewHeap.Items[indexes[i]].Tag));

                rw.addThumbnailImage(TmpIm, "Index" + i, "Image " + i, UpdateInfoPicture(TmpIm));
            }

            rw.close();
            rw.openReport();
        }