[HELP] Attempted to access an element as a type incompatible with the array.

reportviewer , csharp.net , report Indonesia
  • 10 years ago
    i want to create report with report viewer and then came up this error at runtime here is my code inventoryInfoReport.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local; inventoryInfoReport.LocalReport.ReportPath = CitronConfiguration.ReportPath + "InventoryInfoReport.rdlc"; InventoryInfoDataSet inventoryDataSetObj = new InventoryInfoDataSet(); IList inventoryCatalogList = new InventoryCatalogSystem().GetInventoryCatalogList(); foreach (InventoryCatalog inventoryCatalog in inventoryCatalogList) { DataRow row = inventoryDataSetObj.Tables[0].NewRow(); row["InventoryId"] = inventoryCatalog.InventoryId; row["InventoryName"] = inventoryCatalog.InventoryName; row["Stock"] = Library.DecimalToCurrency(inventoryCatalog.Stock); row["IdealStock"] = Library.DecimalToCurrency(inventoryCatalog.IdealStock); row["Balance"] = Library.DecimalToCurrency(inventoryCatalog.Balance); inventoryDataSetObj.Tables[0].Rows.Add(row); } ReportDataSource objDataSource = new ReportDataSource("InventoryInfoDataSet_DataTable1", inventoryDataSetObj.Tables[0]); inventoryInfoReport.LocalReport.DataSources.Add(objDataSource); <--the error was at this line can some one help me please?

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There's no test like production” - Anon