Reply
 
LinkBack Thread Tools Display Modes
Old 01-22-2008, 06:12 PM   #1 (permalink)
bcharnz
Guest
 
Posts: n/a
Default Help with Custom Report and Dynamic grouping

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.

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
  Reply With Quote
Old 01-23-2008, 11:58 PM   #2 (permalink)
RickC
Guest
 
Posts: n/a
Default

Originally Posted by bcharnz View Post
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 View Post
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.
  Reply With Quote
Old 01-24-2008, 03:37 PM   #3 (permalink)
bcharnz
Guest
 
Posts: n/a
Default

Rick

This worked awesome...thank you

I took my oringinal sub report "Proposal Summary" and simply pasted your script into it. I had to delete the "Sub ActiveReport_ReportStart" lines that were in the existing script as you had them defined again in your script.

I will try some of the other sorting options at some point in the near future.

Thanks gain for taking the time!
  Reply With Quote
Old 01-24-2008, 03:53 PM   #4 (permalink)
RickC
Guest
 
Posts: n/a
Default

Originally Posted by bcharnz View Post
Rick

This worked awesome...thank you

I took my oringinal sub report "Proposal Summary" and simply pasted your script into it. I had to delete the "Sub ActiveReport_ReportStart" lines that were in the existing script as you had them defined again in your script.

I will try some of the other sorting options at some point in the near future.

Thanks gain for taking the time!
Bill,

No problem. Glad it worked out for you.

On the "Sub ActiveReport_ReportStart" issue. Every report has a "ReportStart" event. Users can choose to add script to this event. When they do, the "Sub ActiveReport_ReportStart" signature is added to the script. This can only be in there once (as you saw).

The real key is that the required script for resorting is what I blocked in the "Begin" and "End" comments. It's simply that the "ResortItems" method that is defined in the script should be called in the "Sub ActiveReport_ReportStart" If the event signature already exists, just add the call. Otherwise if you select "ActiveReport" from the "Object" dropdown and "ReportStart" from the event dropdown, it will be created.

Anyway, I just wanted to clarify in case anyone else uses this and has the same issue.

-R
  Reply With Quote
Old 12-03-2009, 10:00 PM   #5 (permalink)
Senior Member
 
Join Date: Jul 2008
Location: Olympia, WA
Posts: 342
grichards is a jewel in the roughgrichards is a jewel in the roughgrichards is a jewel in the roughgrichards is a jewel in the rough
Send a message via Skype™ to grichards
Default

having trouble getting Ascending/Descending sorting to work. Im trying to set the sort order with the following:

Code:
     
Dim rc As New DTools.SystemIntegrator.Reporting.ReportCriteria()
Dim sort As DTools.SystemIntegrator.Reporting.SortOrder =  Nothing
sort = New DTools.SystemIntegrator.Reporting.SortOrder(FirstSortField, DTools.SystemIntegrator.Reporting.SortDirection.Descending)
rc.ReportSortings.Add(sort)
but it always seems to sort Ascending
__________________
Systems Technician/Crestron Certified Programmer
www.ccisolutions.com
[SIGPIC][/SIGPIC]
grichards is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
GrpDynamicHeaders, GrpDynamicFooters and Dynamic Bindings gnichols Reports and Reporting Center 3 01-20-2010 08:44 PM
Custom Properties in Reports grichards Reports and Reporting Center 27 07-12-2009 02:08 AM
sub report parameters grichards Reports and Reporting Center 0 06-23-2009 09:50 PM
How do I bind a new dynamic header? RJBM Reports and Reporting Center 0 04-24-2009 05:12 PM
Challanging summary report idea aantrim Reports and Reporting Center 0 12-18-2008 04:22 PM


All times are GMT. The time now is 02:33 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.0
D-Tools, Inc.