Hello there
I'm trying to send parameters to a subreport in the main report but the data doesn't show up !!
The data shows up correctly when I send the parameters to the main report. But not to the sub-report.
What I have ? :
- a Procedure that get_all_expenses for one particular car AND the nature of the expenses.
@Nat (nature of the expense)
@Immatr (Cars registration number).
I send those param to the main report using this :
RPT.rptDepenses myReport = new RPT.rptDepenses();
myReport.SetParameterValue("@Nat", "Nature 1");
myReport.SetParameterValue("@Immatr", txt_Immatricule.Text);
RPT.FRM_PRINT myForm = new RPT.FRM_PRINT();
myForm.crystalReportViewer1.ReportSource = myReport;
myForm.ShowDialog();
I need 2 sub-report in the main report so I can add the "Nature 2" data.
Any help with this please I appreciate it.
I'v been looking around for an answer before posting my own question hoping someone could have an idea.
Thank you so much.
What I have tried:
I tried to add the subreport string with param 0 but didn't work.
RPT.rptDepenses myReport = new RPT.rptDepenses();
myReport.SetParameterValue("@Nat", "Nature 1", myReport.Subreports[0].Name.ToString());
myReport.SetParameterValue("@Immatr", txt_Immatricule.Text, myReport.Subreports[0].Name.ToString());
RPT.FRM_PRINT myForm = new RPT.FRM_PRINT();
myForm.crystalReportViewer1.ReportSource = myReport;
myForm.ShowDialog();