Report duplication doesn't duplicate images
Posted: Mon Oct 26, 2015 7:06 pm
Good evening.
In our software we have a routine of report duplication.
In version 2013.2.1700.0 it worked fine, then we have passed to version 2015.2.0.0 and the images weren't copied anymore in the new duplicated report.
Here is the sample code (at the third line change the .mdz path to load):
Attached is the zipped original .mdz file you can use for duplication.
Thank you.
In our software we have a routine of report duplication.
In version 2013.2.1700.0 it worked fine, then we have passed to version 2015.2.0.0 and the images weren't copied anymore in the new duplicated report.
Here is the sample code (at the third line change the .mdz path to load):
Code: Select all
Dim OriginalReport As New Stimulsoft.Report.StiReport
OriginalReport.LoadDocument("C:\S000000001.mdz")
Dim DuplicatedReport As New Stimulsoft.Report.StiReport
DuplicatedReport.RenderedPages.Clear()
OriginalReport.ReportUnit = DuplicatedReport.ReportUnit
Dim MyPage As Integer
MyPage = 0
For Each page As Stimulsoft.Report.Components.StiPage In OriginalReport.RenderedPages
MyPage += 1
page.Report = DuplicatedReport
page.Guid = System.Guid.NewGuid().ToString().Replace("-", "")
DuplicatedReport.RenderedPages.Add(page)
Next
OriginalReport.Dispose()
OriginalReport = Nothing
DuplicatedReport.ReportAlias = ""
DuplicatedReport.ReportDescription = ""
Dim report As Stimulsoft.Report.StiReport
report = DuplicatedReport
'Show the report
report.NeedsCompiling = False
report.IsRendered = True
report.Show(True)
Thank you.