Originally Posted by bcharnz
|
Help
I have created a custom report based on the "proposal with images" and have made many modification with success. I am now trying to insert the "proposal Summary" into the last page of my proposal. I inserted it and am binding it to the "project summary" report. I am trying to show a summary that shows the total installed price for each "Zone" ie total for a/V systems and total for Structured wiring system and total for home theater systems and total for security system etc.... Just the grand totals. The problems is that the summary sub report uses the definition of the main report due to the dynamic feature. So if the main report is "by location by zone" the summary report sorts "by location by zone". I need the summary sub report to ALWAYS group by zone ONLY. How do I force this? I tried opening the sub report and in "edit report information" selecting "by zone" but this does not work when I run the main report.
|
Bill,
This is an interesting issue. The way the engine works is that the data is generated and sorted based on the settings of the main report. The idea being that the main data (BOM Items) are iterated over and the subreports simply support this with less detail.
Also, this is truly an optimization issue too. The processing cost to generate different XML documents for each sub report would be hugely costly and slow things way down.
In your use case, you're looking to iterate over the data sorted by Location, then Zone and then again in a sub report by Zone. We don't have a mechanism to re-sort the items in the XML data for sub reports.
All that said, I created a report with some script that will resort the items based on values passed:
Script Resort Demo
When you download the zip linked above and import the reports into the reporting center, you will see two reports are added (They'll probably be in the 'Uncategorized Reports' section).
The report named 'Resort In Script Demo' contains the block of script required to resort the items. This leverages some functionality the engine uses internally to sort the items. The script requried may be cut and pasted into any reports script. There are comments in-line to explain the usage, but it's pretty straight forward. The script is written to be be flexible. The demo resorts the items by Zone, but that can be changed by passing different parameters to the method.
The second report named 'Demo Proposal Resort Sub Report' is a proposal with the above mentioned report bound as a subreport. The only report defintion on the Demo proposal sorts the data by Location, Then Zone so you can see the changes.
One thing that you should not do is use this script in a sub report that is executed within the context of iterating over the items in the main report. This would potentially re-sort the items for the subreport everytime the sub report is run (potenitally once for every item in the report). It's not that this can't be done, it's more a matter of processing. the sorting will definitely take some time. As it is, it sounds as if you want to resort the items for the subreport after the main body of the main report is generated.
I think you'll find this will satisfy your needs. Again, the script may be cut and pasted into another report. It is not dependent on anything other than the reports datasource being the XML document we generate.
Hope this helps.
-R
Originally Posted by bcharnz
|
Also, separate issue, if I save the same sub report and check the check box in "edit report information" for "is a subreport" the sub report will not populate any info from within the main report....
Thanks very much for you help
Bill
|
Not sure what exactly what or why this is happening.