|
|
@@ -48,13 +48,6 @@ namespace OTSIncAReportGrids
|
|
|
/// </summary>
|
|
|
public bool ParticleRange { set; get; }
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 表数据
|
|
|
- /// </summary>
|
|
|
- // List<DataTable> list_table_data = new List<DataTable>();
|
|
|
- //List<Point> list_table_size = new List<Point>();
|
|
|
- //List<Point> list_table_Point = new List<Point>();
|
|
|
- //List<string> list_fileName = new List<string>();
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
@@ -198,13 +191,11 @@ namespace OTSIncAReportGrids
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //list_table_data.Add(table_data);
|
|
|
+
|
|
|
gridView.Name = "gridView" + num.ToString();
|
|
|
dgv = gridView;
|
|
|
//设置grid风格
|
|
|
- //list_table_Point.Add(SetDataGridViewStyle(gridView));
|
|
|
SetDataGridViewStyle(gridView);
|
|
|
- //SetDataGridViewStyle(gridView);
|
|
|
panel1.Controls.Add(gridView);
|
|
|
}
|
|
|
|
|
|
@@ -220,9 +211,6 @@ namespace OTSIncAReportGrids
|
|
|
//用户不能调整 行高
|
|
|
gridView.AllowUserToResizeRows = false;
|
|
|
|
|
|
- //改变行的高度;
|
|
|
- //gridView.RowTemplate.Height = 20;
|
|
|
-
|
|
|
//点击选择整行
|
|
|
gridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
|
|
|
|
|
@@ -255,11 +243,10 @@ namespace OTSIncAReportGrids
|
|
|
gridView.ContextMenuStrip = this.contextMenuStrip1;
|
|
|
gridView.BorderStyle = 0;
|
|
|
|
|
|
- //int outpos = gridwidth;
|
|
|
gridView.Location = new System.Drawing.Point(0, gridheight);
|
|
|
gridView.Margin = new System.Windows.Forms.Padding(2);
|
|
|
gridView.MergeColumnHeaderBackColor = System.Drawing.SystemColors.ButtonHighlight;
|
|
|
- //gridView.Name = "Gview_gz";
|
|
|
+
|
|
|
gridView.ReadOnly = true;
|
|
|
gridView.RowHeadersVisible = false;
|
|
|
gridView.RowHeadersWidth = 40;
|
|
|
@@ -282,8 +269,6 @@ namespace OTSIncAReportGrids
|
|
|
//先设置一下头的高度,否则会太矮不好看
|
|
|
gridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
|
|
|
gridView.ColumnHeadersHeight = 40;
|
|
|
- //list_table_size.Add(new Point(gridView.ColumnCount * 100 , gridView.RowCount * 30));
|
|
|
- //return new Point(0, gridheight);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
@@ -329,9 +314,6 @@ namespace OTSIncAReportGrids
|
|
|
}
|
|
|
Report = false;
|
|
|
|
|
|
- //list_fileName.Clear();
|
|
|
-
|
|
|
-
|
|
|
if (sou.Contains("+"))
|
|
|
{
|
|
|
for (int i = 0; i < sou.Split('+').Length; i++)
|
|
|
@@ -340,8 +322,7 @@ namespace OTSIncAReportGrids
|
|
|
if (resultFile != null)
|
|
|
{
|
|
|
BindDataGridView(resultFile.FilePath, i, resultFile.anotherFileName, sel);
|
|
|
- //list_fileName.Add(resultFile.anotherFileName);
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -352,226 +333,13 @@ namespace OTSIncAReportGrids
|
|
|
if (sou == m_ReportApp.m_rstDataMgr.ResultFilesList[i].anotherFileName.ToString())
|
|
|
{
|
|
|
BindDataGridView(m_ReportApp.m_rstDataMgr.ResultFilesList[i].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[i].anotherFileName, sel);
|
|
|
- //list_fileName.Add(m_ReportApp.m_rstDataMgr.ResultFilesList[i].anotherFileName);
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
- //public void SetGraphicType(ReportCondition sourceGridData)
|
|
|
- //{
|
|
|
-
|
|
|
- // string stdId = "";
|
|
|
- // int stdIdIndex = 0;
|
|
|
- // //find the stdId condition
|
|
|
- // var STDIdItm = sourceGridData.ConditionItemList.Find(s => s.iItemId == OTS_REPORT_PROP_GRID_ITEMS.STD_ID);
|
|
|
- // if (STDIdItm != null)
|
|
|
- // {
|
|
|
- // stdId = STDIdItm.itemDisplayVal.ToString();
|
|
|
- // stdIdIndex = STDIdItm.comboDownList.IndexOf(stdId);
|
|
|
- // }
|
|
|
-
|
|
|
- // string stdId_TYPE = "";
|
|
|
- // int stdIdIndex_TYPE = 0;
|
|
|
- // //find the stdId condition
|
|
|
- // var STDIdItm_TYPE = sourceGridData.ConditionItemList.Find(s => s.iItemId == OTS_REPORT_PROP_GRID_ITEMS.GRAPHIC_TYPE);
|
|
|
- // if (STDIdItm_TYPE != null)
|
|
|
- // {
|
|
|
- // stdId_TYPE = STDIdItm_TYPE.itemDisplayVal.ToString();
|
|
|
- // stdIdIndex_TYPE = STDIdItm_TYPE.comboDownList.IndexOf(stdId);
|
|
|
- // }
|
|
|
- // int high = 0;
|
|
|
- // for (int i = 0; i < list_table_Point.Count; i++)
|
|
|
- // {
|
|
|
- // if (high < list_table_Point[i].Y)
|
|
|
- // {
|
|
|
- // high = list_table_Point[i].Y;
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // for (int i = 0; i < list_table_data.Count; i++)
|
|
|
- // {
|
|
|
- // Graphics(list_table_data[i], list_fileName[i], stdId_TYPE, list_table_size[i], list_table_Point[i], high);
|
|
|
- // Graphics_Stacking(list_table_data[i], stdId, list_table_size[i], list_table_Point[i], high+ list_table_size[i].Y);
|
|
|
- // }
|
|
|
-
|
|
|
- //}
|
|
|
-
|
|
|
- //private void Graphics(DataTable data, string filename, string comboBox1Text, Point a_size, Point a_Location, int location_hig)
|
|
|
- //{
|
|
|
- // ChartControl chartControl1 = new ChartControl();
|
|
|
- // chartControl1.Series.Clear();
|
|
|
-
|
|
|
- // // 假设你已经有一个 ChartControl 实例,并且已经添加了一个饼图 Series
|
|
|
- // Series series = new Series(filename, ViewType.Bar);
|
|
|
- // for (int a = 0; a < data.Rows.Count; a++)
|
|
|
- // {
|
|
|
- // string name = data.Rows[a]["TypeName"].ToString();
|
|
|
- // double Cunt = Convert.ToDouble(data.Rows[a]["ar"]);
|
|
|
- // series.Points.Add(new SeriesPoint(name, Cunt));
|
|
|
- // }
|
|
|
- // series.LabelsVisibility = DefaultBoolean.True;
|
|
|
- // chartControl1.Series.Add(series);
|
|
|
-
|
|
|
- // //图例的位置定义
|
|
|
- // chartControl1.Legend.AlignmentVertical = LegendAlignmentVertical.Top;
|
|
|
- // chartControl1.Legend.AlignmentHorizontal = LegendAlignmentHorizontal.RightOutside;
|
|
|
- // chartControl1.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False;
|
|
|
- // chartControl1.Legend.Direction = LegendDirection.TopToBottom;
|
|
|
-
|
|
|
- // //十字准线光标
|
|
|
- // chartControl1.CrosshairEnabled = DefaultBoolean.True;
|
|
|
- // chartControl1.CrosshairOptions.ShowValueLine = true;
|
|
|
- // chartControl1.CrosshairOptions.ShowArgumentLabels = true;
|
|
|
- // DevFunctions.ChangeView2(chartControl1, comboBox1Text);
|
|
|
- // chartControl1.Location = new Point(a_Location.X, location_hig);
|
|
|
- // chartControl1.Size = new Size(a_size.X, a_size.Y);
|
|
|
- // // 获取图表的坐标系(通常为 XYDiagram)
|
|
|
- // XYDiagram diagram = chartControl1.Diagram as XYDiagram;
|
|
|
-
|
|
|
- // if (diagram != null)
|
|
|
- // {
|
|
|
- // // 设置横坐标(X轴)名称
|
|
|
- // diagram.AxisX.Title.Text = "种类";
|
|
|
- // diagram.AxisX.Title.Visibility = DevExpress.Utils.DefaultBoolean.True; // 确保标题可见
|
|
|
-
|
|
|
- // // 设置纵坐标(Y轴)名称
|
|
|
- // diagram.AxisY.Title.Text = "面积";
|
|
|
- // diagram.AxisY.Title.Visibility = DevExpress.Utils.DefaultBoolean.True; // 确保标题可见
|
|
|
- // }
|
|
|
- // panel1.Controls.Add(chartControl1);
|
|
|
- //}
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// chart图创建
|
|
|
- /// </summary>
|
|
|
- /// <param name="dt"></param>
|
|
|
- /// <param name="stdId"></param>
|
|
|
- //private void Graphics_Stacking(DataTable dt, string stdId, Point a_size, Point a_Location, int location_hig)
|
|
|
- //{
|
|
|
- // ChartControl chartControl1 = new ChartControl();
|
|
|
- // chartControl1.Series.Clear();
|
|
|
-
|
|
|
- // chartControl1.Size = new Size(a_size.X, a_size.Y);
|
|
|
- // chartControl1.Location = new Point(a_Location.X, location_hig);
|
|
|
-
|
|
|
- // DataTable dataTable = new DataTable();
|
|
|
- // dataTable.Columns.Add("name");
|
|
|
- // dataTable.Columns.Add("size");
|
|
|
-
|
|
|
- // if (stdId != "All")
|
|
|
- // {
|
|
|
- // for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
- // {
|
|
|
- // if (dt.Rows[i]["TypeName"].ToString() == stdId)
|
|
|
- // {
|
|
|
- // for (int a = 3; a < dt.Columns.Count; a++)
|
|
|
- // {
|
|
|
- // DataRow dr = dataTable.NewRow();
|
|
|
- // dr["name"] = dt.Columns[a].ColumnName;
|
|
|
- // if (dt.Rows[i][a].ToString() == "")
|
|
|
- // {
|
|
|
- // dr["size"] = 0;
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // dr["size"] = Convert.ToDouble(dt.Rows[i][a]);
|
|
|
- // }
|
|
|
-
|
|
|
- // dataTable.Rows.Add(dr);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // if (stdId == "All")
|
|
|
- // {
|
|
|
- // List<Series> seriesList = new List<Series>();
|
|
|
-
|
|
|
- // DataTable data = new DataTable();
|
|
|
- // data.Columns.Add("name");
|
|
|
- // data.Columns.Add("range");
|
|
|
- // data.Columns.Add("num");
|
|
|
- // for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
- // {
|
|
|
- // for (int a = 3; a < dt.Columns.Count; a++)
|
|
|
- // {
|
|
|
- // DataRow dr = data.NewRow();
|
|
|
- // dr["name"] = dt.Rows[i]["TypeName"].ToString();
|
|
|
- // dr["range"] = dt.Columns[a].ColumnName;
|
|
|
- // if (dt.Rows[i][a].ToString() == "")
|
|
|
- // {
|
|
|
- // dr["num"] = 0;
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // dr["num"] = dt.Rows[i][a].ToString();
|
|
|
- // }
|
|
|
-
|
|
|
- // data.Rows.Add(dr);
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // foreach (DataRow dr in data.DefaultView.ToTable(true, "name").Rows)
|
|
|
- // {
|
|
|
- // Series s = new Series(dr["name"].ToString(), ViewType.StackedBar)
|
|
|
- // {
|
|
|
- // LegendTextPattern = dr["name"].ToString(),
|
|
|
- // ArgumentScaleType = ScaleType.Qualitative,
|
|
|
- // };
|
|
|
- // foreach (DataRow drl in data.Select("name='" + dr["name"].ToString() + "'"))
|
|
|
- // s.Points.Add(new SeriesPoint(drl["range"].ToString(), double.Parse(drl["num"].ToString())));
|
|
|
- // s.LabelsVisibility = DefaultBoolean.False;
|
|
|
- // seriesList.Add(s);
|
|
|
- // }
|
|
|
- // foreach (Series sr in seriesList.ToArray())
|
|
|
- // chartControl1.Series.Add(sr);
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // // 假设你已经有一个 ChartControl 实例,并且已经添加了一个饼图 Series
|
|
|
- // Series series = new Series(stdId, ViewType.Bar);
|
|
|
-
|
|
|
- // for (int a = 0; a < dataTable.Rows.Count; a++)
|
|
|
- // {
|
|
|
- // string name = dataTable.Rows[a]["name"].ToString();
|
|
|
- // double Cunt = Convert.ToDouble(dataTable.Rows[a]["size"]);
|
|
|
- // series.Points.Add(new SeriesPoint(name, Cunt));
|
|
|
- // }
|
|
|
- // series.LabelsVisibility = DefaultBoolean.True;
|
|
|
- // chartControl1.Series.Add(series);
|
|
|
-
|
|
|
-
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
- // ((XYDiagram)chartControl1.Diagram).AxisY.Title.Text = "";
|
|
|
- // ((XYDiagram)chartControl1.Diagram).AxisX.Title.Text = "";
|
|
|
- // ((XYDiagram)chartControl1.Diagram).AxisY.Title.Visibility = DefaultBoolean.True;
|
|
|
- // ((XYDiagram)chartControl1.Diagram).AxisX.Title.Visibility = DefaultBoolean.True;
|
|
|
- // ((XYDiagram)chartControl1.Diagram).AxisY.Title.Font = new Font("Tahoma", 9);
|
|
|
- // ((XYDiagram)chartControl1.Diagram).AxisX.Title.Font = new Font("Tahoma", 9);
|
|
|
- // ((XYDiagram)chartControl1.Diagram).AxisY.Title.Alignment = System.Drawing.StringAlignment.Far;
|
|
|
- // ((XYDiagram)chartControl1.Diagram).AxisX.Title.Alignment = System.Drawing.StringAlignment.Far;
|
|
|
-
|
|
|
- // //图例的位置定义
|
|
|
- // chartControl1.Legend.AlignmentVertical = LegendAlignmentVertical.Top;
|
|
|
- // chartControl1.Legend.AlignmentHorizontal = LegendAlignmentHorizontal.RightOutside;
|
|
|
- // chartControl1.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False;
|
|
|
- // chartControl1.Legend.Direction = LegendDirection.TopToBottom;
|
|
|
-
|
|
|
- // //十字准线光标
|
|
|
- // chartControl1.CrosshairEnabled = DefaultBoolean.True;
|
|
|
- // chartControl1.CrosshairOptions.ShowValueLine = true;
|
|
|
- // chartControl1.CrosshairOptions.ShowArgumentLabels = true;
|
|
|
-
|
|
|
-
|
|
|
- // panel1.Controls.Add(chartControl1);
|
|
|
- //}
|
|
|
#endregion
|
|
|
|
|
|
#region 相关事件
|
|
|
@@ -612,9 +380,6 @@ namespace OTSIncAReportGrids
|
|
|
Gview_gz.Rows.Clear();
|
|
|
Gview_gz.Columns.Clear();
|
|
|
|
|
|
- //BindDataGridView();
|
|
|
-
|
|
|
- //SetDataGridViewStyle();
|
|
|
}
|
|
|
private void Gview_gz_Sorted(object sender, EventArgs e)
|
|
|
{
|