Ejemplo n.º 1
0
 public int SetDataSetParameter(String strDatasetPath, String strDSName)
 {
     if (null != _ReportRuntime)
     {
         if (null != _ReportRuntime.FieldTreeViewData)
         {
             FieldTreeNodeData node = _ReportRuntime.FieldTreeViewData.FindNodeByPath("数据集." + strDatasetPath.Replace('\\', '.'));
             if (null != node && node.Tag is SourceField)
             {
                 SourceField sf = node.Tag as SourceField;
                 if (strDSName.Contains(':'))
                 {
                     string[] strArr = strDSName.Split(":".ToArray());
                     if (strArr.Count() == 3 && strArr [1].Trim() == ":")
                     {
                         switch (strArr [0])
                         {
                         case "SecondarySort":
                             sf.SecondarySort = strArr [2];
                             break;
                         }
                     }
                 }
                 sf.DBSource = strDSName;
                 return(1);
             }
         }
     }
     return(0);
 }
Ejemplo n.º 2
0
 public int SetMultiDataSetParameter(String strDatasetPath, String strDSName, String strSQL)
 {
     if (null != _ReportRuntime)
     {
         if (null != _ReportRuntime.FieldTreeViewData)
         {
             FieldTreeNodeData node = _ReportRuntime.FieldTreeViewData.FindNodeByPath("数据集." + strDatasetPath.Replace('\\', '.'));
             if (null != node && node.Tag is SourceField)
             {
                 SourceField sf = node.Tag as SourceField;
                 if (null == sf.MultiDataSource)
                 {
                     sf.MultiDataSource = new List <DSSqlPair> ();
                 }
                 DSSqlPair sp = sf.MultiDataSource.Find(o => o.DataSource == strDSName);
                 if (null != sp)
                 {
                     sp.Sql = strSQL;
                 }
                 else
                 {
                     sf.MultiDataSource.Add(new DSSqlPair(strDSName, strSQL));
                 }
                 return(1);
             }
         }
     }
     return(0);
 }
Ejemplo n.º 3
0
        private void FieldBindDialogLoad(object sender, EventArgs e)
        {
            FieldTreeViewData fvd = CurrentPrjInfo.GetCurrentReportDataDefine() as FieldTreeViewData;

            if (null == fvd)
            {
                return;
            }
            if (null != SourceField)
            {
                FieldTreeNodeData currentNode = fvd.FindNodeBySource(SourceField);
                if (null != currentNode)
                {
                    fvd.PopulateTree(this.DataSourceTreeView, currentNode, true);
                }
            }
            else
            {
                fvd.PopulateTree(this.DataSourceTreeView, true, BindingSourceField);
            }
            AddParamVar();
            //LoadSysParams();
            SelectNode();
            //this.DataSourceTreeView.ExpandAll();
            if (!string.IsNullOrEmpty(this.FieldTextTb.Text))
            {
                this.FieldTextTb.Focus();
                this.FieldTextTb.Select(0, this.FieldTextTb.Text.Length);
            }
        }
Ejemplo n.º 4
0
        private void RefreshTree()
        {
            FieldTreeViewData fvd = CurrentPrjInfo.GetCurrentReportDataDefine() as FieldTreeViewData;

            if (null == fvd)
            {
                return;
            }
            if (cb_CustomMode.Checked)
            {
                this.tb_TablePath.Enabled = true;
                fvd.PopulateTree(this.DataSourceTreeView);
            }
            else
            {
                this.tb_TablePath.Enabled = false;
                if (null != _allField)
                {
                    FieldTreeNodeData currentNode = fvd.FindNodeBySource(_allField);
                    if (null != currentNode)
                    {
                        fvd.PopulateTreeAddRoot(this.DataSourceTreeView, currentNode);
                    }
                }
                else
                {
                    fvd.PopulateTree(this.DataSourceTreeView);
                }
            }
            FilterTreeView();
            bool isSelect = false;

            foreach (TreeNode node in this.DataSourceTreeView.Nodes)
            {
                isSelect |= SelectNode(SourceField, node);
            }
            if (!isSelect)
            {
                if (this.DataSourceTreeView.Nodes.Count > 0)
                {
                    this.DataSourceTreeView.ExpandAll();
                }
            }
            if (null != this.DataSourceTreeView.SelectedNode)
            {
                this.DataSourceTreeView.SelectedNode.EnsureVisible();
            }
        }