Getting the Filename of a sub-report
source link: https://answers.sap.com/questions/13840357/getting-the-filename-of-a-sub-report.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Just getting started with the Crystal Report SDK in VS2022 for the first time and I'm trying to develop a Windows app that will scan through the many hundreds of Crystal reports we have and list the sub-reports that many of them use. Anyway this is the code I have so far:-
Dim crDoc As New CrystalDecisions.CrystalReports.Engine.ReportDocument Dim crSubReport As CrystalDecisions.CrystalReports.Engine.ReportDocument dim SubReportFileName as string crDoc.Load("c:\Temp\Sample Report.rpt") For Each crSubReport In crDoc.Subreports SubReportFileName = crSubReport.FileName Next
It seems to work fine until it Filename assignment when I get an error of "Not supported within subreports". Using the quickwatch crSubReport I can see that the property is listed but there is an error of 'crSubReport.FileName' threw an exception of type 'System.NotSupportedException' for it. It's the same for FilePath but the Name property is fine.
Can anyone help me get around this please? I'd also like to be able to see whether each sub-report will "Re-import when opening" but I can't see a property anywhere for this.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK