Kirish Asosoiy qisim


C# 1 sheet.Cells[countRow, countColumn] = $"=G{countRow}-F{countRow}"


Download 0.76 Mb.
bet8/14
Sana28.12.2022
Hajmi0.76 Mb.
#1014407
1   ...   4   5   6   7   8   9   10   11   ...   14
Bog'liq
8888 (Автосохраненный)

C#
1 sheet.Cells[countRow, countColumn] = $"=G{countRow}-F{countRow}";
2 sheet.Cells[countRow, countColumn].FormulaLocal =
$"=ЕСЛИ((H{countRow}*O{countRow})+(I{countRow}*P{countRow})/100<=0;J
{countRow}*O{countRow}/100;((H{countRow}*O{countRow})+(I{countRow}*P{countRow}))
/100)";
3 sheet.Cells[countRow, countColumn] = $"=K{countRow}+N{countRow}-R{countRow}";
4 sheet.Cells[33, 22].FormulaLocal = "=СУММ(V3:V32)";

Sahifa tanaffusini qo'shish.
C#
1 //Ячейка, с которой будет разрыв
2 Excel.Range razr = sheet.Cells[n, m] as Excel.Range;
3 //Добавить горизонтальный разрыв (sheet - текущий лист)
4 sheet.HPageBreaks.Add(razr);
5 //VPageBreaks - Добавить вертикальный разрыв


Excel faylini qanday ochish kerak
C#
1 app.Workbooks.Open(@"C:\Users\User\Documents\Excel.xlsx",
2 Type.Missing, Type.Missing, Type.Missing, Type.Missing,
3 Type.Missing, Type.Missing, Type.Missing, Type.Missing,
4 Type.Missing, Type.Missing, Type.Missing, Type.Missing,
5 Type.Missing, Type.Missing);
Excel hujjatini saqlash
C#
1 app.Application.ActiveWorkbook.SaveAs("MyFile.xlsx", Type.Missing,
2 Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Excel.XlSaveAsAccessMode.xlNoChange,
3 Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
Excel.Application ob'ektini to'ldirish
C#
1 app.Quit();
2 System.Runtime.InteropServices.Marshal.ReleaseComObject(app);

Faylni qanday tanlash va uni yuklab olish va ma'lum bir varaqdagi to'ldirilgan qatorlar va ustunlar sonini nom bo'yicha aniqlashga misol.
C#
1 //поиск файла Excel
2 OpenFileDialog ofd = new OpenFileDialog();

Download 0.76 Mb.

Do'stlaringiz bilan baham:
1   ...   4   5   6   7   8   9   10   11   ...   14




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling