float : totalPercent dec(2),totalPriceByCountry dec(2),totalPriceByEmployee dec(2),TotalPrice dec(2),totalDetailPrice dec(2) ; Char : formaNum1:128,formatotalEdit:128,formatotalLevel:128,formatotalpercent:128, fileCssStyle:255; INTEGER : Totalorders,TotalEmployee,totallevelNum,Sql_totalOrderId,totalcountry,TotalordersByEmployee,TotalordersBycountry; double : $total01 dec(2),$total02 dec(2),$total03 dec(2) ; #include "#SYSPATHMANDRAGORE+\02-DEMO-DESKTOP-BI-EXCELandSTANDARD\99-DATABASE\VersionADO\300-00-CreateDBDemoExcel.ms4" GetDirSysPathMANDRAGORE(LpathDataBaseExcel); Concatene LpathDataBaseExcel,"\zInclude\css\StyleReportDesign\standardStyleReport.css" into fileCssStyle; ** Concatene LpathDataBaseExcel,"\zInclude\css\StyleReportDesign\13-style-background-image.css" into fileCssStyle; BEGIN DBconnect{Ms4DB}(LEnvDemoExcelDB); Ms4_Query{ms4db} option : into $MS4DBTMP (" SELECT a.orderID ,a.employeeid,a.LastName ,a.productID," + " a.unitprice, a.quantity,a.CustomerID , a.productID,a.ShipName, " + " a.ShipAddress,a.ShipCity,a.ShipRegion,a.ShipPostalCode,a.ShipCountry,strftime('%Y',orderDate) as Yearbusiness " + " from [ms4EmplConsolidationBusiness] as a " + " WHERE Yearbusiness in('2011') order by a.employeeID, a.shipcountry "); Sql_DestroyEnv(); ENd ; ** ***************************************** ** REPORT ** ***************************************** printlog(1); DECLARE SCHEMA_REPORT : ReportDesign { INTEGER : OrderID ,EmployeeID,ProductID ,Quantity ; TEXT : LastName , CustomerID , ShipName, ShipAddress,ShipCity,ShipRegion,ShipPostalCode,ShipCountry ,Yearbusiness; REAL : unitprice dec(2) ; } ; Begin_Report REPORTINPUT : DBconnect { Ms4DB} ($MS4DBTMP) use View ($ms4ViewDBtmp) REPORTFORM:DESIGN Group Order by : ReportDesign.EmployeeID ,ReportDesign.Shipcountry,ReportDesign.orderID CssLink : fileCssStyle, CssId:"ms4report" Start_Design : Totalise $total01 as ReportDesign.unitprice $total02 as ReportDesign.Quantity $total03 as formula("(%r*%i)",ReportDesign.unitprice,ReportDesign.Quantity) End_Totalise Report_Header Print : " "; Print : "

Mandragore Planete - Trial Version : BUSINESS 2011 Report : Employee by Country, By Orders

",date, time ; Print : " -- ( update style Css : \MandragorePlanete\MANDRAGORE\zInclude\css\StyleReportDesign\xxxxxxxxxxxx.css) -- " ; END_Report_Header Group_Header : 01 ** EMPLOYEE level : 01 ,02,03 etc.. END_Group_Header Group_Header : 02 ** COUNTRY level : 01 ,02,03 etc.. END_Group_Header Group_Header : 03 ** OrderID level : 01 ,02,03 etc.. TotalordersBycountry++; TotalordersByEmployee++; Totalorders++; END_Group_Header Group_Break : 02 ** COUNTRY Totalcountry++; TotalordersByCountry:=0;totalPriceByCountry:=0; End_Group_Break Group_Break : 01 ** EMPLOYEE Print TD : " ** **##Break Employee : ** ", ReportDesign.EmployeeID, ReportDesign.LastName ," ** Total Price Units : ** ",$total01," ** Total Quantity : ** ",$total02," ** Total business : ** ",$total03,"total Orders: " ,TotalordersByEmployee,"Total country ",Totalcountry; TotalEmployee++;Totalcountry:=0;TotalordersByemployee:=0;totalPriceByemployee:=0; END_Group_Break ReportTotal Array DataFormat Occurs 5 { CHAR zlabel :128 ; } ; str_format(DataFormat[1].zlabel," ##b TOTAL ORDERS: %i ##b ", Totalorders); str_format(DataFormat[2].zlabel," ##b TOTAL EMPLOYEE: %i ##b ",TotalEmployee); str_format(DataFormat[3].zlabel," ##b $TOTAL03: Business
%d$ ##b
", $Total03); str_format(DataFormat[4].zlabel," ##b $TOTAL01: Price Unit
%d$ ##b
", $Total01); str_format(DataFormat[5].zlabel," ##b $TOTAL02: qte
%d ##b
",$Total02) ; Print TD :DataFormat[1].zlabel; Print TD : DataFormat[2].zlabel; Print TD : DataFormat[3].zlabel,DataFormat[4].zlabel,DataFormat[5].zlabel; End_ReportTotal End_Report ;