Question about Excel Listings and how to get the data into them....

Model: StatementGroup -one-2-many- Statements

Customer wants on pageConfiguration = "ListStatementGroup" an Excel link to 
download a group listing. That is easy, I have this kind of thing working all 
over my app. But now the customer wants the Statements listed under the 
StatementGroup. So what the customer actually wants is not 
ListExcelStatementGroup but ListExcelStatement for all the selected groups. Any 
good ideas?

I currently use the following code for all my Excel download links (bound to a 
belowDisplayPropertyKey on several of the List* pageConfigurations)

    public WOActionResults downloadExcel() {

        ERD2WListPage parentListPage = parentListPage();
        if (parentListPage != null) {
                EODataSource dataSource = 
parentListPage.displayGroup().dataSource();
                D2WContext d2wContext = parentListPage.d2wContext();
                String entityName = (String)d2wContext.valueForKeyPath( 
"entity.name" );
                
d2wContext.takeValueForKey(d2wContext.valueForKey("entity.name") + ".xls", 
"excelFileName");
                ListPageInterface lpi = 
(ListPageInterface)D2W.factory().pageForConfigurationNamed( "ListExcel" + 
entityName, session() );
                lpi.setDataSource( dataSource );
                lpi.setNextPage( this.context().page() );
                return (WOActionResults)lpi;
        }
        return null;
    }

I think I need to create a new dataSource for the Statements and qualify it 
with the dataSource from the parentListPage. How would I do this? Do I have to 
do this manually or is there some simple way calling the right methods? Or is 
there an altogether different and better way?

Thanks for any help
---markus---


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to