|
|
@@ -1,5 +1,6 @@
|
|
|
using DevExpress.Utils;
|
|
|
using DevExpress.XtraCharts;
|
|
|
+using DevExpress.XtraRichEdit.Layout;
|
|
|
using DevExpress.XtraTreeList.Data;
|
|
|
using OTSCommon.DBOperate.Model;
|
|
|
using OTSIncAReportApp;
|
|
|
@@ -52,13 +53,17 @@ namespace OTSIncAReportGrids
|
|
|
List<int> list_gridheight = new List<int>();
|
|
|
|
|
|
int gridwidth = 0;
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region 多数据源
|
|
|
- /// <summary>
|
|
|
- /// 绑定datagridview数据
|
|
|
- /// </summary>
|
|
|
- public void BindDataGridView(string path, int num, string filename)
|
|
|
+ int GridPosition = 0;
|
|
|
+ int chartposition = 0;
|
|
|
+ int indexGraphicType = 0;
|
|
|
+ string GraphicType = "柱状图";
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 多数据源
|
|
|
+ /// <summary>
|
|
|
+ /// 绑定datagridview数据
|
|
|
+ /// </summary>
|
|
|
+ public void BindDataGridView(string path, int num, string filename,string GraphicType)
|
|
|
{
|
|
|
List<int> FLID = new List<int>() { 0, 1, 2, 4, 6, 7, 8, 9 };
|
|
|
List<string> NameList = new List<string>() { table["partcletype0"].ToString(), table["partcletype1"].ToString(), table["partcletype2"].ToString(), table["partcletype4"].ToString(), table["partcletype6"].ToString(), table["partcletype7"].ToString(), table["partcletype8"].ToString(), table["partcletype9"].ToString() };
|
|
|
@@ -266,43 +271,20 @@ namespace OTSIncAReportGrids
|
|
|
gridView.Rows[a1].Cells[4].Value = 0;
|
|
|
gridView.Rows[a1].Cells[4].Value = Convert.ToDouble(gridView.Rows[a1].Cells[4].Value) + Convert.ToDouble(gridView.Rows[j].Cells[4].Value);
|
|
|
}
|
|
|
- SetDataGridViewStyle(gridView);
|
|
|
+ int position= SetDataGridViewStyle(gridView);
|
|
|
panel1.Controls.Add(gridView);
|
|
|
|
|
|
- Panel panel = new Panel();
|
|
|
- panel.Size = new Size(gridwidth, 27);
|
|
|
- //panel.Dock = DockStyle.Top;
|
|
|
- panel.Location=new Point(0, list_gridheight.Max());
|
|
|
- panel.BackColor = Color.WhiteSmoke;
|
|
|
-
|
|
|
- ComboBox comboBox1 = new ComboBox();
|
|
|
- comboBox1.Items.Add("折线图");
|
|
|
- comboBox1.Items.Add("柱状图");
|
|
|
- comboBox1.Items.Add("饼图");
|
|
|
- comboBox1.Items.Add("圆环图");
|
|
|
- comboBox1.Items.Add("气泡图");
|
|
|
- comboBox1.Items.Add("簇状条形图");
|
|
|
- comboBox1.Items.Add("堆积条形图");
|
|
|
- comboBox1.Items.Add("瀑布图");
|
|
|
- comboBox1.Items.Add("3D柱状图");
|
|
|
- comboBox1.Items.Add("3D圆环图");
|
|
|
- comboBox1.Items.Add("3D饼图");
|
|
|
- comboBox1.Items.Add("3D折线图");
|
|
|
- comboBox1.Items.Add("3D百分比堆积条形图");
|
|
|
- comboBox1.Items.Add("3D漏斗图");
|
|
|
- comboBox1.Items.Add("3DManhattan 条形图");
|
|
|
- comboBox1.Items.Add("3D堆积条形图");
|
|
|
- comboBox1.Items.Add("3D阶梯线图");
|
|
|
- comboBox1.SelectedIndex = 1;
|
|
|
- comboBox1.Location = new Point( panel.Size.Width - comboBox1.Width-2,4);
|
|
|
- panel.Controls.Add(comboBox1);
|
|
|
- panel1.Controls.Add(panel);
|
|
|
+ // Panel panel = new Panel();
|
|
|
+ //panel.Size = new Size(gridwidth, 27);
|
|
|
+ ////panel.Dock = DockStyle.Top;
|
|
|
+ //panel.Location=new Point(0, list_gridheight.Max());
|
|
|
+ // panel.BackColor = Color.WhiteSmoke;
|
|
|
|
|
|
- Graphics(dt, filename, comboBox1.Text);
|
|
|
+ Graphics(dt, filename, GraphicType, position);
|
|
|
|
|
|
}
|
|
|
|
|
|
- private void Graphics(DataTable data,string filename,string comboBox1Text)
|
|
|
+ private void Graphics(DataTable data,string filename,string comboBox1Text,int pos)
|
|
|
{
|
|
|
ChartControl chartControl1 = new ChartControl();
|
|
|
chartControl1.Series.Clear();
|
|
|
@@ -329,15 +311,15 @@ namespace OTSIncAReportGrids
|
|
|
chartControl1.CrosshairOptions.ShowValueLine = true;
|
|
|
chartControl1.CrosshairOptions.ShowArgumentLabels = true;
|
|
|
DevFunctions.ChangeView2(chartControl1, comboBox1Text);
|
|
|
- chartControl1.Location = new Point(0, list_gridheight.Max() + 27);
|
|
|
- chartControl1.Size = new Size(gridwidth, gridwidth);
|
|
|
+ chartControl1.Location = new Point(pos, list_gridheight.Max());
|
|
|
+ chartControl1.Size = new Size(GridPosition, GridPosition);
|
|
|
panel1.Controls.Add(chartControl1);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 设置DataGridView样式
|
|
|
/// </summary>
|
|
|
- private void SetDataGridViewStyle(OTSGridView gridView)
|
|
|
+ private int SetDataGridViewStyle(OTSGridView gridView)
|
|
|
{
|
|
|
//用户不能调整标题的高度
|
|
|
gridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
|
|
|
@@ -384,6 +366,8 @@ namespace OTSIncAReportGrids
|
|
|
//gridView.Location = new System.Drawing.Point(0, 0);
|
|
|
//gridView.Location = new System.Drawing.Point(0, gridheight);
|
|
|
int gridheight = 0;
|
|
|
+ //chartposition = gridwidth;
|
|
|
+ int outpos = gridwidth;
|
|
|
gridView.Location = new System.Drawing.Point(gridwidth, 0);
|
|
|
|
|
|
gridView.Margin = new System.Windows.Forms.Padding(2);
|
|
|
@@ -395,8 +379,11 @@ namespace OTSIncAReportGrids
|
|
|
gridView.RowTemplate.Height = 30;
|
|
|
//gridView.Size = new System.Drawing.Size(667, 520);
|
|
|
gridView.Size = new System.Drawing.Size(gridView.ColumnCount * 100 + 60, gridView.RowCount * 30 + 30);
|
|
|
- gridheight = gridheight + gridView.RowCount * 30 + 80;
|
|
|
- gridwidth = gridwidth + gridView.ColumnCount * 100 + 60;
|
|
|
+ //gridheight = gridheight + gridView.RowCount * 30 + 80;
|
|
|
+ gridheight = gridheight + gridView.RowCount * 30 + 40;
|
|
|
+ gridwidth = gridwidth + gridView.ColumnCount * 100 + 60;
|
|
|
+ chartposition = chartposition + gridView.ColumnCount * 100;
|
|
|
+ GridPosition = gridView.ColumnCount * 100 ;
|
|
|
list_gridheight.Add(gridheight);
|
|
|
|
|
|
gridView.TabIndex = 0;
|
|
|
@@ -407,7 +394,8 @@ namespace OTSIncAReportGrids
|
|
|
gridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
|
|
|
gridView.ColumnHeadersHeight = 40;
|
|
|
|
|
|
- }
|
|
|
+ return outpos;
|
|
|
+ }
|
|
|
#endregion
|
|
|
|
|
|
#region 窗体加载及初始化
|
|
|
@@ -432,38 +420,57 @@ namespace OTSIncAReportGrids
|
|
|
table = lan.GetNameTable(this.Name);
|
|
|
}
|
|
|
|
|
|
- private void CompositionDistributionGrid_Load(object sender, EventArgs e)
|
|
|
+ public void SetGraphicType(ReportCondition sourceGridData)
|
|
|
{
|
|
|
- //int idx = m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
|
|
|
- //string sou = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropItemValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
|
|
|
- string sou = m_condition.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
|
|
|
+ string stdId = "";
|
|
|
+ int stdIdIndex = 0;
|
|
|
+ //find the stdId condition
|
|
|
+ var STDIdItm = sourceGridData.ConditionItemList.Find(s => s.iItemId == OTS_REPORT_PROP_GRID_ITEMS.GRAPHIC_TYPE);
|
|
|
+ if (STDIdItm != null)
|
|
|
+ {
|
|
|
+ stdId = STDIdItm.itemDisplayVal.ToString();
|
|
|
+ stdIdIndex = STDIdItm.comboDownList.IndexOf(stdId);
|
|
|
+ }
|
|
|
+
|
|
|
+ indexGraphicType = stdIdIndex;
|
|
|
+ GraphicType = stdId;
|
|
|
+
|
|
|
+ //int idx = m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
|
|
|
+ //string sou = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropItemValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
|
|
|
+ string sou = m_condition.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
|
|
|
+
|
|
|
+ //string sou = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
|
|
|
+ if (sou.Contains("+"))
|
|
|
+ {
|
|
|
+ for (int i = 0; i < sou.Split('+').Length; i++)
|
|
|
+ {
|
|
|
+ ResultFile resultFile = m_ReportApp.m_rstDataMgr.ResultFilesList.Find(s => s.anotherFileName == sou.Split('+')[i]);
|
|
|
+ if (resultFile != null)
|
|
|
+ {
|
|
|
+ BindDataGridView(resultFile.FilePath, i, resultFile.anotherFileName, stdId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ for (int i = 0; i < m_ReportApp.m_rstDataMgr.ResultFilesList.Count; i++)
|
|
|
+ {
|
|
|
+ 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, stdId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //BindDataGridView(m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FileName);
|
|
|
+ ////设置grid风格
|
|
|
+ //SetDataGridViewStyle();
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- //string sou = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
|
|
|
- if (sou.Contains("+"))
|
|
|
- {
|
|
|
- for (int i = 0; i < sou.Split('+').Length; i++)
|
|
|
- {
|
|
|
- ResultFile resultFile = m_ReportApp.m_rstDataMgr.ResultFilesList.Find(s => s.anotherFileName == sou.Split('+')[i]);
|
|
|
- if (resultFile != null)
|
|
|
- {
|
|
|
- BindDataGridView(resultFile.FilePath, i, resultFile.anotherFileName);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- for (int i=0;i< m_ReportApp.m_rstDataMgr.ResultFilesList.Count;i++)
|
|
|
- {
|
|
|
- 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);
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- //BindDataGridView(m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FileName);
|
|
|
- ////设置grid风格
|
|
|
- //SetDataGridViewStyle();
|
|
|
- }
|
|
|
+ private void CompositionDistributionGrid_Load(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
@@ -541,13 +548,13 @@ namespace OTSIncAReportGrids
|
|
|
ResultFile resultFile = m_ReportApp.m_rstDataMgr.ResultFilesList.Find(s => s.anotherFileName == sou.Split('+')[i]);
|
|
|
if (resultFile != null)
|
|
|
{
|
|
|
- BindDataGridView(resultFile.FilePath, i, resultFile.anotherFileName);
|
|
|
+ BindDataGridView(resultFile.FilePath, i, resultFile.anotherFileName, GraphicType);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- BindDataGridView(m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResultId()].anotherFileName);
|
|
|
+ BindDataGridView(m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResultId()].anotherFileName, GraphicType);
|
|
|
}
|
|
|
}
|
|
|
|