Home » Developer & Programmer » Forms » Calling Reports through Form ( Other than Oracle Reports) (Forms6i)  () 1 Vote
Calling Reports through Form ( Other than Oracle Reports) [message #402301] Fri, 08 May 2009 10:11 Go to next message
klat
Messages: 87
Registered: May 2009
Location: Mumbai
Member

Hi,

Can we call Reports other than Oracle Reports through Forms.
If yes , which are they?

Thanks..
Re: Calling Reports through Form ( Other than Oracle Reports) [message #402305 is a reply to message #402301] Fri, 08 May 2009 11:29 Go to previous messageGo to next message
Littlefoot
Messages: 20897
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Yes, we can.
Crystal Report is one of them.
Re: Calling Reports through Form ( Other than Oracle Reports) [message #402319 is a reply to message #402305] Fri, 08 May 2009 13:34 Go to previous messageGo to next message
klat
Messages: 87
Registered: May 2009
Location: Mumbai
Member

Hi,

Thanks for replay.
How it will work. I mean its syntax to call.
Re: Calling Reports through Form ( Other than Oracle Reports) [message #402330 is a reply to message #402319] Fri, 08 May 2009 15:37 Go to previous messageGo to next message
Littlefoot
Messages: 20897
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Something like this?
Re: Calling Reports through Form ( Other than Oracle Reports) [message #402354 is a reply to message #402330] Sat, 09 May 2009 02:41 Go to previous message
klat
Messages: 87
Registered: May 2009
Location: Mumbai
Member

.. And I got It.

Quote:

STEPS TO display the Crystal Report in Oracle Forms 6i:

**NOTE: This assumes that you already have Crystal Reports installed on your machine.

1. Create a new form.

2. Create a control block, name it 'CONTROL'.

3. Create a CONTENT canvas, name it 'REPCAN'.

4. Create an ActiveX control on the canvas, name it 'CrystalReport1'.

5. Create an Image item and name it 'REP'. (Make sure that image item overlaps

the ActiveX control completely; this image item is only used to get the item

handle. Enlarge this object such a way that it will fit the window; the

report gets displayed in this item so the item size should be adeqately

large.

6. Right click on the ActiveX control item and select "Insert Object" from the

menu.

7. From the list select "Crystal Report Control".

8. Select the Program->Import OLE Library Interface Menu in the form.

9. Select Crystal.CrystalReport from the List. (This will list two methods

and one Event. The two methods are CrystalCtrl and IRowCursor, the event is

CrystalReprotEvent).

10. Select all three and click on the OK button to accept. (This will

create the PL/SQL wrapper program units).

11. In the "When-New-Form-Instance" trigger of the form, put the following

code.

 

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.CrystalReport.WindowParentHandle
           := numWinHandle;
      :Item('Control.CrystalReport1').OCX.Crystal.CrystalReport.WindowState := 2;
      :Item('CONTROL.CRYSTALREPORT1').OCX.Crystal.CrystalReport.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.


12. To make the above Form generic so that you can run any Crystal report from it, then create

a 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.

13. Run the Form.



Previous Topic: How to align the separate frame in center
Next Topic: Global Path for all reports
Goto Forum:
  


Current Time: Wed Dec 07 12:20:47 CST 2016

Total time taken to generate the page: 0.09034 seconds