Setting ConnectInfo for sub report

asp.net , subreport , access , reports Toronto, Canada
  • 12 years ago
    Hi all, I am working on crystal report 10 and have included this report in my asp.net web application. This report has 2 sub reports. I want to set the connection Information for the sub reports at the runtime. How can I do that. My code: if (reportObject.Kind == ReportObjectKind.SubreportObject) { SubreportObject subReport = (SubreportObject)reportObject; ReportDocument subDocument = subReport.OpenSubreport("EarnHead"); ReportDocument subDocument1 = subReport.OpenSubreport("DeductionHead"); subDocument.DataDefinition.RecordSelectionFormula = "{PAYSLIP.Code} = '" + Code + "' and {PAYSLIP.YYMM} = '" + Month + "'"; subDocument1.DataDefinition.RecordSelectionFormula = "{PAYSLIP.Code} = '" + Code + "' and {PAYSLIP.YYMM} = '" + Month + "'"; } } I tried setting few proprties of Report Document(subDocument) but it didn't worked. and it shows Catastrophic failure. The database is in Access and is placed under App_Data folder. Regards, Royal

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.

“Nine people can't make a baby in a month.” - Fred Brooks