logo
small logo
  • Ürünler
  • Satın al
  • Yardım
  • About
  • Kullanıcı paneli Yardım
    • en
    • de
    • JP
    • ZH
  • Anasayfa
  • /
  • Articles
  • /
  • How to combine multiple reports into one
  • Working with NuGet packages in FastReport

    22 Kasım 2021

    UPD: Applies to the versions of FastReport .NET before 2022.2. License packages are now available

    read more
  • PreviewControl.OnPrint and PreviewControl.OnExport Events

    1 Ekim 2020

    In FastReport 2019.4 added the ability to subscribe to PreviewControl.OnPrint and PreviewControl.OnExport events, which are

    read more
  • How to use Online Designer in ASP .NET Core

    17 Ocak 2018

    One of the novelties by FastReport .NET 2018 was the adaptation of OnlineDesigner to the

    read more
  • FastReport .NET packages and .NET 5.0

    17 Aralık 2020

    UPD: Applies to the versions of FastReport .NET before 2022.2. License packages are now available

    read more
  • Toilet paper printing

    30 Mart 2020

    Gentlemen jokes aside! Today we are talking about toilet paper. This essential hygiene product was

    read more

How to combine multiple reports into one

13 Temmuz 2020

Many report developers had situations when they needed to add a page that had already been implemented in another report. And you had to rework an existing report - add a new page, data sources. Not everyone knows that you can simply merge reports when they are displayed.

The user of Stimulsoft report generator also faced the problem of combining reports:

https://stackoverflow.com/questions/43569668/stimulsoft-view-multiple-reports-inside-stiviewer

I am using Stimulsoft libraries to create reports (StiReport control) and then showing it inside a StiViewer control. The problem is when i assign multiple reports to the viewer, it does not refresh or display the contents but it works just fine if i only set 1 report to the viewer.

User issue

Fortunately, the user has found a standard way to combine reports. FastReport.net users would probably be interested to know how to do this in their report generator.

Let's look at the code:

1
2
3
4
5
6
7
8
9
10
11
Report report = new Report();
 DataSet data = new DataSet();
 data.ReadXml("K:/My documents/nwind.xml");
 report.RegisterData(data);
 report.Load("K:/My documents/Master-Detail.frx");
 report.Prepare();
 report.Load("K:/My documents/Highlight.frx");
 report.Prepare(true);
 report.Load("K:/My documents/Barcode.frx");
 report.Prepare(true);
 report.ShowPrepared();

 As you can see, we sequentially load three different reports into the same report object.

At the same time, after each loading of the report, we need to build the report using the Prepare() method. But as you have noticed, for the second and third reports, we used this method with the Prepare(true) parameter. This parameter indicates that you should add pages to the existing ones, not clear them before adding them. Now, let's run the application and take a look at the report:

Combined reports

As we can see, all three reports are drawn up one after the other. Moreover, with this method of combining reports, page numbering is through. For example, the last report displays page number 4 at the bottom:

Numbering range works for combined reports

 

In this way, you can merge reports unnoticed by the user. Depending on the required content, you can create different assemblies from the reports. There is no need to create large and complex multi-page reports. You can instruct different people to create several simple reports and at the end, when displayed, you can combine them. Yes, in this case you will have several templates, but the prepared report file in fpx format will be one.

ürün hakkında satın al
avatar
Dmitriy Fedyashov
Technical Writer
Fast Reports Team: Dmitriy Fedyashov - Technical Writer at Fast Reports
.NET FastReport Report

Yorum ekle
logo
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314
  • Satın al
  • İndir
  • Dökümantasyon
  • Geribildirimler
  • Ürünlerimizi nasıl kaldırabilirsiniz
  • SSS
  • Başlangıç için Video
  • Forum
  • Support SLA
  • Articles
  • Haberlerimiz
  • Basında Biz
  • Partnerler
  • Extended licensing
  • Bize Ulaşın

© 1998-2023 by Fast Reports Inc.

  • Gizlilik Politikası

Trustpilot