I am trying to imbed crystal in oracle. I got the following steps from the web.
when i try to run the created from , iget the error frm-41344.
Any suggestions.
Regards,
Zellipa
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.Crystal Report from the List. (This will list two methods
and one Event. The two methods are CrystalCtrl and IRowCursor, the event is
CrystalReprotEv ent).
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(Curso r_Style,'BUSY') ;
charWinHandle := Get_Item_Proper ty('Control.Rep ',Window_Handle );
numWinHandle := To_Number(charW inHandle);
:Item('Control. CrystalReport1' ).OCX.Crystal.C rystalReport.Wi ndowParentHandl e
:= numWinHandle;
:Item('Control. CrystalReport1' ).OCX.Crystal.C rystalReport.Wi ndowState := 2;
:Item('CONTROL. CRYSTALREPORT1' ).OCX.Crystal.C rystalReport.Co nnect
:= 'DSN=;UID=' || Get_Application _Property(UserN ame) ||
';pwd=' || Get_Application _Property(passw ord) || ';dsq=;';
Crystal_Crystal Ctrl.ReportFile Name( :Item('Control. CrystalReport1' ).interface,
'C:\Sample_Rep. Rpt' );
Set_Window_Prop erty( Forms_Mdi_Windo w, Window_State,Ma ximize );
Set_Window_Prop erty( 'MAIN', Window_State, Maximize );
:reptitle := 'Report Preview Window';
numWinHandle := Crystal_Crystal Ctrl.PrintRepor t( :Item('Control. CrystalReport1' ).interface );
Set_Application _Property(Curso r_Style,'DEFAUL T');
END;
**NOTE: Change the report name and path according to your required file name and path in
the "Crystal_Crysta lCtrl.ReportFil eName" 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.