How to retrieve complete report output in HTML format
Hi,
I'm looking for how to retrieve complete report output in HTML format.
I have tried the following and it only give me first page of the report output where in the actual report output should be 5 pages. Is there something I'm missing.
CallbackOption[] boCallOpt = new CallbackOption[1];
ImageManagement boImgMan = new ImageManagement();
boImgMan.setCallbackScript("getImage.jsp");
boImgMan.setImageManagementHolder("imageName");
boImgMan.setDocumentReferenceHolder("docRef");
boCallOpt[0] = boImgMan;
RetrieveData oRetrieveData = new RetrieveData();
RetrieveView oRetrieveView = new RetrieveView();
oRetrieveView.setCallbackOption(boCallOpt);
oRetrieveData.setRetrieveView(oRetrieveView);
Action[] oActions;
oActions = new Action[1];
oActions[0] = fillPrompts;
oReportEngine.getDocumentInformation(boDocInfo.getDocumentReference(), null, oActions, null,oRetrieveData);
Testing this on BOE XI 3.0
Thanks,
For Web Intelligence, HTML is an interactive viewing format and not an export format such as PDF.
Note that the HTML will be embedded with postback URLs to the application for images and drill downs.
Closest you'd get is to be able to specify HTML output of an entire REPORT rather than REPORT_PAGE in the ViewSupport.setViewMode method. But this brings back just one report in the document, and will have postback URLs mentioned above.
Sincerely,
Ted Ueda
Similar Messages
-
How to automatically maximize report output on HTML page
Hi,
I am using Oracle Database 10g and Oracle Developer Suite 10.1.2
on Windows XP.
I am using Run_Report_Object() and Web.Show_Document() respectively to call the Report from Oracle Form.
Well, it showed normally.
However, the Window is not maximized automatically when showed.
I had to maximize it manually.
I would like to know, how can I maximize the report output which is showed in new Window on HTML format automatically?
Is there anyway to do so?
BTW, I also use the Report to call another Report by providing the hyperlink using SRW.Set_Hyperlink
Can I do the same, maximize the Window?
Many thanks,
Buntorohi,
u'll have to set the second argument in your function to '_blank'
i.e, web.show_document(url,'_blank'); -
Can i get the report output in HTML format?
Hello everybody,
I have developed a report whose output needs to be printed in HTML format.
Can anybody suugest how this can be accomplished by coding in program itself using any function modules if necesary?
Helpful answers will surely be rewarded.
Thanx in advance,
Sanghamitra.refer the below code
Generate an HTML file from a Report in ABAP
data: begin of itab occurs 0,
matnr type mara-matnr,
mtart type mara-mtart,
matkl type mara-matkl,
groes type mara-groes,
end of itab.
data: ifields type table of w3fields with header line.
data: ihtml type table of w3html with header line.
select * into corresponding fields of table itab
from mara up to 100 rows.
call function 'WWW_ITAB_TO_HTML'
EXPORTING
TABLE_ATTRIBUTES = 'BORDER=1'
TABLE_HEADER =
ALL_FIELDS = 'X'
tables
html = ihtml
fields = ifields
ROW_HEADER =
itable = itab
check sy-subrc = 0.
call function 'GUI_DOWNLOAD'
exporting filename = 'c:\test.html'
tables data_tab = ihtml
or for conerting internal table data into html
See below simple report to convert the internal table data to a HTML format data and stores in a internal table and then pass that internal table as an attachment to the external email using function module SO_NEW_DOCUMENT_ATT_SEND_API1.
You need for create a spool also.
REPORT Z_HTML .
include <icon>.
types: begin of msg,
type like icon-id,
text(140) type c,
end of msg.
constants: gc_marked type c value 'X',
gc_ok like icon-id value '@5B@'.
data:
gt_msg type standard table of msg,
gs_msg like line of gt_msg,
gv_msg(138) type c,
*-- html
html_container type ref to cl_gui_custom_container,
html_control type ref to cl_gui_html_viewer,
my_row_header like w3head occurs 10 with header line,
my_fields like w3fields occurs 10 with header line,
my_header like w3head,
my_html type standard table of w3html ,
ok_code like sy-ucomm.
Start of Selection *
start-of-selection.
clear gv_msg.
gv_msg = 'MESSAGES for HTML'.
do 3 times.
perform message using gc_ok gv_msg .
enddo.
End of Selection *
end-of-selection.
set screen 0100.
*& Form message
form message using p_type
p_text.
clear gs_msg.
gs_msg-type = p_type.
gs_msg-text = p_text.
append gs_msg to gt_msg.
endform. " MESSAGE
*& Module STATUS_0100 OUTPUT
module status_0100 output.
perform convert_itab_html.
set titlebar '100' .
set pf-status 'MAIN100'.
create object html_container
exporting
container_name = 'CONTAINER'.
create object html_control
exporting
parent = html_container
saphtmlp = gc_marked .
data: assigned_url type url.
call method html_control->load_data
EXPORTING
URL = url
TYPE = 'text'
SUBTYPE = 'html'
SIZE = 0
ENCODING =
CHARSET =
importing
assigned_url = assigned_url
changing
data_table = my_html
EXCEPTIONS
DP_INVALID_PARAMETER = 1
DP_ERROR_GENERAL = 2
CNTL_ERROR = 3
others = 4
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call method html_control->show_url
exporting
url = assigned_url
FRAME =
IN_PLACE = ' X'
EXCEPTIONS
CNTL_ERROR = 1
CNHT_ERROR_NOT_ALLOWED = 2
CNHT_ERROR_PARAMETER = 3
DP_ERROR_GENERAL = 4
others = 5
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endmodule. " STATUS_0100 OUTPUT
*& Module exit INPUT
module exit input.
leave program.
endmodule. " exit INPUT
*& Module user_command_0100 INPUT
text
module user_command_0100 input.
case ok_code.
when 'EXIT' or 'BACK'.
leave program.
when others.
call method cl_gui_cfw=>dispatch.
endcase.
endmodule. " user_command_0100 INPUT
*& Form convert_itab_html
form convert_itab_html.
data: lv_tabix like sy-tabix.
*-- table header
call function 'WWW_ITAB_TO_HTML_HEADERS'
exporting
field_nr = 1
text = 'Type'
fgcolor = 'navy'
bgcolor = 'red'
font = 'Arial'
tables
header = my_row_header.
call function 'WWW_ITAB_TO_HTML_HEADERS'
exporting
field_nr = 2
text = 'Message'
fgcolor = 'navy'
bgcolor = 'red'
font = 'Arial'
tables
header = my_row_header.
*-- table rows
clear lv_tabix.
loop at gt_msg into gs_msg.
lv_tabix = sy-tabix.
call function 'WWW_ITAB_TO_HTML_LAYOUT'
exporting
field_nr = 1
line_nr = lv_tabix
icon = gc_marked
tables
fields = my_fields.
call function 'WWW_ITAB_TO_HTML_LAYOUT'
exporting
field_nr = 2
line_nr = lv_tabix
fgcolor = 'red'
bgcolor = 'black'
font = 'Arial'
size = '2'
tables
fields = my_fields.
endloop.
*-- header
move 'Messages during program run' to my_header-text.
move 'Arial' to my_header-font.
move '2' to my_header-size.
move 'Centered' to my_header-just.
move 'red' to my_header-bg_color.
move 'blue' to my_header-fg_color.
refresh my_html.
call function 'WWW_ITAB_TO_HTML'
exporting
table_header = my_header
all_fields = ' '
tables
html = my_html
fields = my_fields
row_header = my_row_header
itable = gt_msg.
endform. "convert_itab_html
regards,
srinivas
<b>*reward for useful answers*</b> -
How to download the report output into PDF format
Hi friedns
from the report output when user clicks download button
it has to download to PDF format
how to do this
thanks in advance
venuhi venu,
check this sample code
Save Report Output to a PDF File
This report takes another report as input, and captures the output of that report. The output is then converted to
PDF and saved to a local file. This shows how to use some of the PDF function modules, as well as an easy way to
create PDF files.
Source Code Listing
report zabap_2_pdf.
*-- Enhancements: only allow to be run with variant. Then called
*-- program will be transparent to users
*-- TABLES
tables:
tsp01.
*-- STRUCTURES
data:
mstr_print_parms like pri_params,
mc_valid(1) type c,
mi_bytecount type i,
mi_length type i,
mi_rqident like tsp01-rqident.
*-- INTERNAL TABLES
data:
mtab_pdf like tline occurs 0 with header line,
mc_filename like rlgrap-filename.
*-- SELECTION SCREEN
parameters:
p_repid like sy-repid, " Report to execute
p_linsz like sy-linsz default 132, " Line size
p_paart like sy-paart default 'X_65_132'. " Paper Format
start-of-selection.
concatenate 'c:\'
p_repid
'.pdf'
into mc_filename.
*-- Setup the Print Parmaters
call function 'GET_PRINT_PARAMETERS'
exporting
authority= space
copies = '1'
cover_page = space
data_set = space
department = space
destination = space
expiration = '1'
immediately = space
in_archive_parameters = space
in_parameters = space
layout = space
mode = space
new_list_id = 'X'
no_dialog= 'X'
user = sy-uname
importing
out_parameters = mstr_print_parms
valid = mc_valid
exceptions
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
others = 4.
*-- Make sure that a printer destination has been set up
*-- If this is not done the PDF function module ABENDS
if mstr_print_parms-pdest = space.
mstr_print_parms-pdest = 'LOCL'.
endif.
*-- Explicitly set line width, and output format so that
*-- the PDF conversion comes out OK
mstr_print_parms-linsz = p_linsz.
mstr_print_parms-paart = p_paart.
submit (p_repid) to sap-spool without spool dynpro
spool parameters mstr_print_parms
via selection-screen
and return.
*-- Find out what the spool number is that was just created
perform get_spool_number using sy-repid
sy-uname
changing mi_rqident.
*-- Convert Spool to PDF
call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
exporting
src_spoolid= mi_rqident
no_dialog = space
dst_device = mstr_print_parms-pdest
importing
pdf_bytecount = mi_bytecount
tables
pdf = mtab_pdf
exceptions
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
others = 12.
call function 'DOWNLOAD'
exporting
bin_filesize = mi_bytecount
filename = mc_filename
filetype = 'BIN'
importing
act_filename = mc_filename
tables
data_tab = mtab_pdf.
FORM get_spool_number *
Get the most recent spool created by user/report *
--> F_REPID *
--> F_UNAME *
--> F_RQIDENT *
form get_spool_number using f_repid
f_uname
changing f_rqident.
data:
lc_rq2name like tsp01-rq2name.
concatenate f_repid+0(8)
f_uname+0(3)
into lc_rq2name separated by '_'.
select * from tsp01 where rq2name = lc_rq2name
order by rqcretime descending.
f_rqident = tsp01-rqident.
exit.
endselect.
if sy-subrc ne 0.
clear f_rqident.
endif.
endform." get_spool_number
Regards,
Naveen -
Hi,
i have my report output of 4 paes. when i tried to save them in HTML format , it saves all pages all together in 1 html. i want to save each page in different html.
like i have 4 pages in report output .. i want 4 html for each different page .
Can anybody help me ..its urgentHi,
You can do in this way ...
CALL FUNCTION 'WWW_ITAB_TO_HTML'
TABLES
HTML = F_HTML
FIELDS = FLDS
ITABLE = ITAB.
IF SY-SUBRC NE 0.
WRITE: / 'Error in generating the html format'.
EXIT.
ENDIF.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = 'c:test.html'
MODE = 'BIN'
TABLES
DATA_TAB = F_HTML
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
OTHERS = 9.
call these 2 Fucntion modules for every page. so each page it wil downlaod a HTML page
Regards
Sudheer -
Scrollbar for reports output in html format
We are creating reports with fairly large amounts of data being directed to the screen in HTML format. We were expecting to see a scrollbar along the right hand edge of the report window that allows us to see all of our data. Is this possible?
Alternatively, how would we split this data up into multiple pages? There isn't really anything to break on. We do want our totals on this last page.
Thanks.hello,
unfortunatly the varying destination types are only valid for bitmap reports.
regards,
the oracle reports team -
Reports output in Html format.
Hi,
My reports are in character mode.
I am running those reports in command line with all parameters like desname ,desformat,destype...
If mode is character we can't set desformat as Html.If I change that mode into default,then trancation will occur.How can I avoid this.Is there any possiblity to reduce
fontsize?
I don't want to modify each report.
Thanks,
viji.hello,
unfortunatly the varying destination types are only valid for bitmap reports.
regards,
the oracle reports team -
How to get Report Output in csv format
Hi,
How can i get report Output in csv format, can any one tell me the word used for output type to get output in csv format.
i have used XLS output type but it opens in excel format.
conc.addLayout(appCode,concReqCode,"en-US","US",XLS);
Thanks
BabuHi Babu,
Till now in xmlpublisher there is no method to create file in csv format ,you have to create Excel file and then save it in .csv format.Unless and until ur using BI Publisher in which some work around are possible.
Thanks -
Hi All!
is it possible to get the report output in HTML based output?
if yes, can anyone send me the details?
thanks in advance
AlankaarHi,
Yes it is possible to do that.
You can go thru the program below. Hope it could help you.
REPORT ZSS_CODE_2_HTML LINE-SIZE 300 .
TABLES: D010INC.
Tabelle für die aufzunehmenden ABAP-Texte
DATA: BEGIN OF SOURCECODE OCCURS 0,
LINE(200),
END OF SOURCECODE.
Tabelle für den erzeugten HTMLCode
DATA: BEGIN OF HTMLCODE OCCURS 5000,
LINE(256),
END OF HTMLCODE.
DATA: BEGIN OF INCLUDETAB OCCURS 0,
NAME LIKE D010INC-INCLUDE,
END OF INCLUDETAB.
DATA: TEXTELEMENTETAB LIKE TEXTPOOL OCCURS 50 WITH HEADER LINE.
DATA: EINRUECK TYPE I, " Soweit im HTML einrücken
CHAR2(2).
Selektionsbild und Verarbeitung -
SELECTION-SCREEN BEGIN OF BLOCK BL1 WITH FRAME.
PARAMETERS: PROGNAME LIKE D010SINF-PROG
DEFAULT 'ZSS_CODE_2_HTML'.
PARAMETERS: HTMLFILE LIKE RLGRAP-FILENAME
DEFAULT 'c: emp est.html'.
PARAMETERS: MITINCLD AS CHECKBOX DEFAULT 'X',
MITTEXTL AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK BL1.
SELECTION-SCREEN BEGIN OF BLOCK BL2 WITH FRAME.
PARAMETERS: MITZEILE AS CHECKBOX DEFAULT 'X',
ONSCREEN AS CHECKBOX DEFAULT 'X',
SAPINCLD AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK BL2.
Ein subtrivialer Tests
AT SELECTION-SCREEN.
READ REPORT PROGNAME INTO SOURCECODE.
IF SY-SUBRC <> 0.
MESSAGE E159(AT) WITH 'Programm konnte nicht eingelesen werden'.
ENDIF.
Programmanfang -
END-OF-SELECTION.
In der Tabelle sourcecode sollte hier schon der Quelltext stehen.
PERFORM ERZEUGE_KOPF.
PERFORM WRITE_SOURCE.
Includes falls erwünscht
IF MITINCLD = 'X'.
PERFORM WRITE_INCLUDES.
ENDIF.
Textelemente falls erwünscht
Includes falls erwünscht
IF MITTEXTL = 'X'.
PERFORM WRITE_TEXTELEMENTE.
ENDIF.
Und abschließen des Files
PERFORM ERZEUGE_SCHWANZ.
PERFORM ABSPEICHERN TABLES HTMLCODE
USING HTMLFILE.
Unterroutinen -
INCLUDE ZCD_SS_DEBUGROUTINEN.
FORM ABSPEICHERN *
--> FILENAME *
FORM ABSPEICHERN TABLES TEXT_ZU_SCHREIBEN
USING FILENAME LIKE RLGRAP-FILENAME.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
CODEPAGE = 'IBM'
FILENAME = HTMLFILE
FILETYPE = 'ASC'
MODE = ' '
TABLES
DATA_TAB = TEXT_ZU_SCHREIBEN
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
GUI_REFUSE_FILETRANSFER = 8
OTHERS = 9.
IF ONSCREEN = 'X'.
LOOP AT TEXT_ZU_SCHREIBEN.
PERFORM SHOW_ANY_STRUC USING TEXT_ZU_SCHREIBEN.NEW-LINE.
ENDLOOP.
ENDIF.
ENDFORM.
*& Form ERZEUGE_KOPF
Erzeugt einen HTML-Rumpf bis zum Body
FORM ERZEUGE_KOPF.
HTMLCODE-LINE = ''.APPEND HTMLCODE.
HTMLCODE-LINE = ' '.APPEND HTMLCODE.
HTMLCODE-LINE = '
CLEAR HTMLCODE-LINE.
HTMLCODE-LINE+3 = PROGNAME.APPEND HTMLCODE.
HTMLCODE-LINE = ' '.APPEND HTMLCODE.
HTMLCODE-LINE = ' '.APPEND HTMLCODE.
CLEAR HTMLCODE-LINE.APPEND HTMLCODE.
HTMLCODE-LINE = ''.APPEND HTMLCODE.
EINRUECK = 2.
ENDFORM. " ERZEUGE_KOPF
*& Form ERZEUGE_SCHWANZ
Erzeugt die abschließenden HTML-Befehle
FORM ERZEUGE_SCHWANZ.
HTMLCODE-LINE = ' </body>'.APPEND HTMLCODE.
HTMLCODE-LINE = '</html>'.APPEND HTMLCODE.
ENDFORM. " ERZEUGE_SCHWANZ
*& Form WRITE_SOURCE
Schreibt den Sourcecode
FORM WRITE_SOURCE.
DATA: ROT.
Erstmal die Überschrift hinstellen
PERFORM ADDZEILE USING '>+' '
PERFORM ZEILEUMB USING '' PROGNAME.
PERFORM ADDZEILE USING '->' '
CLEAR HTMLCODE-LINE.APPEND HTMLCODE.
Link auf Includes
IF MITINCLD = 'X'.
PERFORM ADDZEILE USING '>+' '
PERFORM ZEILEUMB USING '' '[Includes | #Includes]'.
PERFORM ADDZEILE USING '->' '
ENDIF.
Link auf Textelemente
IF MITTEXTL = 'X'.
PERFORM ADDZEILE USING '>+' '
PERFORM ZEILEUMB USING ''
'[Textelemente | #Textelemente]'.
PERFORM ADDZEILE USING '->' '
ENDIF.
Und Linie zum Trennen gegen den Quellcode
PERFORM ADDZEILE USING '>+' ''.
Und jetzt der Quellcode
PERFORM CODELINES.
ENDFORM. " WRITE_SOURCE
*& Form ADDZEILE
Fügt eine Zeile in den HTML-Code ein und korrigiert Einrücktiefe
FORM ADDZEILE USING VALUE(EINRUECKEN) LIKE CHAR2
VALUE(TEXT).
DATA: ER.
ER = EINRUECKEN(1).
IF ER = '+'.
EINRUECK = EINRUECK + 1.
ELSEIF ER = '-'.
EINRUECK = EINRUECK - 1.
ENDIF.
CLEAR HTMLCODE.
HTMLCODE+EINRUECK = TEXT.
APPEND HTMLCODE.
ER = EINRUECKEN+1(1).
IF ER = '+'.
EINRUECK = EINRUECK + 1.
ELSEIF ER = '-'.
EINRUECK = EINRUECK - 1.
ENDIF.
ENDFORM. " ADDZEILE
*& Form SONDERZEICHEN
Sonderzeichen in HTML darstellen
FORM SONDERZEICHEN CHANGING ZEILE.
DATA: S LIKE SY-SUBRC,
LASTHIT LIKE SY-FDPOS,
DUMMY(256).
LASTHIT = 0.
DO.
DUMMY = ZEILE+LASTHIT.
IF DUMMY CA '&'.
REPLACE '&' WITH '&' INTO DUMMY.
ZEILE+LASTHIT = DUMMY.
LASTHIT = SY-FDPOS + LASTHIT + 1.
ELSE.
EXIT.
ENDIF.
ENDDO.
ÄÖÜäöüß<>"
DO.
S = 1.
REPLACE 'Ä' WITH 'Ä' INTO ZEILE. S = S * SY-SUBRC / 4.
REPLACE 'Ö' WITH 'Ö' INTO ZEILE. S = S * SY-SUBRC / 4.
REPLACE 'Ü' WITH 'Ü' INTO ZEILE. S = S * SY-SUBRC / 4.
REPLACE 'ä' WITH 'ä' INTO ZEILE. S = S * SY-SUBRC / 4.
REPLACE 'ö' WITH 'ö' INTO ZEILE. S = S * SY-SUBRC / 4.
REPLACE 'ü' WITH 'ü' INTO ZEILE. S = S * SY-SUBRC / 4.
REPLACE 'ß' WITH 'ß' INTO ZEILE. S = S * SY-SUBRC / 4.
REPLACE '<' WITH '<' INTO ZEILE. S = S * SY-SUBRC / 4.
REPLACE '>' WITH '>' INTO ZEILE. S = S * SY-SUBRC / 4.
REPLACE '"' WITH '"' INTO ZEILE. S = S * SY-SUBRC / 4.
IF S = 1.EXIT.ENDIF.
ENDDO.
ENDFORM. " SONDERZEICHEN
*& Form ZEILEUMB
text
FORM ZEILEUMB USING VALUE(EINRUECKEN) LIKE CHAR2
VALUE(TEXT).
CONCATENATE TEXT '
' INTO TEXT.
PERFORM ADDZEILE USING EINRUECKEN TEXT.
ENDFORM. " ZEILEUMB
*& Form CODELINES
Schiebt die Zeilen aus sourcecode ins HTML-Format
FORM CODELINES.
DATA ZEILE(5).
PERFORM ADDZEILE USING '>+' '
LOOP AT SOURCECODE.
Erst mal die Sonderzeichen ersetzen
PERFORM SONDERZEICHEN CHANGING SOURCECODE-LINE.
Bei einem Kommentar diesen Rot und kursiv darstellen
IF SOURCECODE-LINE(1) = '*'. " roter Kommentar
CONCATENATE '+'
SOURCECODE-LINE
'+'
INTO SOURCECODE-LINE.
ENDIF.
Bei Zeilennummerierung diese in dunkelblau dazustellen
IF MITZEILE = 'X'.
ZEILE = SY-TABIX.
SHIFT SOURCECODE-LINE RIGHT BY 35 PLACES.
CONCATENATE ''
ZEILE
INTO SOURCECODE-LINE(35).
ENDIF.
PERFORM ADDZEILE USING '' SOURCECODE-LINE.
ENDLOOP.
PERFORM ADDZEILE USING '->' '
ENDFORM. " CODELINES
*& Form WRITE_INCLUDES
Die ganzen Includesources anfügen
FORM WRITE_INCLUDES.
DATA: FIRSTTIME.
FIRSTTIME = 'X'.
SELECT * FROM D010INC WHERE MASTER = PROGNAME.
IF SAPINCLD = 'X'
AND D010INC-INCLUDE(1) = '<'.
CONTINUE.
ENDIF.
IF FIRSTTIME = 'X'.
PERFORM ADD_INCLUDES_HEADER.
CLEAR FIRSTTIME.
ENDIF.
Die Namen der Includes merken und nacher am Anfang in den Quellcode
als Navigationspunkte hinzufügen
APPEND D010INC-INCLUDE TO INCLUDETAB.
Namen und Quelltext schreiben
PERFORM ADD_INCLUDE_NAME USING D010INC.
READ REPORT D010INC-INCLUDE INTO SOURCECODE.
PERFORM CODELINES.
ENDSELECT.
ENDFORM. " WRITE_INCLUDES
*& Form ADD_INCLUDES_HEADER
Für den 1. Include eine kleine Sonderbehandlung
FORM ADD_INCLUDES_HEADER.
HTMLCODE-LINE = ''. APPEND HTMLCODE.
ENDFORM. " ADD_INCLUDES_HEADER
FORM ADD_INCLUDE_NAME *
--> UEBERGABE *
FORM ADD_INCLUDE_NAME USING UEBERGABE LIKE D010INC.
HTMLCODE-LINE = ' '. APPEND HTMLCODE.
ENDFORM. " ADD_INCLUDE_NAME
*& Form WRITE_TEXTELEMENTE
Textelemente des Hauptprogramms auch noch ausgeben
FORM WRITE_TEXTELEMENTE.
PERFORM TEXTELEMENTE_HEADER.
READ TEXTPOOL PROGNAME INTO TEXTELEMENTETAB.
PERFORM HTML_TEXTELEMENTE USING 'im Hauptprogramm'.
LOOP AT INCLUDETAB.
READ TEXTPOOL INCLUDETAB-NAME INTO TEXTELEMENTETAB.
CHECK SY-SUBRC = 0.
PERFORM HTML_TEXTELEMENTE USING INCLUDETAB-NAME.
ENDLOOP.
ENDFORM. " WRITE_TEXTELEMENTE
*& Form TEXTELEMENTE_HEADER
FORM TEXTELEMENTE_HEADER.
HTMLCODE-LINE = ''. APPEND HTMLCODE.
ENDFORM. " TEXTELEMENTE_HEADER
*& Form HTML_TEXTELEMENTE
text
FORM HTML_TEXTELEMENTE USING WOHER.
DATA: WOHERNAME(80),
TID(80),
TKEY(80),
TENTRY(80).
WOHERNAME = WOHER.
PERFORM SONDERZEICHEN CHANGING WOHERNAME.
Das Ganze als Tabelle rauswerfen
HTMLCODE-LINE = '
'.APPEND HTMLCODE.
CONCATENATE '
' WOHERNAME '' INTO HTMLCODE-LINE.APPEND HTMLCODE.
HTMLCODE-LINE = '
'.APPEND HTMLCODE.
LOOP AT TEXTELEMENTETAB.
TID = TEXTELEMENTETAB-ID.
TKEY = TEXTELEMENTETAB-KEY.
TENTRY = TEXTELEMENTETAB-ENTRY.
und HTML-Sonderzeichen ersetzen
PERFORM SONDERZEICHEN CHANGING TID.
PERFORM SONDERZEICHEN CHANGING TKEY.
PERFORM SONDERZEICHEN CHANGING TENTRY.
HTMLCODE-LINE = ''.APPEND HTMLCODE.
CONCATENATE '' INTO HTMLCODE-LINE.
APPEND HTMLCODE.
CONCATENATE '' INTO HTMLCODE-LINE.
APPEND HTMLCODE.
CONCATENATE '' INTO HTMLCODE-LINE.
APPEND HTMLCODE.
HTMLCODE-LINE = ''.APPEND HTMLCODE.
ENDLOOP.
HTMLCODE-LINE = '
' TID '
' TKEY '
' TENTRY '
'.APPEND HTMLCODE.
HTMLCODE-LINE = '
'.APPEND HTMLCODE.
ENDFORM. " HTML_TEXTELEMENTE
Regards
Rakesh -
How to send a report output as a FAX ?
Hallo Experts,
How to send a report output as a FAX ?
Suppose if I have all the data in an internal table, I will show it as a normal list OR ALV list output.
In the application tool bar I should have a button, and by clicking it the output should go to the customer as FAX. How can I send it to a FAX ? Any Function modules ?
Please help me with an example program.
Regards,
Matt.Hi,
Hope the code given below helps you.
FORM SEND_FAX
TABLES DOC2FAX STRUCTURE TEST_DOC
USING COUNTRY
NUMBER.
DATA: SID(5) TYPE N.
DATA BEGIN OF POPT.
INCLUDE STRUCTURE ITCPO.
DATA END OF POPT.
DATA BEGIN OF PRES.
INCLUDE STRUCTURE ITCPP.
DATA END OF PRES.
CLEAR POPT.
POPT-TDCOPIES = 1. " one copy
* POPT-TDDEST = " done internaly by script,
* POPT-TDPRINTER = " do not fill !!!
POPT-TDNEWID = 'X'. " do not reuse old spool request
POPT-TDDATASET = 'TEST'(022). " fill as you want
POPT-TDSUFFIX1 = 'FAX'(023). " fill as you want
POPT-TDSUFFIX2 = SY-UNAME. " fill as you want
POPT-TDIMMED = 'X'. " send now
POPT-TDLIFETIME = 8. " keep 8 days in spool
POPT-TDTELENUM = NUMBER. " number without country code
POPT-TDTELELAND = COUNTRY. " country of recipient
POPT-TDCOVER = 'test fax'(024).
POPT-TDCOVTITLE = 'test fax'(024).
* POPT-TDIEXIT = 'X'.
CALL FUNCTION 'PRINT_TEXT'
EXPORTING
APPLICATION = 'TX'
ARCHIVE_INDEX = ' '
ARCHIVE_PARAMS = ' '
DEVICE = 'TELEFAX' "<<< here we say: fax it !
DIALOG = 'X'
HEADER = HEADER
OPTIONS = POPT
IMPORTING
RESULT = PRES
TABLES
LINES = DOC2FAX
EXCEPTIONS
OTHERS = 01.
* do not bother with exception in sample code
* CANCELED = 01
* DEVICE = 02
* FORM = 03
* OPTIONS = 04
* UNCLOSED = 05
* UNKNOWN = 06
* FORMAT = 07
* TEXTFORMAT = 08
* EXTERNAL = 09.
IF SY-SUBRC = 0.
* arriving here means we could send:
SID = PRES-TDSPOOLID.
IF SID > '00000'.
MESSAGE S433 WITH SID.
ENDIF.
LEAVE .
ELSE.
* do not bother with exception in sample code
MESSAGE A400 WITH 'PRIN_TEXT'.
ENDIF.
ENDFORM. " SEND_FAX
Regards,
Siddarth -
How to convert Oracle Report Output to Excel Spread Sheet..
Hello Sir,
How to convert Oracle Report Output to Excel Spread Sheet..
Thanks..Hello,
Please give us more information what kind of report(s). Sample example etc.,
Sri -
How to send the report output to the application server in a excel file
Hello,
how to send the report output to the application server in a excel file.
and the report runs in background.
Thanks in advance.
SundeepDear Sundeep.
I'm providing you with the following piece of code ... Its working fine for me ... hopefully it suits your requirement ...
D A T A D E C L A R A T I O N *
TYPES: BEGIN OF TY_EXCEL,
CELL_01(80) TYPE C,
CELL_02(80) TYPE C,
CELL_03(80) TYPE C,
CELL_04(80) TYPE C,
CELL_05(80) TYPE C,
CELL_06(80) TYPE C,
CELL_07(80) TYPE C,
CELL_08(80) TYPE C,
CELL_09(80) TYPE C,
CELL_10(80) TYPE C,
END OF TY_EXCEL.
DATA: IT_EXCEL TYPE STANDARD TABLE OF TY_EXCEL,
WA_EXCEL TYPE TY_EXCEL..
E V E N T : S T A R T - O F - S E L E C T I O N *
START-OF-SELECTION.
Here you populate the Internal Table.
Display - Top of the Page.
PERFORM DISPLAY_TOP_OF_PAGE.
E V E N T : E N D - O F - S E L E C T I O N *
END-OF-SELECTION.
SET PF-STATUS 'GUI_STATUS'.
E V E N T : A T U S E R - C O M M AN D *
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'EXPORT'.
Exporting the report data to Excel.
PERFORM EXPORT_TO_EXCEL.
ENDCASE.
*& Form DISPLAY_TOP_OF_PAGE
text
--> p1 text
<-- p2 text
FORM DISPLAY_TOP_OF_PAGE .
SKIP.
WRITE: /05(128) SY-ULINE,
/05 SY-VLINE,
06(127) 'O R I C A'
CENTERED COLOR 1,
132 SY-VLINE.
WRITE: /05(128) SY-ULINE,
/05 SY-VLINE,
06(127) 'Shift Asset Depreciation - Period/Year-wise Report.'
CENTERED COLOR 4 INTENSIFIED OFF,
132 SY-VLINE.
WRITE: /05(128) SY-ULINE.
E X C E L O P E R A T I O N
CLEAR: IT_EXCEL[],
WA_EXCEL.
PERFORM APPEND_BLANK_LINE USING 1.
WA_EXCEL-cell_02 = ' XYZ Ltd. '.
APPEND WA_EXCEL TO IT_EXCEL.
CLEAR: WA_EXCEL.
WA_EXCEL-cell_02 = 'Shift Asset Depreciation - Period/Year-wise Report.'.
APPEND WA_EXCEL TO IT_EXCEL.
PERFORM APPEND_BLANK_LINE USING 1.
ENDFORM. " DISPLAY_TOP_OF_PAGE
*& Form APPEND_BLANK_LINE
text
-->P_1 text
FORM APPEND_BLANK_LINE USING P_LINE TYPE I.
DO P_LINE TIMES.
CLEAR: WA_EXCEL.
APPEND WA_EXCEL TO IT_EXCEL.
enddo.
ENDFORM.
*& Form EXPORT_TO_EXCEL
text
--> p1 text
<-- p2 text
FORM EXPORT_TO_EXCEL .
DATA: L_FILE_NAME(60) TYPE C.
Create a file name
CONCATENATE 'C:\' 'Shift_Depn_' SY-DATUM6(2) '.' SY-DATUM4(2)
'.' SY-DATUM+0(4) INTO L_FILE_NAME.
Pass the internal table (it_excel which is already populated )
to the function module for excel download.
CALL FUNCTION 'WS_EXCEL'
exporting
filename = L_FILE_NAME
tables
data = IT_EXCEL
exceptions
unknown_error = 1
others = 2.
if sy-subrc <> 0.
message e001(ymm) with 'Error in exporting to Excel.'.
endif.
ENDFORM. " EXPORT_TO_EXCEL
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When you click the button - Export to Excel ( GUI-Status) you'll be able to export the content of the Internal Table to an Excel file .......
Regards,
Abir
Don't forget to award Points * -
How to open Report output in RTF format using concurrent request form.
Hi
I have created a report using BI publisher and RTF format. This report is working fine in PDF format. User can submit report using consurrent request form and can see report preview in PDF format.
Now user wants to submit another request and wants to see report output in RTF format.
User submitted a request, request successfully completed and generated a output RTF file in unix box but when user wants to see report output using concurrent request form (View Output) then window is showing raw data instead of RTF output.
Can any body tell me about solutions?
Thanks
RaviHi Ravi
I did little R&D on it and found following 2 solutions.I am sure that you also find something but for my shake i am putting it here.If you already find the solution then ignore it.
I) 1st Solution
1)Change the profiles 'Viewer: Application for Text' and put value as 'Browser'
2) Change the profiles 'Viewer: Text' and put value as 'Browser'.Either change it system level or concerned user.
3) Log out from Current session and close all internet explorer application.
4) Log in again to check the result
II) 2nd Solution
1) Navigate to: Sys admin --> Install -> Viewer Options to open the Form "Viewer Options".
Do the entry as shown below:
File_Format Mime Type Description
RTF application/rtf Microsoft Word(.rtf)
RTF application/msword Microsoft Word(.rtf)
2) Then ensure that the profile option Viewer: Application for Text is set to BLANK at the Site Level and User Level.
3) Then ensure that the profile option Viewer: Text is set to 'browser' at the Site Level.
-- It will pop-up the screen to choose application name from above two values.
Hope this will work it for you. For me i replicated the scenario and both solutions were working for me.
With Best Regards
Darshan Bhavsar -
How to get xls report output from oracle application.
Hi,
Is it possible to get the report output in xls format.
Please advise me if it is possible.
Rgds,
Naveen.One way is using XML Publisher,or alternatively you can check note 377424.1 from metalink : How To View / Open Concurrent Requests With The Excel Application
HTH -
Capturing cursor output in HTML format
Hi,
I want to capture Cursor's output in html format.
following is the current query which is giving me output as mentioned below it
Query:-
declare
v_msgtext varchar(4000);
cursor c_query IS
select emp_no,emp_name,salary
from employees
where dept_id = 100;
begin
for v_query in c_query LOOP
v_msgtext = v_msgtext ||
'empno:'|| v_query.emp_no||','||
'emp_name:'||v_query.emp_name||'.'||
'emp_salary:'||'v_query.salary'||
char(13)||char(10);
END LOOP;
utl_mail.send(v_sender, v_recipient, NULL, NULL, v_subject, v_msgText, 'text/html; charset=windows-1250', NULL);
end;
o/p:-
empno: 123,emp_name:sagar,emp_salary:10,000
empno: 124,emp_name:neeraj,emp_salary:20.000
empno: 125,emp_name:ashish,emp_salary:18.000
empno: 126,emp_name:ramesh,emp_salary:5.000
empno: 127,emp_name:suresh,emp_salary:30.000
I want to generate the output as HTML report in tabular format with the below columns
(empno,emp_name,salary) and send this html file via email to user.
Can anybody please suggest a solution ASAP.
Thanks in advance.Hi ,
Please follow the below link may it will be useful for you.It shows how to generate a HTML format output through the query.
oracle - Within a PL/SQL procedure, wrap a query or refcursor in HTML table - Stack Overflow
Maybe you are looking for
-
How do I update my 4th Gen iPod if it doesn't give me an option to do it on the general settings?
-
Autocorrect sentence in quotes in word 2007?
When i start a sentence in quotes and the first letter of the first word is not capitalized it doesn't correct the first word. For example: "this is a blue color." doesn't autocorrect it to "This is a blue color." Can i make Word autocorrect the firs
-
When to scale up and/or scale out?
When do you guys scale up/out, and how do you justify it? We have a small farm with a number of new projects we expect to have in production this year. I've been tasked with assessing our current environment, providing recommendations, and performing
-
PROBLEM ON CONNECTING WITH THE SERVER FOR THE FIRST TIME
Hi all, I'm using a upload and view concept using JSP & STRUTS. Now i'm able to upload the files. The problem is for viewing it. In this context what i did is that, the files which are uploaded to the server will be listed in the listbox and one of t
-
Log4J Logging from Global.App
Hi Has anyone tried logging from the Global.App in a workshop project ?? I am able to get logging done from everywhere in our App except from Global.App . My WorkShopCFG.xml snippet is as follows :- <appender name="APPLOGFILE" class="org.apache.log4j