///       <summary>
        ///       Fetches the column value for a row of a table.
        ///       <param name="columnName">Column name</param>
        ///       <param name="pageID">Page ID from where the value needs to be extracted</param>
        ///       <returns>The value of the column for the current row of a table.</returns>
        public string getColumnValueForRow(string columnName)
        {
            ExportCore.WriteLog("inside getColumnValueForRow " + columnName);

            string columnValue = "";

            TDCOLib.IDCO row = null;
            Stopwatch    sw  = Stopwatch.StartNew();

            // the current iternation DCO would point to a row of a table
            if (!Globals.Instance.GetData(Constants.forLoopString.CURRENTITERATIONDCO).Equals(Constants.EMPTYSTRING))
            {
                row = (TDCOLib.IDCO)Globals.Instance.GetData(Constants.forLoopString.CURRENTITERATIONDCO);
                for (int k = 0; k < row.NumOfChildren(); k++)
                {
                    TDCOLib.DCO column = row.GetChild(k);
                    if (column.ObjectType() == Constants.Field && columnName == column.ID)
                    {
                        ExportCore.WriteLog(columnName + " = " + column.Text);
                        columnValue = column.Text;
                        break;
                    }
                }
            }
            else
            {
                string message = "  Error occured while fetching value for column " + columnName;
                ExportCore.WriteLog(message);
                throw new SmartExportException(message);
            }
            ExportCore.WriteDebugLog(" getColumnValueForRow(" + columnName + ") completed in " + sw.ElapsedMilliseconds + " ms.");
            sw.Stop();
            return(columnValue);
        }
Exemplo n.º 2
0
        private void processTableRows(IDCO table, XmlNode tableNode)
        {
            // iterate over rows
            // print rows
            int i = rowStart;

            do
            {
                TDCOLib.DCO row = table.GetChild(i);
                if (row.ObjectType() == Constants.Field)
                {
                    i++;
                    Globals.Instance.SetData(Constants.forLoopString.CURRENTITERATIONDCO, row);
                    XmlNode dataNode = tableNode.ChildNodes.Item(0);
                    {
                        if (dataNode.Name == Constants.NodeTypeString.SE_DATA)
                        {
                            dataElement.setIsTableColumn(true);
                            dataElement.EvaluateData(dataNode);
                        }
                    }
                }
                Globals.Instance.SetData(Constants.forLoopString.CURRENTITERATIONDCO, Constants.EMPTYSTRING);
            } while (i < rowEnd);
        }
        ///       <summary>
        ///       Checks if the DCO object is a table.
        ///       <param name="table">DCO object</param>
        ///       <returns>True if the DCO object is a table</returns>
        ///       </summary>
        public bool isObjectTable(TDCOLib.IDCO table)
        {
            bool isTable = false;

            for (int j = 0; j < table.NumOfChildren(); j++)
            {
                TDCOLib.DCO row = table.GetChild(j);
                if (row.ObjectType() == Constants.Field)
                {
                    for (int k = 0; k < row.NumOfChildren(); k++)
                    {
                        TDCOLib.DCO column = row.GetChild(k);

                        if (column.ObjectType() == Constants.Field)
                        {
                            isTable = true;
                            break;
                        }
                    }
                }
            }
            return(isTable);
        }