Home » Developer & Programmer » Reports & Discoverer » Developer Report is not generating into Excel?
Developer Report is not generating into Excel? [message #88160] Sat, 20 April 2002 21:22 Go to next message
Saeed
Messages: 9
Registered: April 2002
Junior Member
im using Developer2000 ReportWriter. When i use generate to file and then try to open it in Excel its format as column headings and their relative data down is not coming by any way. How i can do this?
We can do this in the older reports but now in Developer2000 ReportWriter i do not know how?
please help me?
Re: Developer Report is not generating into Excel? [message #88167 is a reply to message #88160] Wed, 24 April 2002 03:24 Go to previous message
arun kumar
Messages: 13
Registered: April 2002
Junior Member
I think u can use Dynami Data Exchange For getting the Report in the Excel Format

I can tell u the Sequence and Help u for retriving the data into a Excel sheet

The steps Involved are
Step 1
When New Form Instance
DECLARE
Timer_Id Timer;
BEGIN
SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,TITLE, 'Excel Reports');
SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,WINDOW_STATE,MAXIMIZE);
SET_WINDOW_PROPERTY('a',title,'DETAIL_CAN');
Timer_Id := CREATE_TIMER('Display_timer', 2250,REPEAT);
END;

Create a Block CALL_BLOCK

Add Text Item
TABLE_NAME

Add Push Button
PUSH_TAB_NAME
List Of Values
LOV_TABLE_NAME

When Button Pressed
DECLARE
a_value_chosen BOOLEAN; --Store the boolean value of LOV
BEGIN
GO_ITEM('CALL_BLOCK.TABLE_NAME');
a_value_chosen := Show_Lov('LOV_TABLE_NAME');--Display the Lov_Check_Stock_Code
IF a_value_chosen Then
GO_ITEM('CALL_BLOCK.CALL');
ELSE
GO_ITEM('CALL_BLOCK.TABLE_NAME');
END IF;
END;

Add Buttons
CALL
When Button Pressed
/**************************************************************************************
**Module**************Excel Integration using Dynamic Data exchange Package (DDE)******
***************************************************************************************/
DECLARE
AppID PLS_INTEGER; --Application identifier that is returned from DDE.APP_BEGIN
ConvID PLS_INTEGER; --Holds The function Which returns the DDE conversation identifier that is a PLS_INTEGER.
N NUMBER:=1; --This Variable is used to column cell id
NN NUMBER:=2; --Holds the Row number
RC VARCHAR2(30); --Holds the Data item name to which the data is to be sent
RID RECORDGROUP; --Holds the id of the RecordGroup
ERR_CODE NUMBER; --Holds the Value returened from the group is populated
GCID GROUPCOLUMN; --Holds the id for the group column
C NUMBER:=0; --Holds the column Count
ROW1 VARCHAR2(100); --Holds the Count for the first Row
COL_VAL VARCHAR2(100); --Holds the value for char field
COL_VAL1 NUMBER; --Holds the value for number field
COL_VAL2 DATE; --Holds the value for date field
COUNT1 NUMBER:=0; --Holds the Row count
table_name varchar2(100);
CNT NUMBER;
BEGIN
TABLE_NAME:=:CALL_BLOCK.TABLE_NAME;


DECLARE
CURSOR C2 IS SELECT * FROM COL WHERE TNAME=TABLE_NAME ORDER BY COLNO ASC ;

BEGIN
FORMS_DDL('CREATE OR REPLACE VIEW TEMP_DUMP_VIEW AS SELECT COUNT(*) COUNT FROM '|| TABLE_NAME);
IF NOT Form_Success THEN
Message ('TABLE NAME IS NOT CORRECT');
MESSAGE(' ');
RAISE Form_Trigger_Failure;

ELSE
-- Message ('VIEW CREATED');
null;
END IF;

SELECT COUNT INTO CNT FROM TEMP_DUMP_VIEW;
If CNT >0 Then
AppID := DDE.App_Begin('D:Program FilesMicrosoft OfficeOfficeEXCEL.EXE C:one.xls',

DDE.App_Mode_Maximized);

DDE.App_Focus(AppID);

ConvID := DDE.Initiate('EXCEL', 'C:one.xls');
--Header Section
FOR I IN C2 LOOP
RC:='R1'||'C'||N;
DDE.Poke(ConvID, RC, I.CNAME, DDE.CF_TEXT, 1000000);
N:=N+1;
END LOOP;

--Detail Section

FOR I IN C2 LOOP
C:=C+1;
-- FOR J IN C1 LOOP
FOR J IN 1..CNT LOOP

COUNT1:=COUNT1+1;
ROW1:='R'||NN;
RID := FIND_GROUP('code');
IF NOT ID_NULL(RID) THEN
DELETE_GROUP(RID);
END IF;
RID := CREATE_GROUP_FROM_QUERY('code','SELECT '||I.CNAME||' FROM '||TABLE_NAME );
ERR_CODE := POPULATE_GROUP(RID);
IF ERR_CODE<>0 THEN
MESSAGE('ERROR IN POUPLATING THE RECORDS....');
RAISE FORM_TRIGGER_FAILURE;
END IF;
GCID := FIND_COLUMN('code'||'.'||I.CNAME);
IF ID_NULL(GCID) THEN
MESSAGE('COLUMN NOT FOUND');
END IF;
IF I.COLTYPE in ('VARCHAR2') THEN
COL_VAL := GET_GROUP_CHAR_CELL(gcid,COUNT1);
ELSIF I.COLTYPE='NUMBER' THEN
COL_VAL1 := GET_GROUP_NUMBER_CELL(gcid,COUNT1);
ELSIF I.COLTYPE='DATE' THEN
COL_VAL2 := GET_GROUP_DATE_CELL(gcid,COUNT1);
END IF;

IF I.COLTYPE in ('VARCHAR2') THEN
DDE.Poke(ConvID, ROW1||'C'||C,NVL(COL_VAL,'NILL'),DDE.CF_TEXT, 1000000);
ELSIF I.COLTYPE='NUMBER' THEN
DDE.Poke(ConvID, ROW1||'C'||C,NVL(COL_VAL1,0),DDE.CF_TEXT, 1000000);
ELSIF I.COLTYPE='DATE' THEN
DDE.Poke(ConvID, ROW1||'C'||C,NVL(TO_CHAR(COL_VAL2,'DD-MON-YYYY'),'NILL'),DDE.CF_TEXT, 1000000);
END IF;
NN:=NN+1;
END LOOP;
COUNT1:=0;
NN:=2;
END LOOP;


MESSAGE('APPLICATION ENDED');
DDE.App_End(AppID);
MESSAGE(' ');
Else
AppID := DDE.App_Begin('D:Program FilesMicrosoft OfficeOfficeEXCEL.EXE C:one.xls',

DDE.App_Mode_Maximized);

DDE.App_Focus(AppID);

ConvID := DDE.Initiate('EXCEL', 'C:one.xls');

DDE.Poke(ConvID, RC,'No Records Found', DDE.CF_TEXT, 1000000);
End If;
END;
FORMS_DDL('DROP VIEW TEMP_DUMP_VIEW');
END;

Add Button
EXIT
Exit_Form(No_Validate);

Add a Content Canvas
DETAIL_CAN
Place all the items on the Canvas

Create A Record Group
REC_TABLE_NAME
Query for Record Group is
select tname from tab where tabtype='TABLE'
Create A Lov
LOV_TABLE_NAME
Column Mapping Properties For Tname Is
CALL_BLOCK.TABLE_NAME

Create A Window WINDOW_1

Run The Form And Enjoy
Previous Topic: Urgent!!!!!!!!pls help
Next Topic: integrate a logo in a report
Goto Forum:
  


Current Time: Tue May 21 14:49:14 CDT 2024