SNAPSHOT CODE:
if(rowInnerNum.Count <= firstPartition)
{
colArr[1, 0] = tagStr[0].ToString();
for(int i = 0; i < colArr.GetUpperBound(0); i++)
{
for(int j = 0; j < colArr.GetUpperBound(0); j++)
{
}
}
}
FULL CODE:
public void example()
{
// TrTag allSpan = "/dom[@domain='devvprtweb405']//table[#'ctl00_ctl00_Content_ContentPlaceHolderMain_ReportGrid_ctl00_ctl04_ctl00_PrelimByMonthReportGrid_ctl00']/tbody";
string trStr = repo.portal.QAReports.tr2Info.AbsolutePath.ToString();
string numReports = "0";
string colMax = "0";
string rowMax = "0";
int rows = -0;
int numMonths;
int monthCountInt;
string column = "";
TBodyTag span = Host.Local.FindSingle(trStr, 30000);
TBodyTag span2 = repo.portal.QAReports.tr2;
DivTag final;
string tb;
WebElement tb2;
TBodyTag tbody2;
TrTag build2;
DivTag divBuild3;
string dom = "/dom[@domain='dweb405']";
string trF = "//tr[#'";
string trL = "']";
string end = "/td[6]/div[2]";
string tdEnd = "']//td[6]/div[2]";
string build;
string tagStr;
string build2Str;
string build3;
string tBody = "/td/div/table/tbody/";
IList<TdTag> tdList;
ArrayList trArr = new ArrayList();
ArrayList trArr2 = new ArrayList();
ArrayList tbodyArr = new ArrayList();
ArrayList tbody2Arr = new ArrayList();
ArrayList tdArr = new ArrayList();
ArrayList tbArr = new ArrayList();
string monthCountStr = monthCount;
monthCountInt = 9; //Convert.ToInt32(monthCount);
/*int totalDivision = monthCountInt * reportCount;
int partitionNum = reportCount;
int subtractValue = totalDivision / reportCount;
int LastPartition = totalDivision - subtractValue;
int middlePartition = maxParition - subtractValue; */
int firstPartition = monthCountInt;
int secondPartition = monthCountInt + monthCountInt;
int thirdPartititon = monthCountInt * 3;
int fourthPartition = monthCountInt + monthCountInt + monthCountInt;
int fifthPartition = monthCountInt * 4;
//int numMonths = Convert.ToInt32(monthCount);
int numReportsInt = 3;
int numRowInt = 9; //Convert.ToInt32(rowMax);
numRowInt = Convert.ToInt32(monthCount);
int numColInt = Convert.ToInt32(colMax);
string[,] colArr = new string[numReportsInt, numRowInt];
var allspan3 = span.FindDescendants<TrTag>();
var allspan4 = span2.FindChildren<TrTag>();
// var allspan5 = tbody2.FindDescendants<TrTag>();
//get the root trtag
foreach(var tag2 in allspan4)
{
tagStr = tag2.ToString().Replace("{TrTag:", "");
tagStr = tagStr.Replace("}", "");
build = string.Format(dom.ToString() + trF + tagStr.ToString() + trL);
trArr.Add(build);
}
//append the tbody text to it and need to find tr descendents
for(int j =0; j < trArr.Count; j++)
{
build2Str = trArr[j].ToString();
build = string.Format(trArr[j].ToString() + tBody.ToString());
//tb = build;
tbArr.Add(build);
/// build this type of string dom[@domain='devvprtweb405']//tr[#'ctl00_ctl00_Content_ContentPlaceHolderMain_ReportGrid_ctl00__0']/td/div/table/tbody/
//total number of reports
}
//get the TRtag from the /tbody base
for(int h = 0; h < tbArr.Count; h++)
{
build2Str = tbArr[h].ToString();
tbody2 = build2Str.ToString();
var trTags = tbody2.FindDescendants<TrTag>();
//also derivative of number of months
monthCount = trTags.Count.ToString();
foreach(TrTag tag5 in trTags)
{
//cut tag bs
tagStr = tag5.ToString().Replace("{TrTag:", "");
tagStr = tagStr.Replace("}", "");
//pull it out
//append to final string
build = string.Format(dom.ToString() + trF + tagStr.ToString() + tdEnd);
final = build.ToString();
final.Element.GetAttributeValueText("InnerText");
tagStr = final.ToString().Replace("{DivTag:", "");
tagStr = tagStr.Replace("}", "");
//intTagInt = Convert.ToInt32(tagStr);
trArr2.Add(build);
rowInnerNum.Add(tagStr);
//colArr[0, 0] = tagStr;
if(rowInnerNum.Count <= firstPartition)
{
colArr[1, 0] = tagStr[0].ToString();
for(int i = 0; i < colArr.GetUpperBound(0); i++)
{
for(int j = 0; j < colArr.GetUpperBound(0); j++)
{
}
}
}
// for (int i=0; i<numReportsInt; i++)
// {
// for (int j=0; j<=numRowInt; j++)
// {
// colArr[i,j] = ("i" + 1) * (j + 1);
// }
// }
/*if(rowInnerNum.Count <= secondPartition)
{
for(int j = 0; j < colArr.GetUpperBound(0); j++)
{
colArr[i, j] = colArr;
}
}
if(rowInnerNum.Count <= thirdPartititon)
{
for(int k = 0; k < colArr.GetUpperBound(0); k++)
{
colArr[2, 0] = tagStr;
}
}*/
} } }
This post has been edited by regex: 19 November 2012 - 03:51 PM

New Topic/Question
Reply



MultiQuote




|