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)
How do I filter at render time from rptdocument
grather
<p>I have a report that outputs to PDF.</p>
<p> </p>
<p>My requirements have changed since I started.</p>
<p> </p>
<p>What is working right now using the RunAndRender</p>
<p>I do the query returns (For Example) 6 records.</p>
<p> </p>
<p>The report then outputs one page per record.</p>
<p> </p>
<p>So I end up with 6 pages in PDF.</p>
<p>
</p>
<p>My New requirements is to return 6 different PDF's</p>
<p> </p>
<p>I was thinking to take advantage of Run Then Render (Two different steps)</p>
<p> </p>
<p>So I broke this up and it works</p>
<p> </p>
<p>I Run and end up with rptdocument with six records.</p>
<p> </p>
<p>Then I send the renderTask.render and I end up with the original PDF with 6 pages.</p>
<p> </p>
<p>So I feel I am still doing good.</p>
<p> </p>
<p>
</p>
<p>How do I render just one page. The loop through rendering each page separately.</p>
<p> </p>
<p>I know what I want just not quite sure how to do it.</p>
<p> </p>
<p>Gary</p>
<p> </p>
<p> </p>
Find more posts tagged with
Comments
mwilliams
<p>One possibility could be to create your report with a optional parameter for the record number or whatever unique value you have for the 6 records also a boolean parameter called "firstRun". On first run from your application, you'd pass true through first run and no value through the other parameter. This would return all 6 records or whatever. From there, you could write code in the onCreate of your table row to run the report again with firstRun set to false and the current row's value through the other parameter.</p>
<p> </p>
<p>You'd just need to check the firstRun parameter to keep from running the onCreate script the second time the report is run. You could also handle this by creating a master and detail report to run the master which would automatically run the detail report for all records. Let me know if you have questions or would like a sample. There may already be something like this in the devshare or in the blog. If I find a post, I'll link it in here.</p>
grather
<p>I actually go this to work.</p>
<p>My requirements were to create individual pdf files saved to file system (One per record to the file system)</p>
<p>And to also return the full collection of Records in one PDF.</p>
<p> </p>
<p>So What I did was run then render the report.</p>
<p> </p>
<p>I output to a rpt document and created a bookmark for each record I wanted.</p>
<p> </p>
<p>I then created a render task for each wanted file. But instead of passing the response output stream</p>
<p>I passed a file output stream.</p>
<p>I then opened the rptdocument and retrieved the list of book marks.</p>
<p> </p>
<p>I then set the pageRange from the info in the rptdocument in the renderTask.</p>
<p> </p>
<p>I then rendered each individual pdf into its file.</p>
<p>then after the loop where each individual file was created</p>
<p> </p>
<p>I did one more but this time passing in the response output stream and did not use pageRange.</p>
<p>I then have individual files saved on the file system</p>
<p>And returned to the user a full PDF.</p>
<p> </p>
<p>Works great.</p>
<p>And the only change was learning about bookmarks and pageRange in the render task.</p>
<p> </p>
<p>Gary</p>
mwilliams
<p>Great to hear! Thanks for the update!
</p>