I'm using Multiple template reports in one report. But bookmarks doesnt show.

Stimulsoft Reports.NET discussion
Post Reply
User avatar
ercan
Posts: 18
Joined: Thu Feb 07, 2019 8:21 am

I'm using Multiple template reports in one report. But bookmarks doesnt show.

Post by ercan »

Hello, I'm using that kind of code for join different type of reports in a one report.
With this code I can join rendered pages in one report and show it. But I cant find any bookmarks on the target joined report object.
Original reports has bookmarks in object interactions and without join it works well. But if I add this rendered pages to the new joined report, there is no any bookmark.
Do you have any offer?

Code: Select all


StiReport certificatesReport=null;

            if (IsMultipleCertificateTypes)
            {
                certificatesReport = new StiReport
                {
                    CalculationMode = StiCalculationMode.Compilation,
                    ReportUnit = StiReportUnitType.Millimeters,
                    ScriptLanguage = StiReportLanguageType.CSharp,
                    Unit = StiUnit.Millimeters,
                    NeedsCompiling = false,
                    IsRendered = true,
                    IsInteractionRendering = true,
            };
            
            certificatesReport.RenderedPages.Clear();

                var groupDatas = CertificatesDataTable.AsEnumerable().GroupBy(q => q[DataRowTemplateIdColumnName]);
                foreach (var groupData in groupDatas)
                {                    
                        var reportCertificate = RenderReportTemplate(TemplateTypes.Certificate, groupData.CopyToDataTable());

                        foreach (StiPage page in reportCertificate.CompiledReport.RenderedPages)
                        {
                            page.Report = certificatesReport;
                            page.NewGuid();
                            certificatesReport.RenderedPages.Add(page);

                        }
                    
                }
            }
            
stiViewerCertificates.Report = certificatesReport;
stiViewerCertificates.InvokeBookmarks();
            
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: I'm using Multiple template reports in one report. But bookmarks doesnt show.

Post by HighAley »

Hello.

The bookmarks are stored in a separate collection.
You could use next code to get the in the merged report.

Code: Select all

            for (int i = 1; i < repCount; i++)
            {
                StiReport repDetail = new StiReport();
                repDetail.Load(@"d:\a.mrt");
                repDetail.Render();
                foreach (StiPage repPage in repDetail.RenderedPages)
                {
                    repPage.Report = mainReport;
                    mainReport.RenderedPages.Add(repPage);
                }
                mainReport.Bookmark.Bookmarks.AddRange(repDetail.Bookmark.Bookmarks);
                if (i == 1) mainReport.Bookmark.Text = repDetail.Bookmark.Text;
            }
Thank you.
User avatar
ercan
Posts: 18
Joined: Thu Feb 07, 2019 8:21 am

Re: I'm using Multiple template reports in one report. But bookmarks doesnt show.

Post by ercan »

Fixed.
Thank you. ;)
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: I'm using Multiple template reports in one report. But bookmarks doesnt show.

Post by HighAley »

Great!
We are always glad to help you.
Post Reply