| | |
| | | Description: 'ä¸è½½è´¢å¡æ¥è¡¨æ°æ®' |
| | | TextBody: |
| | | [* |
| | | |
| | | //è·åæ¥è¯¢è¡æ° |
| | | searchrowsize := InventorySummarySource::GetSearchRows( factorys, generations, powers, mlbmqls ); |
| | | table := selectobject( macroPlan, InventorySummarySource.InventorySummaryReport, table, table.IsShow() ); |
| | | |
| | | xmlDOMI := XMLDOMImplementation::Create(); |
| | | xmlDOM := xmlDOMI.CreateDocumentFromString( '<?xml version="1.0" encoding="UTF-16"?><table><name>' + table.Name() + '</name></table>' ); |
| | | |
| | | tableElement := xmlDOM.GetElementByTagName( "table", 0 ); |
| | | //Search |
| | | searchcolumnelement := xmlDOM.CreateElement( "column" ); |
| | | searchnameelement := xmlDOM.CreateElement( "name" ); |
| | | searchtypeelement := xmlDOM.CreateElement( "type" ); |
| | | searchnameelement.TextContent( 'Search' ); |
| | | searchtypeelement.TextContent( "String" ); |
| | | searchcolumnelement.AppendChild( searchnameelement ); |
| | | searchcolumnelement.AppendChild( searchtypeelement ); |
| | | //Product |
| | | productcolumnelement := xmlDOM.CreateElement( "column" ); |
| | | productnameelement := xmlDOM.CreateElement( "name" ); |
| | | producttypeelement := xmlDOM.CreateElement( "type" ); |
| | | productnameelement.TextContent( 'Product' ); |
| | | producttypeelement.TextContent( "String" ); |
| | | productcolumnelement.AppendChild( productnameelement ); |
| | | productcolumnelement.AppendChild( producttypeelement ); |
| | | //Unit |
| | | unitcolumnelement := xmlDOM.CreateElement( "column" ); |
| | | unitnameelement := xmlDOM.CreateElement( "name" ); |
| | | unittypeelement := xmlDOM.CreateElement( "type" ); |
| | | unitnameelement.TextContent( 'Unit' ); |
| | | unittypeelement.TextContent( "String" ); |
| | | unitcolumnelement.AppendChild( unitnameelement ); |
| | | unitcolumnelement.AppendChild( unittypeelement ); |
| | | //Attribute |
| | | attricolumnelement := xmlDOM.CreateElement( "column" ); |
| | | attrinameelement := xmlDOM.CreateElement( "name" ); |
| | | attritypeelement := xmlDOM.CreateElement( "type" ); |
| | | attrinameelement.TextContent( 'Attribute' ); |
| | | attritypeelement.TextContent( "String" ); |
| | | attricolumnelement.AppendChild( attrinameelement ); |
| | | attricolumnelement.AppendChild( attritypeelement ); |
| | | //Product/Unit |
| | | factoryvalues := selectuniquevalues( factorys, Elements, factory, factory.Name() ); |
| | | productcolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, factoryvalues, 'Unit', searchrowsize ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, productcolumnelement, 'Product' ); |
| | | //Unit/Generation |
| | | generationvalues := selectuniquevalues( generations, Elements, generation, generation.Generation() ); |
| | | unitcolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, generationvalues, 'Generation', searchrowsize ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, unitcolumnelement, 'Unit' ); |
| | | //Attribute/Power |
| | | powervalues := selectuniquevalues( powers, Elements, power, power.Power() ); |
| | | attricolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, powervalues, 'Power', searchrowsize ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, attricolumnelement, 'Attribute' ); |
| | | //MLBMQBS |
| | | mlbmqbvalues := selectuniquevalues( mlbmqls, Elements, mlbmqb, mlbmqb.MLBMQB() ); |
| | | mlbmqlcolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, mlbmqbvalues, 'MLBMQB', searchrowsize ); |
| | | //Start date |
| | | startcolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, search.StartDate().Format( 'M2/D2/Y' ), 'Start date', searchrowsize ); |
| | | //End date |
| | | endcolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, search.EndDate().Format( 'M2/D2/Y' ), 'End date', searchrowsize ); |
| | | //Period |
| | | periodcolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, search.Category(), 'Period', searchrowsize ); |
| | | |
| | | tableElement.AppendChild( searchcolumnelement ); |
| | | tableElement.AppendChild( productcolumnelement ); |
| | | tableElement.AppendChild( unitcolumnelement ); |
| | | tableElement.AppendChild( attricolumnelement ); |
| | | searchtotal := factorys.Size() + generations.Size() + powers.Size() + mlbmqls.Size() + 10 ; |
| | | searchunitElement := xmlDOM.CreateElement( "cell" ); |
| | | searchunitElement.SetAttribute( "value", 'Unit' ); |
| | | searchcolumnelement.AppendChild( searchunitElement ); |
| | | traverse( factorys, Elements, factory ){ |
| | | searchunitcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchunitcellElement.SetAttribute( "value", factory.Name() ); |
| | | searchcolumnelement.AppendChild( searchunitcellElement ); |
| | | } |
| | | searchgenerationElement := xmlDOM.CreateElement( "cell" ); |
| | | searchgenerationElement.SetAttribute( "value", 'Generation' ); |
| | | searchcolumnelement.AppendChild( searchgenerationElement ); |
| | | traverse( generations, Elements, generation ){ |
| | | generationcellElement := xmlDOM.CreateElement( "cell" ); |
| | | generationcellElement.SetAttribute( "value", generation.Generation() ); |
| | | searchcolumnelement.AppendChild( generationcellElement ); |
| | | } |
| | | searchpowerElement := xmlDOM.CreateElement( "cell" ); |
| | | searchpowerElement.SetAttribute( "value", 'Power' ); |
| | | searchcolumnelement.AppendChild( searchpowerElement ); |
| | | traverse( powers, Elements, power ){ |
| | | searchpowercellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchpowercellElement.SetAttribute( "value", power.Power() ); |
| | | searchcolumnelement.AppendChild( searchpowercellElement ); |
| | | } |
| | | searchmlbmqlElement := xmlDOM.CreateElement( "cell" ); |
| | | searchmlbmqlElement.SetAttribute( "value", 'MQBMLB' ); |
| | | searchcolumnelement.AppendChild( searchmlbmqlElement ); |
| | | traverse( mlbmqls, Elements, mlbmql ){ |
| | | searchmlbmqlcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchmlbmqlcellElement.SetAttribute( "value", mlbmql.MLBMQB() ); |
| | | searchcolumnelement.AppendChild( searchmlbmqlcellElement ); |
| | | } |
| | | searchstartdateElement := xmlDOM.CreateElement( "cell" ); |
| | | searchstartdateElement.SetAttribute( "value", 'Start date' ); |
| | | searchcolumnelement.AppendChild( searchstartdateElement ); |
| | | searchstartdatecellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchstartdatecellElement.SetAttribute( "value", search.StartDate().Format( 'M2/D2/Y' ) ); |
| | | searchcolumnelement.AppendChild( searchstartdatecellElement ); |
| | | searchenddateElement := xmlDOM.CreateElement( "cell" ); |
| | | searchenddateElement.SetAttribute( "value", 'End date' ); |
| | | searchcolumnelement.AppendChild( searchenddateElement ); |
| | | searchenddatecellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchenddatecellElement.SetAttribute( "value", search.EndDate().Format( 'M2/D2/Y' ) ); |
| | | searchcolumnelement.AppendChild( searchenddatecellElement ); |
| | | searchperiodElement := xmlDOM.CreateElement( "cell" ); |
| | | searchperiodElement.SetAttribute( "value", 'Periods' ); |
| | | searchcolumnelement.AppendChild( searchperiodElement ); |
| | | searchperiodcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchperiodcellElement.SetAttribute( "value", search.Category() ); |
| | | searchcolumnelement.AppendChild( searchperiodcellElement ); |
| | | |
| | | for( i := searchtotal; i < table.InventroySummaryRow( relsize ) * 4; i := i + 1 ){ |
| | | searchcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement.SetAttribute( "value", '' ); |
| | | searchcolumnelement.AppendChild( searchcellElement ); |
| | | searchcolumn := 7 ; |
| | | rowsize := table.InventroySummaryRow( relsize ) * 4; |
| | | for( i := table.InventorySummaryColumn( relsize ); i < searchcolumn - 3; i := i + 1 ){ |
| | | if( i = 0 ){ |
| | | InventorySummarySource::CreateCellElement( xmlDOM, mlbmqlcolumnelement, '', rowsize ); |
| | | }else if( i = 1 ){ |
| | | InventorySummarySource::CreateCellElement( xmlDOM, startcolumnelement, '', rowsize ); |
| | | }else if( i = 2 ){ |
| | | InventorySummarySource::CreateCellElement( xmlDOM, endcolumnelement, '', rowsize ); |
| | | }else if( i = 3 ){ |
| | | InventorySummarySource::CreateCellElement( xmlDOM, periodcolumnelement, '', rowsize ); |
| | | } |
| | | } |
| | | |
| | | traverse ( table, InventorySummaryColumn, column ) { |
| | | columnelement := xmlDOM.CreateElement( "column" ); |
| | | nameelement := xmlDOM.CreateElement( "name" ); |
| | | typeelement := xmlDOM.CreateElement( "type" ); |
| | | nameelement.TextContent( column.Name() ); |
| | | typeelement.TextContent( "String" ); |
| | | columnelement.AppendChild( nameelement ); |
| | | columnelement.AppendChild( typeelement ); |
| | | columnelement := null( XMLDOMElement ); |
| | | if( column.Index() = 0 ){ |
| | | columnelement := mlbmqlcolumnelement; |
| | | InventorySummarySource::CreateCellElement( xmlDOM, mlbmqlcolumnelement, column.Name() ); |
| | | }else if( column.Index() = 1 ){ |
| | | columnelement := startcolumnelement |
| | | InventorySummarySource::CreateCellElement( xmlDOM, startcolumnelement, column.Name() ); |
| | | }else if( column.Index() = 2 ){ |
| | | columnelement := endcolumnelement; |
| | | InventorySummarySource::CreateCellElement( xmlDOM, endcolumnelement, column.Name() ); |
| | | }else if( column.Index() = 3 ){ |
| | | columnelement := periodcolumnelement; |
| | | InventorySummarySource::CreateCellElement( xmlDOM, periodcolumnelement, column.Name() ); |
| | | }else{ |
| | | columnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, column.Name(), rowsize ); |
| | | } |
| | | |
| | | cells := selectsortedset( column, InventorySummaryCell, cell, cell.InventroySummaryRow().RowNr() ); |
| | | |
| | |
| | | if( column.Index() = 0 ){ |
| | | row := c.InventroySummaryRow(); |
| | | //Product |
| | | productcellElement1 := xmlDOM.CreateElement( "cell" ); |
| | | productcellElement1.SetAttribute( "value", row.Name() ); |
| | | productcolumnelement.AppendChild( productcellElement1 ); |
| | | productcellElement2 := xmlDOM.CreateElement( "cell" ); |
| | | productcellElement2.SetAttribute( "value", row.Name() ); |
| | | productcolumnelement.AppendChild( productcellElement2 ); |
| | | productcellElement3 := xmlDOM.CreateElement( "cell" ); |
| | | productcellElement3.SetAttribute( "value", row.Name() ); |
| | | productcolumnelement.AppendChild( productcellElement3 ); |
| | | productcellElement4 := xmlDOM.CreateElement( "cell" ); |
| | | productcellElement4.SetAttribute( "value", row.Name() ); |
| | | productcolumnelement.AppendChild( productcellElement4 ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, productcolumnelement, row.Name() ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, productcolumnelement, row.Name() ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, productcolumnelement, row.Name() ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, productcolumnelement, row.Name() ); |
| | | //Unit |
| | | unitcellElement1 := xmlDOM.CreateElement( "cell" ); |
| | | unitcellElement1.SetAttribute( "value", row.Unit() ); |
| | | unitcolumnelement.AppendChild( unitcellElement1 ); |
| | | unitcellElement2 := xmlDOM.CreateElement( "cell" ); |
| | | unitcellElement2.SetAttribute( "value", row.Unit() ); |
| | | unitcolumnelement.AppendChild( unitcellElement2 ); |
| | | unitcellElement3 := xmlDOM.CreateElement( "cell" ); |
| | | unitcellElement3.SetAttribute( "value", row.Unit() ); |
| | | unitcolumnelement.AppendChild( unitcellElement3 ); |
| | | unitcellElement4 := xmlDOM.CreateElement( "cell" ); |
| | | unitcellElement4.SetAttribute( "value", row.Unit() ); |
| | | unitcolumnelement.AppendChild( unitcellElement4 ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, unitcolumnelement, row.Unit() ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, unitcolumnelement, row.Unit() ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, unitcolumnelement, row.Unit() ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, unitcolumnelement, row.Unit() ); |
| | | //Attribute |
| | | //ææ«åºå |
| | | endcellElement := xmlDOM.CreateElement( "cell" ); |
| | | endcellElement.SetAttribute( "value", 'ææ«åºå' );//EndingInventory |
| | | attricolumnelement.AppendChild( endcellElement ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, attricolumnelement, 'ææ«åºå' );//EndingInventory |
| | | //æå°åºå |
| | | mincellElement := xmlDOM.CreateElement( "cell" ); |
| | | mincellElement.SetAttribute( "value", 'æå°åºå' );//MinimumInventory |
| | | attricolumnelement.AppendChild( mincellElement ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, attricolumnelement, 'æå°åºå' );//MinimumInventory |
| | | //æå¤§åºå |
| | | maxcellElement := xmlDOM.CreateElement( "cell" ); |
| | | maxcellElement.SetAttribute( "value", 'æå¤§åºå' );//MaximumInventory |
| | | attricolumnelement.AppendChild( maxcellElement ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, attricolumnelement, 'æå¤§åºå' );//MaximumInventory |
| | | //å¹³ååºå |
| | | avecellElement := xmlDOM.CreateElement( "cell" ); |
| | | avecellElement.SetAttribute( "value", 'å¹³ååºå' );//AverageInventory |
| | | attricolumnelement.AppendChild( avecellElement ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, attricolumnelement, 'å¹³ååºå' );//AverageInventory |
| | | |
| | | } |
| | | //ææ«åºå |
| | | endcellElement := xmlDOM.CreateElement( "cell" ); |
| | | endcellElement.SetAttribute( "value", [String]c.EndingInventory() ); |
| | | columnelement.AppendChild( endcellElement ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, columnelement, [String]c.EndingInventory() ); |
| | | //æå°åºå |
| | | mincellElement := xmlDOM.CreateElement( "cell" ); |
| | | mincellElement.SetAttribute( "value", [String]c.MinimumInventory() ); |
| | | columnelement.AppendChild( mincellElement ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, columnelement, [String]c.MinimumInventory() ); |
| | | //æå¤§åºå |
| | | maxcellElement := xmlDOM.CreateElement( "cell" ); |
| | | maxcellElement.SetAttribute( "value", [String]c.MaximumInventory() ); |
| | | columnelement.AppendChild( maxcellElement ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, columnelement, [String]c.MaximumInventory() ); |
| | | //å¹³ååºå |
| | | avecellElement := xmlDOM.CreateElement( "cell" ); |
| | | avecellElement.SetAttribute( "value", [String]c.AverageInventory() ); |
| | | columnelement.AppendChild( avecellElement ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, columnelement, [String]c.AverageInventory() ); |
| | | } |
| | | for( i := cells.Size() * 4; i < searchtotal; i := i + 1 ){ |
| | | searchcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement.SetAttribute( "value", '' ); |
| | | columnelement.AppendChild( searchcellElement ); |
| | | if( column.Index() = 0 ){ |
| | | productcellElement := xmlDOM.CreateElement( "cell" ); |
| | | productcellElement.SetAttribute( "value", '' ); |
| | | productcolumnelement.AppendChild( productcellElement ); |
| | | |
| | | unitcellElement := xmlDOM.CreateElement( "cell" ); |
| | | unitcellElement.SetAttribute( "value", '' ); |
| | | unitcolumnelement.AppendChild( unitcellElement ); |
| | | |
| | | endcellElement := xmlDOM.CreateElement( "cell" ); |
| | | endcellElement.SetAttribute( "value", '' );//EndingInventory |
| | | attricolumnelement.AppendChild( endcellElement ); |
| | | |
| | | } |
| | | } |
| | | |
| | | tableElement.AppendChild( columnelement ); |
| | | } |
| | | |