بتاريخ: 13 مارس 200818 سنة comment_124468 1-أنشاء فورم جديدة2- عمل control block وليكن اسمه control3- عمل content canvas وليكن اسمه REPCAN4 - عمل ActiveX control على canvas وليكن اسمه CrystalReport15- عمل Image item وليكن اسمه REP ( ويكون الصورة كاملة على ActiveX control)كبر الصورة لتملاء النافذة 5 - بالنقر بالزر الايمن على ActiveX control واختار Insert Object ومن القائمة واختار Crystal Report Control6 - اختار Program ثم ->Import OLE Library Interface7 - اختار من القائمة Crystal.CrystalReport from وده هيعرض طريقتان CrystalCtrl and IRowCursorوحدث CrystalReprotEventاختار الثلاث ثم زر موافق (علشان يكون لهم pl/sql)وفي When-New-Form-Instance" trigger اكتب الكود التالي DECLARE charWinHandle VARCHAR2(50); numWinHandle NUMBER; BEGIN Set_Application_Property(Cursor_Style,'BUSY'); charWinHandle := Get_Item_Property('Control.Rep',Window_Handle); numWinHandle := To_Number(charWinHandle); :Item('Control.CrystalReport1').OCX.Crystal.Crysta lReport.WindowParentHandle := numWinHandle; :Item('Control.CrystalReport1').OCX.Crystal.Crysta lReport.WindowState := 2; :Item('CONTROL.CRYSTALREPORT1').OCX.Crystal.Crysta lReport.Connect := 'DSN=;UID=' || Get_Application_Property(UserName) || ';pwd=' || Get_Application_Property(password) || ';dsq=;'; Crystal_CrystalCtrl.ReportFileName( :Item('Control.CrystalReport1').interface, 'C:\Sample_Rep.Rpt' ); Set_Window_Property( Forms_Mdi_Window, Window_State,Maximize ); Set_Window_Property( 'MAIN', Window_State, Maximize ); :reptitle := 'Report Preview Window'; numWinHandle := Crystal_CrystalCtrl.PrintReport( :Item('Control.CrystalReport1').interface ); Set_Application_Property(Cursor_Style,'DEFAULT'); END; ---------------------------------- **NOTE: Change the report name and path according to your required file name and path in the "Crystal_CrystalCtrl.ReportFileName" method call. Also, the connection string shown assumes that you will use the current USER and PASSWORD for the Form.- To make the above Form generic so that you can run any Crystal report from it, then createa parameter for the report name and pass it to the Form using CALL_FORM from any other Form.Then just replace the file name with the passed parameter.-. Run the Form. تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.