C# EPPlus OpenXML 计数行 [英] C# EPPlus OpenXML count rows

查看:25
本文介绍了C# EPPlus OpenXML 计数行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 EPPlus 和 OpenXML 有谁知道如何计算行数的语法?

With EPPlus and OpenXML does anyone know the syntax on how to count the rows?

假设我的工作表被称为工作表"

Say my worksheet is called "worksheet"

int numberRows = worksheet.rows.count()?或 worksheet.rows.dimension

我当然对答案很感兴趣,但如何找到答案会很酷,比如转到定义"并寻找这个或那个等等.

I'm certainly interested in the answer, but how to find the answer would be cool to, like "Go to definition" and look for this or that, etc.

推荐答案

使用名为 worksheetworksheet.Dimension.Start.Rowworksheet 的工作表对象.Dimension.End.Row 应该给你你需要的信息.

With a worksheet object called worksheet, worksheet.Dimension.Start.Row and worksheet.Dimension.End.Row should give you the information you need.

worksheet.Dimension.Address 将为您提供一个字符串,其中包含传统 Excel 范围格式的工作表维度(例如,'A1:I5' 表示第 1-5 行,第 1-9 列).

worksheet.Dimension.Address will give you a string containing the worksheet dimensions in the traditional Excel range format (e.g. 'A1:I5' for rows 1-5, columns 1-9).

有一个文档文件.在许多情况下,使用库并以这种方式找到答案可能同样快.EPPlus 似乎设计得很好 - 至少所有东西的命名都符合逻辑.

There is a documentation file available. In many cases it might be just as quick to play around with the library and find the answer that way. EPPlus seems to be well designed - everything seems to be logically named, at least.

这篇关于C# EPPlus OpenXML 计数行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆