Excel导入获取数据包行数错误
Excel导出有4行数据,导入获取数据包行数是3行,如果手工加一个空行,就可以获取4行
Excel导出是导出到单据提(标准单据体导出功能),导入是在单据上配置一个引入功能
public override void BeforeImportData(BeforeImportDataArgs e)
{
base.BeforeImportData(e);
if(e.DataSource.Tables.Count <=0)
return;
System.Data.DataTable dataTable = e.DataSource.Tables[0];
if (dataTable.Rows.Count <= 0)
return;
this.View.Model.ClearNoDataRow();
this.View.Model.BatchCreateNewEntryRow("FEntity", dataTable.Rows.Count);
for (int row = 0; row < dataTable.Rows.Count; row++)
{
this.View.Model.SetItemValueByNumber("F_Ho_MaterialId", dataTable.Rows[row].GetValue
this.View.Model.SetItemValueByNumber("F_Ho_UnitId", dataTable.Rows[row].GetValue
this.View.Model.SetItemValueByNumber("F_Ho_SupplyId", dataTable.Rows[row].GetValue
this.View.Model.SetItemValueByNumber("F_Ho_StockId", dataTable.Rows[row].GetValue
this.View.Model.SetValue("F_Ho_Date", dataTable.Rows[row].GetValue
this.View.Model.SetValue("F_Ho_Qty", dataTable.Rows[row].GetValue
this.View.Model.SetValue("F_Ho_Date1", dataTable.Rows[row].GetValue
this.View.Model.SetValue("F_Ho_Qty1", dataTable.Rows[row].GetValue
this.View.Model.SetValue("F_Ho_Date2", dataTable.Rows[row].GetValue
this.View.Model.SetValue("F_Ho_Qty2", dataTable.Rows[row].GetValue
this.View.Model.SetValue("F_Ho_Date3", dataTable.Rows[row].GetValue
this.View.Model.SetValue("F_Ho_Qty3", dataTable.Rows[row].GetValue
this.View.Model.SetValue("F_Ho_SupplyStockQty", dataTable.Rows[row].GetValue
this.View.Model.SetValue("F_Ho_Memo", dataTable.Rows[row].GetValue
}
this.View.Model.Save();
}
推荐阅读