本文整理汇总了C#中ClosedXML.Excel.XLWorkbook.Row方法的典型用法代码示例。如果您正苦于以下问题:C# XLWorkbook.Row方法的具体用法?C# XLWorkbook.Row怎么用?C# XLWorkbook.Row使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClosedXML.Excel.XLWorkbook
的用法示例。
在下文中一共展示了XLWorkbook.Row方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CellsUsedIncludeStyles2
public void CellsUsedIncludeStyles2()
{
IXLWorksheet ws = new XLWorkbook().Worksheets.Add("Sheet1");
ws.Row(2).Style.Fill.BackgroundColor = XLColor.Red;
ws.Column(2).Style.Fill.BackgroundColor = XLColor.Red;
ws.Cell(3, 3).Value = "ASDF";
var range = ws.RangeUsed(true).RangeAddress.ToString();
Assert.AreEqual("B2:C3", range);
}
示例2: versatile_selection
//>>>>>>>> scaniruu file i zapisyvau v array
string versatile_selection(string cellFrom, string cellTo, int rowFrom, int rowTo)
{
int cellFrom_int = Convert.ToInt32(cellFrom);
int cellTo_int = Convert.ToInt32(cellTo);
var ws = new XLWorkbook("2016.xlsx").Worksheet("Лист1"); // TODO pridumat kak otkryvat odin raz
string value_of_cell = "";
#region TODO sdelat imya kolonki
/*string cellName = "";
for (int i = 1; i <= 3; i++)
{
cellName = ws.Row(rowFrom - i).Cell(cell).Value.ToString();
if (cellName != "")
{
listValues.Add(cellName);
textBox1.AppendText(cellName + ":\n");
textBox1.AppendText("\n");
break;
}
}*/
#endregion
int r = 0; // budet otschityvat kolichestvo vseh ryadov v massive kotoryi sobiraet vse dannye po tipy {1},{name,weight,age,}
int col_in_row = 0; // budet otschityvat colonki v [1,col_in_row] massive, t.e. {},{col_in_row, col_in_row}
int prev_r = 10000000;
int how_much_symbols_in_file = how_much_symbols_have_to_check();
int how_much_symbols_in_file2 = how_much_symbols_in_file;
bool symbol_neravenstva = false;
for (int i = rowFrom; i <= rowTo; i++)// kajdyi ryad po odnoi kolonke prosmatrivaem
{
how_much_symbols_in_file2 = how_much_symbols_in_file;
col_in_row = 0;
textBox1.AppendText(i + " \n");
for (int c = cellFrom_int; c < cellTo_int; c++)
{
value_of_cell = ws.Row(i).Cell(c.ToString()).Value.ToString();// simvol v doke, kotoryi budet sravnivatsya
data_from_file[r, col_in_row] = value_of_cell; //zagonyaem v massive, chto by mojno bylo ves ryad zapomnit
// proverit sovpadaet li colonka i zatem sovpadaet li simvol
// esli simvol sovpadaet i ryad ne pomenyalsya, to zapominaem ves ryad
if (data_from_nastroiki[c] != null) // znachit sovpadaet colonka
{
//dobavit proverku simvola < >
//symbol_neravenstva =
string s = check_symbol_neravenstva(c); //tut vydal simvol neravensta v string. proveryaem est li simvol '<' || '>' v data_from_nastroiki[c]
textBox1.AppendText(i + " " + c + " check_symbol_neravenstva >>>>>> //" + s + "//\n");
int bez_simvola_neravenstva = (s == ">"||s == "<")? udalit_simvol_neravenstva(data_from_nastroiki[c]):0; // dlya togo, chto by sravnit s chislov v yacheike;
//int for_compare_format = (Convert.ToInt32(value_of_cell));
bool q = s == ">" && Convert.ToDouble(value_of_cell) >= bez_simvola_neravenstva;
bool w = s == "<" && Convert.ToDouble(value_of_cell) <= bez_simvola_neravenstva;
bool e = s == "0" && data_from_nastroiki[c] == value_of_cell;
if (s == ">") {
textBox1.AppendText(i + " ");
}
if (q || w || e)
{ //znachit sovpadaet simvol
how_much_symbols_in_file2--;
//textBox1.AppendText(c + " how_much_symbols_in_file2 >> " + how_much_symbols_in_file2 + "\n");
textBox1.AppendText(i + " " + c + " sovpadaet >> " + value_of_cell + " == " + data_from_nastroiki[c] + "\n");
// kak roiverut cto sovpadaut i ostalnye simvoly? znat kolichestvo kotoroe doljno sovpast
if (prev_r != r && how_much_symbols_in_file2 <= 0)
{
mark_array_row.Add(r); //esli sovpadaet, zapominaem nomer ryada iz array data_from_file
prev_r = r; // chto by povtory ne sohranyalis, naidennye po drugim priznakam teje ludi
}
}
else // ne sovpalo, vybrasyvaem ryad dlya uskoreniya
{
textBox1.AppendText(i + " " + c + " ne sovpadaet >> //" + value_of_cell + "// !=//" + bez_simvola_neravenstva + "//\n");
//break;
}
}
else {
//textBox1.AppendText(c+" == null >> " + data_from_nastroiki[c] + "\n");
}
col_in_row++;
}
r++;
}
return value_of_cell;
} // end versatile_selection