问题发现 "Column IDs" 内部报告
Issue finding "Column IDs" inside report
我希望能够通过 API.
通过仅包含特定列的电子邮件从报告中发送一行
API 文档清楚地向您展示了如何通过电子邮件发送行,但是,我无法获取报告中的列 ID 以发送那些特定的列。我正在使用以下内容尝试输出列 Title 和 Id。标题将成功显示,但 ID 显示为空白。这有什么原因吗?
Report report = ss.ReportResources.GetReport(
reportid, // long reportId
null, // IEnumerable<ReportInclusion>
null, // int pageSize
null // int page
);
foreach(var Col in report.Columns)
{
Console.WriteLine($"Title:{Col.Title} ID:{Col.Id}");
}
你应该调用 virtualId
Console.WriteLine($"Title:{Col.Title} ID:{Col.VirtualId}");
基于https://smartsheet-platform.github.io/api-docs/#reportcolumn-object
A report column is a "virtual" column, in that it appears identical to
source sheet columns, but is in fact a different column belonging to
the report. Cells in the report refer to this column via their
virtualColumnId attribute, and to their actual column from their
source sheet via their columnId attribute.
基于https://smartsheet-platform.github.io/api-docs/?csharp#get-report
{
"id": 4583173393803140,
"name": "My Report",
"totalRowCount": 4,
"accessLevel": "OWNER",
"permalink": "https://app.smartsheet.com/b/home?lx=pWNSDH9itjBXxBzFmyf-5w",
"createdAt": "2012-07-24T18:22:29-07:00",
"modifiedAt": "2012-07-24T18:30:52-07:00",
"columns": [
{
"virtualId": 4583173393803140,
"version": 0,
"index": 0,
"primary": true,
"title": "Sheet Name",
"type": "TEXT_NUMBER",
"validation": false,
"sheetNameColumn": true
},
{
"virtualId": 2331373580117892,
"version": 0,
"index": 1,
"title": "Status",
"type": "TEXT_NUMBER",
"validation": false
}
],
"rows": [
{
"id": 1732835527681924,
"sheetId": 1060338138408836,
"rowNumber": 1,
"expanded": true,
"accessLevel": "OWNER",
"createdAt": "2014-10-02T15:05:35-07:00",
"modifiedAt": "2014-10-02T15:05:35-07:00",
"cells": [
{
"virtualColumnId": 4583173393803140,
"type": "TEXT_NUMBER",
"value": "My Sheet",
"displayValue": "My Sheet"
},
{
"columnId": 8467747974735748,
"virtualColumnId": 2331373580117892,
"type": "TEXT_NUMBER",
"value": "In Progress",
"displayValue": "In Progress"
}
]
}
]
}
我希望能够通过 API.
通过仅包含特定列的电子邮件从报告中发送一行API 文档清楚地向您展示了如何通过电子邮件发送行,但是,我无法获取报告中的列 ID 以发送那些特定的列。我正在使用以下内容尝试输出列 Title 和 Id。标题将成功显示,但 ID 显示为空白。这有什么原因吗?
Report report = ss.ReportResources.GetReport(
reportid, // long reportId
null, // IEnumerable<ReportInclusion>
null, // int pageSize
null // int page
);
foreach(var Col in report.Columns)
{
Console.WriteLine($"Title:{Col.Title} ID:{Col.Id}");
}
你应该调用 virtualId
Console.WriteLine($"Title:{Col.Title} ID:{Col.VirtualId}");
基于https://smartsheet-platform.github.io/api-docs/#reportcolumn-object
A report column is a "virtual" column, in that it appears identical to source sheet columns, but is in fact a different column belonging to the report. Cells in the report refer to this column via their virtualColumnId attribute, and to their actual column from their source sheet via their columnId attribute.
基于https://smartsheet-platform.github.io/api-docs/?csharp#get-report
{
"id": 4583173393803140,
"name": "My Report",
"totalRowCount": 4,
"accessLevel": "OWNER",
"permalink": "https://app.smartsheet.com/b/home?lx=pWNSDH9itjBXxBzFmyf-5w",
"createdAt": "2012-07-24T18:22:29-07:00",
"modifiedAt": "2012-07-24T18:30:52-07:00",
"columns": [
{
"virtualId": 4583173393803140,
"version": 0,
"index": 0,
"primary": true,
"title": "Sheet Name",
"type": "TEXT_NUMBER",
"validation": false,
"sheetNameColumn": true
},
{
"virtualId": 2331373580117892,
"version": 0,
"index": 1,
"title": "Status",
"type": "TEXT_NUMBER",
"validation": false
}
],
"rows": [
{
"id": 1732835527681924,
"sheetId": 1060338138408836,
"rowNumber": 1,
"expanded": true,
"accessLevel": "OWNER",
"createdAt": "2014-10-02T15:05:35-07:00",
"modifiedAt": "2014-10-02T15:05:35-07:00",
"cells": [
{
"virtualColumnId": 4583173393803140,
"type": "TEXT_NUMBER",
"value": "My Sheet",
"displayValue": "My Sheet"
},
{
"columnId": 8467747974735748,
"virtualColumnId": 2331373580117892,
"type": "TEXT_NUMBER",
"value": "In Progress",
"displayValue": "In Progress"
}
]
}
]
}