Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Set Master Page from beforeFactory?
millvall
Is there way to programmatically assign the master page to the overall report from beforeFactory, rather than from an element? (I've tried a few things but could not find a way to set the mpage from beforeFactory or Init.)
Using 2.3.1.
I can put JS in the 1st element in the body, but that seems rather clumsy. The master page seems to me a page level concept, rather than an element level feature.
Fudgey solution: Have a Grid at the top of the Body, set the MP on the grid in JS, and put all elements inside. (PS: findelement() fails if searched for element is not 1st in the body. Maybe a bug)
Any better ideas welcome.
Thanks
Milt.
Find more posts tagged with
Comments
mwilliams
Hi Milt,
That's probably going to be as good of a solution as you'll find for this. The master page is settable by element because of the ability to use multiple master pages per report. Any element in the report past the element that you set the master page for will also use this master page if a specific one is not specified for any element after.
On the issue with the find element not working unless it's the first element, can you recreate this with the sample database so I can see it? Thanks.
millvall
Good Morning Michael,
Thanks for reply even in holiday time.
I think I've worked out what is happening, and it seems to make sense.
The apparent odd report is due to multiple master pages.
I have a label at the top of the report, outside the container grid.
This Label will use master page 1, the default master page.
The grid immediately below is programmatically set to use master
page 2. So, a page break is forced. Obviously, you can *not* have
items on the same visible page sitting on a different master pages.
Master page 2 stays in effect for all ensuing elements, even those
outside the grid, until mater page is switched again.
* My original request might be nice however.
eg: I have master pages say: MP_HTML, MP_PDF, MP_DOC.
Depending on the output format, it would be nice to set the desired
master page as the default style for the whole report. Essentially,
reorder the <page-setup> portion of the XML and push the desired
master page to the top.
<page-setup>
<simple-master-page name="MP_HTML" id="2">
<property name="topMargin">0.25in</property>
......
</simple-master-page>
<simple-master-page name="MP_PDF" id="11">
....
</simple-master-page>
<simple-master-page name="MP_DOC" id="45">
</simple-master-page>
</page-setup>
Thanks for reply.
Milton.
mwilliams
Milton,
As long as you set the first item in the report to the master page you want and no other item is set, the report should all default to the one you set. So, if you want a different master page for each output, you should be able to just grab what output type you're doing and change the master page based on that in script. I haven't done it, but it should be possible. Let me know if you have issues with this.
Happy New Year.