Pass a value from WinForm to Crystal Report

1

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?

c#
winforms
crystal-reports
asked on Stack Overflow Oct 7, 2015 by user4340666 • edited Oct 11, 2015 by shA.t

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0