Page 1 of 1

Report duplication doesn't duplicate images

Posted: Mon Oct 26, 2015 7:06 pm
by Fabio Pagano
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):

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)
Attached is the zipped original .mdz file you can use for duplication.

Thank you.

Re: Report duplication doesn't duplicate images

Posted: Tue Oct 27, 2015 10:46 am
by Alex K.
Hello,

Please try to add the Clear() method for the rendered pages in the original report:

Code: Select all

...
}
OriginalReport.RenderedPages.Clear();
OriginalReport.Dispose();
OriginalReport = null;
...
Thank you.

Re: Report duplication doesn't duplicate images

Posted: Tue Oct 27, 2015 10:48 pm
by Fabio Pagano
Worked.

Thank you.

Re: Report duplication doesn't duplicate images

Posted: Wed Oct 28, 2015 6:12 am
by Alex K.
Hello,

We are always glad to help you!
Let us know if you need any additional help.

Thank you.