** ****************************************************************************************** * ** MANDRAGORE ** ******************************************************************************************* #include "#SYSPATHMS4BI+\zInclude\IncludeSysMs4Windows.h" ** GLOBAL VAR CHAR : ztypeMeasure:50,zMeasure:50,lsetWintext:255,ldirApp:128; INTEGER : Msgsql,X ,no:=0,yes:=1,row ,i; Long : color1,color2,color3; ** ****************************************************************************************** * ** (ms4 script) - MS4 BI PROFESSIONAL for WINDOWS & WEB- : display DATABSE ** ******************************************************************************************* CHAR :lObject:128, LEnvDB:512 ; INTEGER : Exit_TRANS1 , Lig,Col,gPosit :=10 ; CHAR : Text1:128 ; Setting : Chart : ToolBarExport : no ; x:=GetInputArgument(1:LEnvDB); if( x != TRUE) then MsgBox : Title " LOAD DB : " Message : " NOT FOUND : NO ARGUMENT..exit !" Column 10 Button : Mb_OK Icon : Mb_IconExclamation ; Exit; end_if ; GetInputArgument(2:lObject); Begin_Transaction : Trans1 Execute Transaction With Exit_TRANS1 != 1 Begin_Dialog BackgroundColor : Color(192,193,218) WinExtendStyle : :Ws_Ex_DlgModalFrame WinStyle : :Ws_POPUP 680,10,540,630 , " Cube",UserDialog Frame 1, 1,530,30, Wtitle4 Attribut : ** MgPlanete FillColor : 236,215,143 FrameColor : 166, 69,111 ShadowText : 1,2 Color(0,0,0) SetColorText : 185,50,90 DrawText : Dt_RIGHT SetFonts : 22,8,0,0,Fw_BOLD,0,0,0,"Calibri" ** MgPlanete Frame 1,31,530, 30, Frame42 Attribut : FillColor : 236,215,191 FrameColor : 166, 69,111 SetColorText : 0,0,0 DrawText : Dt_center SetFonts : 24,6,0,0,Fw_NORMAL,0,0,0,"Calibri" Frame 1,590,530, 30, Frame43 Attribut : ** My cube : name........ FillColor : 236,215,191 FrameColor : 166, 69,111 SetColorText : 0,0,0 DrawText : Dt_left SetFonts : 12,6,0,0,Fw_NORMAL,0,0,0,"Calibri" Grid 10,60, 530, 500, Grid1 Property : Heightcolumn 24 Heightline 28, Max Column 4, Max Line 530 Create : Column 1 : "N° " ,Property :ButtonPush,Size 50 Column 2 : "Select",Property : Checkbox,Size 45 Column 3 : " Measures/View " ,Property : CHAR,Size 340,Left Column 4 : "type " ,Property : CHAR,Size 80,Left Frame 70,545,100, 45, Frame2 Attribut : ** EXIt FillColor : 144,208,213 FrameColor : 55,255,255 ShadowText : 1, 1 Color(0,0,0) SetColorText : 255,255,255 DrawText : Dt_Right SetFonts : 12,8,0,0,Fw_EXTRABOLD,0,0,0,"Arial" Frame 172,545,150, 45, Frame3 Attribut : ** Select and Click FillColor : 0,160,160 FrameColor : 0,255,160 ShadowText : 1, 1 Color(0,0,0) SetColorText : 255,255,255 DrawText : Dt_CENTER SetFonts : 12,8,0,0,Fw_EXTRABOLD,0,0,0,"Arial" Frame 322,545,250, 45, Frame4 Attribut : ** total Measures FillColor : 160,0,0 FrameColor : 0,255,160 ShadowText : 1, 1 Color(0,0,0) SetColorText : 255,255,255 DrawText : Dt_CENTER SetFonts : 24,8,0,0,Fw_EXTRABOLD,0,0,0,"Calibri" Buttonicondrawlabel Width Icon: 24 ,Height Icon : 24 , 1,545,80,45, "#DRIVERSYS+\MandragorePlanete\MS4BI\zPicture\Icon\XP\cancelxp.ico",Boutoncancel Create : Text "Exit " ,Info " Option @ Exit " Use Cursor "#DRIVERSYS+\MandragorePlanete\MS4BI\zPicture\Cursor\hand-l.cur" Buttonicondrawlabel Width Icon: 24 ,Height Icon : 24 , 90, 545,80,45, "#DRIVERSYS+\MandragorePlanete\MS4BI\zPicture\Icon\ok2.ico", ButtonGdOk Create : Text " Select " Info " option @ Select & display Measure ", Use Cursor "#DRIVERSYS+\MandragorePlanete\MS4BI\zPicture\Cursor\hand-l.cur" End_Dialog Begin_Splash BackgroundColor : Color(192,193,218) WinExtendStyle : :Ws_Ex_TRANSPARENT WinStyle : :Ws_POPUP & CenterDialog 0,0,150,120 ,"MS4 : Wait APP ",Splash1 Frame 10, 10,120,90, wtitleSplash Attribut : FillColor : 144,136,176 FrameColor : 250,250,250 ShadowText : 1,2 Color(0,0,0) SetColorText : 185,50,90 DrawText : Dt_CENTER SetFonts : 20,8,0,0,Fw_NORMAL,0,0,0,"Arial" End_Splash Begin_Initialize SetWinTxt(wtitleSplash:" MANDRAGORE PLANETE "); SetWinTxt(Wtitle4:" MANDRAGORE PLANETE "); Color(144,136,176) Return (Color2);SetColorText(Boutoncancel:red,color2); Color(144,208,213) Return (Color3);SetColorText(ButtonGdOk:red,color3); ShowSplash(Splash1: 2500) ; GD_SetBkColor(Grid1: Column: 1 yellow,Column: 2 orange, Column: 3 black,Column: 4 green); GD_SetColorText(Grid1: Column: 1 black, Column: 3 green, Column: 4 black); GD_SetFonts(grid1:21, 7, 0, 0,Fw_normal, 0,0, 0, Ansi_CHARSET, Out_DEFAULT_PRECIS, Clip_DEFAULT_PRECIS, Default_QUALITY, Ff_SWISS, "Colibri") ; BEGIN ** environnement DB ** retrieve Dir Application MS4 DBexist{Ms4DB}(LEnvDB) return (X) ; /* return codes */ ** x = 1 : Ok , x = 0 Not ok */ if (x void) then Display " DB not found ", LEnvDB; Exit; End_if; END; BEGIN ConnectDB{Ms4DB}(LEnvDB); Ms4_SQLFetch{ms4db}("select * from sqlite_master ") Row_ForEach : I++; clear ztypeMeasure,zMeasure; ztypeMeasure := Column_GetData:1,CHAR ; zMeasure := Column_GetData:2,CHAR ; GD_AddItem(Grid1: I , Column:1 I, Column:2 $_uncheck ,Column: 3 zMeasure,Column: 4 ztypeMeasure) ; End_Row_ForEach ; END; concatene "My cube : ",LEnvDB into lsetWintext ; SetWinTxt(Frame43: lsetWintext); clear lsetWintext; concatene "My cube : ",Lobject into lsetWintext ; SetWinTxt(Frame42: lsetWintext); Clear lsetWintext,ldirApp; Num_str I to ldirApp ; concatene "Total Measures : ",ldirApp into lsetWintext; SetWinTxt(Frame4:lsetWintext); End_Initialize Color(192,193,218) return(Color1); SetAttrTextOrientation(UserDialog:32,1,460,360,red,Color1," Design By MANDRAGORE PLANETE " ,20,8,0,0,0,0,"Calibri"); OpenDialog (UserDialog); ** SetforeGroundDialog(UserDialog); Require x := Pressed(Boutoncancel); IF (X Not_Void) THEN MsgBox : Title "My cube " Message : " Ok - Transaction cancelled " Button : Mb_OK Icon : Mb_IconExclamation Returning (X) ; Exit_TRANS1 := 1 ; Exit; End_if; Require x := Pressed (ButtonGdOk) ; IF (X Not_Void) THEN lig :=0;col :=0;x :=0; GD_GetitemCurrentCheck(Grid1) Return (Lig,3,x); /* check line GRID */ IF ((Lig > 0) And ($_check = x)) THEN Setwindowpos(Hwdsqldial :1 , gPosit ,850,400);gposit := gposit +25; SqlDial_SetInitCount(1000); ** compteur p/stop display SqlDialog GD_GetItemTexT(grid1:lig,3) return (zMeasure); Ms4_Query: Win {Ms4DB}(" SELECT * FROM [%s] ",zMeasure) ; End_if; End_if; End_Transaction ;