I used this code to pass a value from DatagridviewCell
to Crystal Report
FormulaField:
CrystalReport6 objRpt6 = new CrystalReport6();
for (int i = 0; i < statistiqueDataGridView.RowCount; i++)
{
objRpt6.DataDefinition.FormulaFields["CodeBonLivraison11"].Text =
"'" + statistiqueDataGridView.Rows[i].Cells[0].Value.ToString() + "'";
}
But I get this error message:
Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))
Although the field name is correct but I get this error message, how to solve this?
User contributions licensed under CC BY-SA 3.0