Hi to all experts, i have a big problem here, i want to print data from my datagridview, when i select 1 row.. there is no problem, but when i try to print multiple row, just first selected row appear
here is the code :
private void button4_Click(object sender, EventArgs e)
{
ReportDocument report = new ReportDocument();
report.Load("katalogbarang.rpt");
if (Kodetxt.Text == "")
{
}
else
{
report.RecordSelectionFormula = "{katalog.id}= " + dg1.SelectedRows[0].Cells[9].Value + "";
}
PrintReport rpt = new PrintReport();
rpt.crystalReportViewer1.ReportSource = report;
rpt.crystalReportViewer1.Refresh();
rpt.ShowDialog();
}
this is my little condition
-------------------------------------------
|0121 | kolor | 3 | 2000 |
|0892 | panci | 1 | 10000 |
|9200 | kutang | 2 | 20000 |
|8989 | cangcut | 8 | 2500 |
when im selecting one row (left click)
|0121 | kolor | 3 | 2000 |
or when i randomly click (in condition i just click one row) there is no problem,
then i chose randomly and more than just one row, but which appear in crystal report only the first i click
i want report in my crystal report are like this
|9200 | kutang | 2 | 20000 |
|0892 | panci | 1 | 10000 |
or
|7890 | sapu | 1 | 3000 |
|0121 | kolor | 3 | 2000 |
|9200 | kutang | 2 | 20000 |
please someone help me... give me some code and tutorial to resolve my prob
thanks in advance