This is a migrated thread and some comments may be shown as answers.

Render a detail element in each page

3 Answers 228 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Giovanni
Top achievements
Rank 1
Giovanni asked on 22 Dec 2015, 11:14 AM

I'm new to telerik reporting and have been assigned a case that looks hasn't been discussed before, in specific I need to put a simple image on the left border which must be repeated on each page and is dependant from PageNumber and PageCounter, but is part of the detail section. I already know page related elements are bound to be for header and footer only, but this image must be in that specific point because is needed for an automatic envelope machine.

The only thing that comes to my mind would be to have an unbound group header have this image inside, so to be able to place the right one for each page, and make the detail section override it somehow, because it wouldn't really go over any element, just blank space left because of the required image.

 Are there some solutions you could suggest me to get over this?

Many thanks in advance, kind regards.

3 Answers, 1 is accepted

Sort by
0
Tristan
Top achievements
Rank 1
answered on 22 Dec 2015, 11:49 AM

Hi Giovanni, I'm new to Telerik too but have an idea which may work:

Add your image to the detail section, and then go to the image's "ConditionalFormatting" property.Make a new rule, then in the "Style" section, "Layout" subsection, untick the "Visible" tickbox.

Then in the "Filter" section of the rule you need to construct an expression that figures out if this detail is the first on the page, and evaluates to true if it isn't. Can't help you with the specifics of that but there should be a way I'd say.

That should then set "Visible = false" for the image on each detail row that isn't the first on a page.

0
Giovanni
Top achievements
Rank 1
answered on 22 Dec 2015, 03:36 PM
Hi Tristan, thanks for your reply but is not viable actually because the expression would need the concept of PageCount and PageNumber which aren't accessible from detail, as also is no more possible to use BeginRenderingPage event to create a custom function for it.

At the moment I had to use a tricky method to achieve my result, given the fact I only need to change first and last page image, the last page is in a second report from the report book, and mostly this report shouldn't be longer than 4 pages, I created a background image cutting out header and footer height, placing images at the right spot for the lenght of 4-5 pages, then place this as background image of the report with no repeat.
This method is not nice and not easily mantainable/reusable, so I'd still like to have a better way to make it, but still it does the job.
0
Stef
Telerik team
answered on 25 Dec 2015, 10:46 AM
Hello Giovanni,

Please test adding a static group in the report and to place the image in the GroupHeader/FooterSection. then set the group section's PrintOnEveryPage to true.

The approach will work if the image is the same for all pages. If the image should be different per page, you can:
  1. Use the above described layout, where da will have to be separated between different reports - each report will have its own image in the GroupHeader/FooterSection;
  2. Place the image in the PageHeader/FooterSection and use the global PageCount and PageNumber objects;


For more details, please check Report Structure and Understanding Rendering Behaviors.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Giovanni
Top achievements
Rank 1
Answers by
Tristan
Top achievements
Rank 1
Giovanni
Top achievements
Rank 1
Stef
Telerik team
Share this question
or