cancel
Showing results for 
Search instead for 
Did you mean: 

CR 2017 Subreport Error

06-30-2021 7:33 PM
933 views 4 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Getting error "Invalid report file path" when setting OpenSubreport property. Path is correct. Other reports open up fine. Is there a better way to set this property?

oReportFile.Load(sRptFilename)

RptFormulaFieldDefinitions = oReportFile.DataDefinition.FormulaFields

oReportFile.SetDataSource(ReportData)

frmReportViewer.CRViewer.ReportSource = oReportFile

If sRptFileCopy <> "" Then

oReportFileCopy.Load(sRptFileCopy)

RptFormulaFieldDefinitionsCopy = oReportFileCopy.DataDefinition.FormulaFields

End If

oReportFileSub.OpenSubreport(sSubReportPath) c:\reports\Feeticket.rpt

oReportFileSub.SetDataSource(ReportDataSub)

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

0 Likes

Answers (2)

Answers (2)

Former Member
0 Likes

Yes the report is already imbedded in the main report. I changed the code to pass the name of the sub report, but I still get the error.

.OpenSubreport("feeticket.adj")

DellSC
Active Contributor
0 Likes

Is the subreport already embedded in the main report? If so you need to open the subreport based on its name in the main report - not based on the file name of the report you imported.

-Dell