** ****************************************************************************************** * ** MANDRAGORE PLANETE *** ******************************************************************************************* #include "#SYSPATHMS4BI+\zInclude\includeChart.h" #include "#SYSPATHMS4BI+\zInclude\IncludeChartExcel.h" #include "#SYSPATHMS4BI+\zInclude\IncludeDisplay.h" Array DataDashGreatLow Occurs 2 { CHAR Province :25 ; INTEGER TotalPopul ; } ; Array DataDash Occurs 40 { CHAR Province :25 ; INTEGER TotalPopul ;char mapcode:5 ; } ; Array DataDashcity Occurs 40 { CHAR city :25 ; CHAR latitude:12 ; CHAR longitude:12 ; } ; Array DashFormat Occurs 40 { CHAR zlabel :128 ; } ; Array DashFormatArrays Occurs 40 { CHAR stringVal :128; }; Array DashFormatArrays2 Occurs 40 { CHAR stringVal :128; } ; text : LocalServerDB :="#WWWMS4BISERVER+\Ms4BI-DemoUnicodeCube.db"; text : ztable :="ms4TotalPopulByProvinceMapCode",FormOutputchar ; integer : i,y,yes, no, msgsql,TRUE :=1,false:=0,ztotalPopulGreat:=0,ztotalPopulLow := 9999,zTotalCount; printlog(1); text : LCurrentDir1 , LcurrentDirExcel ; Getcurrentdir(LCurrentDir1); Concatene LCurrentDir1,"japaneseExampleSmall.xls" into LcurrentDirExcel ; StringReplaceAll(LcurrentDirExcel,"\","/"); ** ************************************************************ ** DISPLAY DASHBOARD RWD ** *********************************************************** BEGIN ** ----------->LOCALPC<---------------------------------------------------------------- DBconnect{Ms4DB}(LocalServerDB); ViewExist{ms4db}("ViewCount") Return ( msgsql) ; /* 2 return codes : TRUE or FALSE */ ** msgsql = 1 : Ok , msgsql = 0 Not ok */ if ( msgsql = TRUE) then Ms4_sql{ms4db} ( " Drop View [ViewCount] "); end_if ; Ms4_sql{ms4db} ( " Create View [ViewCount] as SELECT count(*) FROM [%s] ",zTable); Ms4_SQLFetch{ms4db}("SELECT * FROM [ViewCount] ") Row_ForEach : zTotalCount := Column_GetData:1,INTEGER; Display "->[Table & count ] : " ,zTable," : ",zTotalCount; End_Row_ForEach ; Ms4_sql{ms4db} ( " Drop View [ViewCount] "); Perform InsertArray1(void); Perform InsertArray2(void); Str_Format(DashFormat[1].zlabel," ##b Nb Province : \n %i ##b \n\n\n ",ZTotalcount) ; Clear FormOutputchar; Num_str DataDashGreatLow[1].totalPopul to FormOutputchar Format "8.0" ; /* conversion numeric to char */ Str_Format(DashFormat[2].zlabel,"###b HIGHEST PROVINCE: %s ###b ##b %s ##b __(thousand people)__ ",DataDashGreatLow[1].Province,FormOutputchar) ; Clear FormOutputchar; Num_str DataDashGreatLow[2].totalPopul to FormOutputchar Format "8.0" ; /* conversion numeric to char */ Str_Format(DashFormat[3].zlabel,"###b LOWEST PROVINCE: %s ###b ##b %s ##b __(thousand people)__ ",DataDashGreatLow[2].Province,FormOutputchar) ; Display "->END-----[Table & count ] : " ,zTable," : ",zTotalCount; ** TOP !! for select , dash.. integer iTop :=10; Num_str iTOP to FormOutputchar ; /* conversion numeric to char */ Str_Format(DashFormat[4].zlabel,"##b TOP %i ##b ",iTOP) ; END ; ** ----------->LOCALPC<---------------------------------------------------------------- ** ********************************************************************** ** DRAW : RWD (responsive) : data, charts, UI : button, Icon, Panel, table responsive ** ********************************************************************** ** 12 columns max ** xs (for phones - screens less than 768px wide) ** sm (for tablets - screens equal to or greater than 768px wide) ** md (for small laptops - screens equal to or greater than 992px wide) ** lg (for laptops and desktops - screens equal to or greater than 1200px wide) ** ********************************************************************** BEGIN ** ----------->SERVER<---------------------------------------------------------------- Begin_Block_Rwd : full_page Setting : Backgroundcolor : "gray" ; printsw (" /w #c MS4BI by Mandragore Planete - CHINA - Population by Province (example !) -- %s %s -- #c /w ", date, time) ; /* marker down : #c = H1 + center */ >, /* end col xs:4 */ , > /* end col xs:8 */ > /* end Row 2 */ > /* end div */ > /* end col lg:3 */ > /* end col xs:4 */ > /* end col xs:8 TOP PROVINCE*/ > /* end Row 2 */ > /* end div */ > /* end col lg:3 */ >,/* end col xs:4 */ >, /* end col xs:8 */ > /* end Row 2 */ > /* end div */ > /* end col lg:3 */ >,/* end col xs:4 */ >, /* end col xs:8 LOW province*/ > /* end Row 2 */ > /* end div */ > /* end col lg:3 */ >; /* end Row 1 */ /* end div */ > /* end col lg:4 */ >>,/* end col xs:4 */ , , > FormLeaflet : DRAWGEOMAP ID: "mymap", SetView(31.934572,118.312164), Zoom : 4.3 , height :"270px",width : "380px" loadArray DashFormatArrays2 { field : "stringVal" } , begin_sw var influence = L.circle([39.913818,116.363625], 160000).addTo(mymap); var circle = L.circle([33.391376,117.557678], { color: 'red', fillColor: '#f03', fillOpacity: 0.5, radius: 150000 }).addTo(mymap); circle.bindPopup("I am a circle."); var polygon = L.polygon([ [27.518280, 120.425766], [32.540447,119.243889], [27.934572,116.312164] ]).addTo(mymap); polygon.bindPopup("I am a polygon."); var popup = L.popup() .setLatLng([35.8617,104.1954]) .setContent("CHINA.") .openOn(mymap); end_sw > /* end div */ > /* end col lg:6 */ > ; /* end Row 2 */ /* conditional as possible */ msgsql := true ; /* change this True */ if ( msgsql = TRUE) then , , >>,/* end col xs:4 */ /* end div */ DBconnect{Ms4DB}($MS4DBTMP), FormMorris : DrawBar , title :"" ,TYPE : $BAR , FORMAT :"Th" use View ($MS4VIEWDBTMP) >, /* end div */ > > /* end col lg:6 */ >; end_if ; < Rwd_Row + $bg_success : 4 < Rwd_Col : sm:8,md:6,lg:4 :
> 2 THEN " + " substr(province,1,2) " + " ELSE " + " province " + " END Shortprovince, " + " TOTALThousandPopulationByProvince from ms4TotalPopulByProvince " ), setting : chart : legend :0, FormPchart : DrawPLOT, title : "" , ImageAera :520, 285 ,TYPE : $STANDARD, FORMAT :"th" use View ("tmp_gentable_ms40015") , , , , , > , FormExcel : DrawGrid , title : "" , use loadfile : LcurrentDirExcel , > > < Rwd_Col : sm:8,md:6,lg:3 : , , , >,/* end body panel */ > /* end panel */ > > ; , > >; /* end div */ > /* end col lg:6 */ < Rwd_Col : sm:2,md:2,lg:1 : DBconnect{Ms4DB}(LocalServerDB), FormPlus : DrawQrCODE type : $MAIL ("http://www.mgplanete.com") , > > ; /* end div */ >; /* end col lg:2 */ END_Block_Rwd ; ** ***************** REPORTS : TAB = DASBOARD ! ************************************************************************ InsertCssAndDashBoard(void); Begin_Block_Rwd : full_page >,/* end col xs:4 */ >, /* end col xs:8 */ > /* end Row 5 */ > /* end div */ > /* end col lg:2 */ >,/* end col xs:4 */ >, /* end col xs:8 */ > /* end Row 5 */ > /* end div */ > /* end col lg:2 */ >,/* end col xs:4 */ >, /* end col xs:8 */ > /* end Row 5 */ > /* end div */ > /* end col lg:2 */ >,/* end col xs:4 */ >, /* end col xs:8 */ > /* end Row 5 */ > /* end div */ > /* end col lg:2 */ >,/* end col xs:4 */ >, /* end col xs:8 */ > /* end Row 5 */ > /* end div */ > /* end col lg:2 */ , >,/* end col xs:4 */ , > /* end col xs:8 */ > /* end Row 2 */ > /* end div */ > /* end col lg:3 */ >; , , printsw " profile" > /* end div */ > /* end div */
printsw "
" ,/* it s possible! */