Search code examples
.net-corestimulsoft

How to fit image data column each image on one page


I'm using Stimul Report to create a report page. The report page shows correctly. I am reading an image for the stimulsoft web report from database.

Result shows many record image show two images on one page. But I want to show each image on a separate page.

enter image description here

This my code

 foreach (StiPage page in report.Pages)
 {
     page.Orientation = StiPageOrientation.Portrait;
     page.Margins.Top = 0;
     page.Margins.Bottom = 0;
     page.Margins.Left = 0;
     page.Margins.Right = 0;

     page.PaperSize = System.Drawing.Printing.PaperKind.A3;;  

     page.UnlimitedHeight = false;
     page.CanBreak = false;
}

var image = report.GetComponentByName("Image1") as StiImage;
image.CanBreak = true;

Solution

  • 1 -

    If you want to create one page for each record you can insert Panel in each page.

    • Set Panel Dock Style property to Fill;
    • And then place all your page components in it;
    • Set Panel Border property to All. if you dont want border around your data, you can set borders color to Transparent. but borders is needed for prevention of decreasing panel size.

    2 -

    Instead of creating one page for each record you can create one page template and use this and pass your list to report.

    For break page after each record(Person) you can use GroupHeaderBand and GroupFooterBand.

    1. Place GroupHeaderBand before of record template;
    2. Set headerband Condition property to your Page Number field like PageNumber; https://i.sstatic.net/tcnlT.png

    3. Place GroupFooterBand at end of the record template;

    4. Set footerband New Page After property to True. https://i.sstatic.net/KTq5E.png

    These two bands will show for each record and page breaks after each GroupFooterBand.