Merging pages

Stimulsoft Reports.NET discussion
Post Reply
zreptil
Posts: 18
Joined: Tue Aug 19, 2008 1:17 am

Merging pages

Post by zreptil »

Hi there,

i try to merge the pages of one report with the pages of another report. the elements of the pages from the second report should be placed on the pages of the first report.

up to now i use a loop that cycles through the pages of the second report and within this loop i cycle through the components of the page and add them to the same page in the first report.
8

Code: Select all

      
int idx = 0;

foreach (StiPage page in rep2.Pages)
{
  if (rep1.Pages.Count < idx)
    _rep1.Pages.Add(new StiPage());

  foreach (StiComponent item in page.Components)
  {
     item.Name += string.Format("_{0}_{1}", idx, rep1.Pages[idx].Components.Count);
     rep1.Pages[idx].Components.Insert(0, item);
  }
  idx++;
}
But this has some disadvantages since i have also to merge the used assemblies and the datasources. is there a simplier way to accomplish this task?

thanks in advance

andi
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Merging pages

Post by Jan »

Hello Andi,

Please add also following line of code in your cycle:

Code: Select all

item.Page = rep1.Pages[idx];
But this has some disadvantages since i have also to merge the used assemblies and the datasources. is there a simplier way to accomplish this task?
You can get list of referenced assemblies at report.ReferencedAssemblies property. Data sources available at report.Dictionary.DataSources.

Thank you.
Post Reply