Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Using DataSet Elements in the Script
rhauschildt
<p>At the moment I am trying to build a proof of concept that its possible to dynamicly position elements within the report using Dataset elements in the Script. I have been able to hard code some postions in the onCreate step on the elements using code like:</p><p> </p><p>this.style.marginTop="10mm"</p><p> </p><p>What I am having a hardtime figuring out is how to pull in a dataset elements to populate the 10mm value above using another field like "dataSetRow". When I use it in the Script it says that dataSetRow is not defined.</p><p> </p><p>My Data Source is XML. Does anyone have any examples of how i could do this or at least an example of successfully pulling in and using a Dataset Element in the Script?</p><p> </p><p>Any thoughts would be much appriciated!</p><p> </p><p>Ryan</p>
Find more posts tagged with
Comments
mwilliams
<p>Is the element bound to the dataSet that has the margin value? If so, in your script, you'd simply use row["Date_Left_Position"], not dataSetRow. Let me know.</p>
rhauschildt
<p>What i ended up doing was making a table at the top of the report and on each element placed</p><p> </p><p>"reportContext.setPersistentGlobalVariable("Address_Left_Position", new Number(this.getRowData().getColumnValue("Address_Left_Position")));"</p><p> </p><p>in the script tab on create to declare it as a golabal variable. Then on each element i wanted to move based on the number values those variables provided I place the following script on create</p><p> </p><p>this.getStyle().marginLeft =reportContext.getPersistentGlobalVariable('Company_Address_Left_Position') +'mm'
this.getStyle().marginTop = reportContext.getPersistentGlobalVariable('Company_Address_Top_Position') +'mm'</p><p> </p><p>Its been working out great but now I'm running into another requirement issue where I need to conditionally hide a footer based on something like the pagebreak in a table in my layout. I'm not really sure how to go about doing it but finding a way to determine where the page breaks seemed logical.</p>