Generate text file, downloadable from frontend
Hi,
I am looking for APIs of EP6 SP2 that can be used to write content to a file and then send it to the frontend browser so it can be saved/opened locally.
This is all from a JSP DynPage Java iView.
Any suggestions?
Thanks,
FaB
Hi FaB,
see Export Portal data to Excel for generating response content different than HTML. It doesn't matter if you have the content on file system before or not.
Hope it helps
Detlev
Similar Messages
-
Generate Text File from Goods Receipt (MIGO)
Hi Expert,
Please help me ....................
My company outsource W/H but when I 'm goods receipt or goods issue (MIGO)
I send slip GR/IR by Fax to W/H but I want generate text file from system to W/H.
How can I do?
Thanks.Keerthi Hiremath,
Please .............
Can you more explain what is medium of 8 (special function) and other ?
Thanks. -
Generating Text files from PL/SQL
To generate Text files from PL/SQL on SERVER, i can use UTL_FILE
package, but how do i create text files on client ( i.e., on the
C: drive ) by executing anonymous PL/SQL blocks.
Thanks in advance.You can use DBMS_OUTPUT to display stuff to the screen and the
SQL*Plus SPOOL command to write screen output to a file on your
local drive.
magic!
APC -
Generating Text file from table using Shell script
I am using KSH for generating and FTPing a text file from a table.
While generating Text file I am not getting my Column names in orderly manner.
q2="select COLUMN1||' '||COLUMN2||' '||COLUMN3 from table1;"
set pagesize 0
set head off
set trimspool on
set trimout on
set colsep ' '
set linesize 1500
set trimspool on
spool /ss/app11/oastss/reports/$file2
select 'COLUMN1'||' '||'COLUMN2'||' '||'COLUMN3' from dual;
$q2
spool off;
EOF
I am getting the result some what like below in text file
COLUMN1 COLUMN2 COLUMN3
MALLIK_ACCT 17-SEP-11 908030482
MALLIK_ACCT 17-SEP-11 908266967
MALLIK_ACCT 17-SEP-11 909570766
I want the format like below
COLUMN1........ COLUMN2 .... COLUMN3
MALLIK_ACCT ...17-SEP-11 .... 908030482
MALLIK_ACCT ...17-SEP-11 .... 908266967
MALLIK_ACCT ...17-SEP-11 .... 909570766
I put dots(.) for illustration purpose.
column data length may icrease some times . it shoudl automatically adjust column and data so that they are in alignment. thanks in advance.Mallik wrote:
Hi my question is to format the headers so that they will be in alignment with column data and readable.So you want to output a query as a fixed width format data file? How about this (rather than using scripts)...
As sys user:
CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
/As myuser:
CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
,p_dir IN VARCHAR2
,p_header_file IN VARCHAR2
,p_data_file IN VARCHAR2 := NULL) IS
v_finaltxt VARCHAR2(4000);
v_v_val VARCHAR2(4000);
v_n_val NUMBER;
v_d_val DATE;
v_ret NUMBER;
c NUMBER;
d NUMBER;
col_cnt INTEGER;
f BOOLEAN;
rec_tab DBMS_SQL.DESC_TAB;
col_num NUMBER;
v_fh UTL_FILE.FILE_TYPE;
v_samefile BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
BEGIN
c := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
d := DBMS_SQL.EXECUTE(c);
DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
FOR j in 1..col_cnt
LOOP
CASE rec_tab(j).col_type
WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
ELSE
DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
END CASE;
END LOOP;
-- This part outputs the HEADER
v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
FOR j in 1..col_cnt
LOOP
CASE rec_tab(j).col_type
WHEN 1 THEN v_finaltxt := v_finaltxt||rpad(lower(rec_tab(j).col_name),rec_tab(j).col_max_len,' ');
WHEN 2 THEN v_finaltxt := v_finaltxt||rpad(lower(rec_tab(j).col_name),rec_tab(j).col_max_len,' ');
WHEN 12 THEN v_finaltxt := v_finaltxt||rpad(lower(rec_tab(j).col_name),greatest(19,length(rec_tab(j).col_name)),' ');
END CASE;
END LOOP;
UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
IF NOT v_samefile THEN
UTL_FILE.FCLOSE(v_fh);
END IF;
-- This part outputs the DATA
IF NOT v_samefile THEN
v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
END IF;
LOOP
v_ret := DBMS_SQL.FETCH_ROWS(c);
EXIT WHEN v_ret = 0;
v_finaltxt := NULL;
FOR j in 1..col_cnt
LOOP
CASE rec_tab(j).col_type
WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
v_finaltxt := v_finaltxt||rpad(nvl(v_v_val,' '),rec_tab(j).col_max_len,' ');
WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
v_finaltxt := v_finaltxt||rpad(nvl(to_char(v_n_val,'fm99999999999999999999999999999999999999'),' '),rec_tab(j).col_max_len,' ');
WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
v_finaltxt := v_finaltxt||rpad(nvl(to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),' '),greatest(19,length(rec_tab(j).col_name)),' ');
END CASE;
END LOOP;
UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
END LOOP;
UTL_FILE.FCLOSE(v_fh);
DBMS_SQL.CLOSE_CURSOR(c);
END;This allows for the header row and the data to be written to seperate files if required.
e.g.
SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
PL/SQL procedure successfully completed.Output.csv file contains:
empno ename job mgr hiredate sal comm deptno
7369 SMITH CLERK 7902 17/12/1980 00:00:00800 20
7499 ALLEN SALESMAN 7698 20/02/1981 00:00:001600 300 30
7521 WARD SALESMAN 7698 22/02/1981 00:00:001250 500 30
7566 JONES MANAGER 7839 02/04/1981 00:00:002975 20
7654 MARTIN SALESMAN 7698 28/09/1981 00:00:001250 1400 30
7698 BLAKE MANAGER 7839 01/05/1981 00:00:002850 30
7782 CLARK MANAGER 7839 09/06/1981 00:00:002450 10
7788 SCOTT ANALYST 7566 19/04/1987 00:00:003000 20
7839 KING PRESIDENT 17/11/1981 00:00:005000 10
7844 TURNER SALESMAN 7698 08/09/1981 00:00:001500 0 30
7876 ADAMS CLERK 7788 23/05/1987 00:00:001100 20
7900 JAMES CLERK 7698 03/12/1981 00:00:00950 30
7902 FORD ANALYST 7566 03/12/1981 00:00:003000 20
7934 MILLER CLERK 7782 23/01/1982 00:00:001300 10
The procedure allows for the header and data to go to seperate files if required. Just specifying the "header" filename will put the header and data in the one file.
Adapt to output different datatypes and styles are required (this is currently coded for VARCHAR2, NUMBER and DATE) -
Generate text file from a group above report
i have problem in generating report in developer 6 report builder my report is master -detail(group above report)
when i generate text file or csv file then my report is not in group above,master records are repeated along with every detail record.
is there any solution that i generate group above report in text or csv file
instead of pdf,rtf,html
please mail me
[email protected]Can you try adding this in your URL delimited_hdr=NO
I am not sure it works.
Just give a try -
Generating text file using PL/SQL
can any body send sample program how to generate text file using PL/SQL program.I want to store table data into that text file.
Hi,
try this.
Thanks
CREATE OR REPLACE procedure write_index (TABLE_NAME_ACCEPT VARCHAR2) IS
id UTL_FILE.FILE_TYPE;
name VARCHAR2(20) := 'e:\db_coca\input';
err VARCHAR2(100);
ColNameLength Integer;
NumberoFColumns Integer;
num NUMBER;
i integer;
loc_query VARCHAR2(2000);
cursor_name INTEGER;
ret INTEGER;
l_const_name VARCHAR2(30);
CURSOR c_columns(i_Constraint_name VARCHAR2) IS
SELECT *
FROM all_cons_columns
WHERE CONSTRAINT_NAME = i_Constraint_name
order by table_name;
BEGIN
DBMS_OUTPUT.PUT_LINE('BEFORe OPEN');
--id := UTL_FILE.FOPEN('e:\db_coca\input',name,'w');
--IF UTL_FILE.IS_OPEN(id) THEN
-- DBMS_OUTPUT.PUT_LINE('Opened');
--ELSE
-- DBMS_OUTPUT.PUT_LINE('Still Closed');
--END IF;
DBMS_OUTPUT.PUT_LINE('AFTER OPEN');
--The table generation script
loc_query := 'Select CONSTRAINT_NAME from user_constraints ';
loc_query := loc_query || ' where owner = ' || '''CPS''';
loc_query := loc_query || ' AND CONSTRAINT_TYPE = ' || '''P''';
dbms_output.put_line('TABLE_NAME_ACCEPT = ' || TABLE_NAME_ACCEPT);
IF NOT (TABLE_NAME_ACCEPT IS NULL ) THEN
loc_query := loc_query || ' AND TABLE_NAME like ''';
loc_query := loc_query || TABLE_NAME_ACCEPT ;
loc_query := loc_query || '''';
END IF;
cursor_name := DBMS_SQL.OPEN_CURSOR;
dbms_output.put_line('Query = ' || loc_query);
DBMS_SQL.PARSE(cursor_name, loc_query, DBMS_SQL.v7);
dbms_output.put_line('After parse');
dbms_sql.DEFINE_COLUMN(cursor_name, 1,l_const_name, 30);
ret := DBMS_SQL.EXECUTE(cursor_name);
-- IF ret > 0 THEN
LOOP
dbms_output.put_line('return = ' || ret);
IF DBMS_SQL.FETCH_ROWS(cursor_name) > 0 THEN
dbms_sql.COLUMN_VALUE(cursor_name, 1,l_const_name);
-- dbms_sql.BIND_VARIABLE(cursor_name,
l_const_name,CONSTRAINT_NAME);
-- FOR C10 in Table_Loop Loop --The cursor
for the table name
Select COunt(*) INTO NumberoFColumns from
all_cons_columns
Where CONSTRAINT_NAME = l_const_name;
-- FOR C11 IN c_columns(l_const_name) LOOP
-- End loop;
-- UTL_FILE.PUT(id, ');');
ELSE EXIT;
END if; --THe 1 st cursor if is closed
End Loop; --The table loop ends here
DBMS_SQL.CLOSE_CURSOR(cursor_name);
-- END IF;
-- UTL_FILE.PUT_LINE(id,name);
-- UTL_FILE.PUT(id,'It worked and wrote to this file');
UTL_FILE.FCLOSE(id);
DBMS_OUTPUT.PUT_LINE('Successful write to file');
EXCEPTION
WHEN OTHERS THEN
err := SQLERRM;
num := SQLCODE;
DBMS_OUTPUT.PUT_LINE(err);
DBMS_OUTPUT.PUT_LINE(num);
DBMS_OUTPUT.PUT_LINE('Error in writing to file');
END write_index; -
APEX 4.0: error while opening a XLS file downloaded from interactive report
Hi,
I'm getting below error while opening a XLS file downloaded from an interactive report (APEX 4.0).
"The file you trying to open, 'customer_2.xls', is in a different format than specified by the file extension.
Verify that the is not corrupted and is from a trusted source before opening file. Do you want to open file."
Yes No Help
May be this one Apex 4.0 issue.
please help me.
Thanks
MukeshHi,
is the next part of the code correct.
What i mean is packing of the attachment, finding out the size of pdf file and doc type as PDF.
You can also try below link..
Link: [http://wiki.sdn.sap.com/wiki/display/Snippets/SENDALVGRIDASPDFATTACHMENTTOSAPINBOXUSINGCLASSES]
Hope this helps.
Regards,
-Sandeep -
Hi All,
I have written a code that downloads a file from server using the following link given by Frank,
File download from server
I am able to get a open/save/cancel dialog with help of this. But issue is that applications of kind .doc/.xls/.ppt gets opened (If user clicks open) right in the internet explorer window instead of getting opened in a new office application....
However .pdf runs fine.
Can any thing be done for this???
Any help....
Regards,
AmittHi,
what do you have for the content disposition header?
Try this:
response.setHeader("Cache-Control", "max-age=0");
response.setHeader("Content-Disposition", "attachment; filename=\"" + fname + "\"");
response.setContentType("application/x-download");Brenden -
Hi- I'm trying to install xcode 2.5. Idon't know what to do w/.exe file downloaded from the apple developer website.
I would like to be able to use AU Lab but my developer folder only has extras/palettes inside- no applications or tools.
ThanksHello,
What is the full name of this exe file?
Those are for Windows® -
Questions regarding jsp file download from blob
Hi developers, i'm doing jsp file download from a blob column in DB2 using struts,
1) How do i design the jsp page such that the page will show perhaps a hyperlink for me to download the file?
2) What about struts-config.xml? Do i need to modify any mappings there?
It would be great if some kind developers were to provide some sample codes for me. Thanks alot. Your effort is kindly appreciated.http://kr.forums.oracle.com/forums/thread.jspa?threadID=1982213 - looks similar, you may need to change contentType as per use case
-
Deleting email on outlook opens a file download from firefox
deleting email on outlook opens a file download from firefox
Windows 7 - Outlook has a file download box that will not go away.,please help
go to this website and the solution is there...
http://www.sevenforums.com/microsoft-office/176965-outlook-has-file-download-box-will-not-go-away-please-help.html -
Jar files downloaded from SkyDrive are being renamed to jar.zip files
I have cut and pasted the following series of exchanges from when I posted the problem onto SkyDrive's support forum. I hope that someone might be able to propose a better solution to the problem that I have. Thanks for your help.
MDSms asked on
Uploaded jar files convert to jar.zip files when downloaded from SkyDrive
I have uploaded an executable jar file to SkyDrive. (I will call this FILE.jar). The file is intact and indicates that it is a jar file type when the file is viewed by Properties within Skydrive. However, when I download (or others download through a share link) the file, it is being saved onto the local computer's download file with .zip appended to the file name (FILE.jar.zip). The downloaded file can be renamed to remove the .zip appendage and subsequently run successfully. However the folder options for the folder where the downloaded file resides must be changed for disable "Hide known file extensions" prior to being able to remove the .zip appendage. While I have figured out the workaround for this problem, this manual renaming procedure is entirely too cumbersome as a solution for sharing this file with others. How can I prevent or disable the FILE.jar file from being renamed to FILE.jar.zip when it is downloaded from SkyDrive?
All Replies (5)
Audrey_P. replied on
Forum Moderator
Hi,
Thank you for posting. Let me try to assist you with your issue with your files.
In order for us to reproduce the issue on our end. Please provide us with the exact steps that you did when you uploaded the files as well as the steps when you are downloading it.
We will be needing the steps to help us figure put what is causing you this issue.
We look forward to your response.
Thank you.
Audrey P.
MDSms replied on
Reply
The file was uploaded by first logging onto my SkyDrive account using Windows 7 Pro and Firefox browser, then a new folder in my account was created without sharing privileges, then the folder was opened and the FILE.jar was uploaded into the folder using the "Upload" option on skydrive account menu. Sharing privileges for FILE.jar were then created (view only), and the shortened url link was sent to the individuals that I was trying to share the file with. was then turned on. When these people use the link to download the file, it is being saved as FILE.jar.zip.
When I try to download the file through the skydrive account download option, it is being saved onto my computer as FILE.jar.zip and this occurs when I try to download the file while signed into my skydrive account as well as when I am not signed into my skydrive account (using the shared file link).
This PNG shows the information provided by clicking on the download icon (down arrow) within the Firefox browser; note that the file was downloaded as FILE.jar.zip and that the source was live.com. When I use Windows Explorer to look at the same file within the Download folder itself, examining the file's properties details also shows that it is being saved as FILE.jar.zip and is of the file type compressed zip folder.
This PNG shows the information displayed to me from my skydrive account when I view the originally uploaded file's properties; note that the information shows that the file is a jar file type.
When I utilize Internet Explorer 9 to access the file, FILE.jar is being downloaded onto my computer as a jar file type. This PNG shows the information provided by Tools/View Downloads within the IE9 browser. Note that in this instance, the information indicates that the file is being downloaded from yzudea.blu.livefilestore.com.
It appears to me that the problem (the FILE.jar file being renamed to FILE.jar.zip) arises from the fact that a jar file downloaded from skydrive using firefox, is being sent from live.com whereas a jar file downloaded from skydrive using IE9 is being sent from yzudea.blu.livefilestore.com.
I want to make sure that a person receiving a share link from me for FILE.jar is able to download it without modification to the file name regardless of which browser is being using to access the link. How can I make sure that this occurs?
Any help is appreciated. Thanks.
Michelle Anne D. replied on
Forum Moderator Community Star Community Star
Reply
Hi MDSms,
I appreciate you for providing as much information as you can about the issue, as well as for uploading screenshots on what you see from the downloaded file. About your initial concern wherein the file gets renamed with .zip after the original file extension, this is solely dependent on the browser that you are using since they have a different safety/security measure that needs to be implemented.
Moreover, you may see the file servers live.com and yzudea.blu.livefilestore.com to be different with one another, but they actually are sent from the same SkyDrive server. This in turn, depends on the web browser where the file is being downloaded as well. The live.com file where it was downloaded from Firefox simply masks its original server yzudea.blu.livefilestore.com.
As for your last query about your recipients downloading the file without the hassle of renaming it from a .zip file, you can simply tell them to download it through Internet Explorer.
Should you have other queries or additional information that might help in our investigation, I highly encourage you to post them here.
Regards,
Michelle
MDSms replied on
Michelle,
Thanks for your reply. Yes, I could simply tell them to download the file through Internet Explorer, but is there another solution or workaround to the problem I have described here? Am I being punished with the curse of this problem simply because I (or the individuals with which I wish to share FILE.jar with) choose to use Firefox instead of IE? Will the use of any other browser instead of IE (Chrome, Safari, etc., etc.) still result in the same problem?
You stated that it is "solely dependent on the browser that you are using since they have a different safety/security measure that needs to be implemented"........could the problem be overcome by designating one or both of the file server addresses as Trusted Sites within the browser options setting?
I look forward to your response. Thanks in advance.
Joy V. replied on
Forum Moderator Community Star Community Star
Reply
Hi MDSms,
We understand your concern. Since the issue does not occur in Internet Explorer, it has something to do with Firefox's security feature. You might want to verify this concern by contacting Firefox support.
Hope this helps. Let us know if we can further assist you with SkyDrive.
Thanks,
Melanie JoyTry to delete the mimeTypes.rdf file in the Firefox profile folder to reset all file actions.
*http://kb.mozillazine.org/mimeTypes.rdf
*http://kb.mozillazine.org/File_types_and_download_actions#Resetting_download_actions -
"Import from Text File" & "Upload from Clipboard" icon not appearng in F110
Hi Experts,
While making the payment to the vendors through TN F110, in "PARAMETER" screen just next to 'STATUS' screen, there is a vendor field for selection in range and just ahead of this there is an icon for multiple vendor selection ( Bold arrow mark ). If I click on that multiple vender selection icon ( on bold arrow mark ), an another screen opens for multiple selection for vendors. In this screen 'Enter, Copy, Delete etc' icons are appearing at the bottom of the screen but "Import from Text File" & "Upload from Clipboard" icon are not appearing there.
Can you please let me know how to bring that icons there?
Points would be awarded.
Rgds,
ShaileshHi Ravi,
I have not yet created anything and have just entered the parameter. In the multiple screen for vendors there are 5 fields for individual and 5 for range selection. Even you can put more than five range selections or individual selections by clicking on the page button but there I am not finding these two icons.
Can you please check at your end and let me know if you are getting or what to do to bring those two icons in F110.
Rgds,
Shailesh -
Function upload text file or from clipboard in Bex with BI 70
Will it be possbile to use the function to upload data in from a text file or from clipboard with BI 70?
With older BW versions it was possible to fill a variable with lists.
Can someone help where I can find information about this issue?
Best Regards, TinaWill it be possbile to use the function to upload data in from a text file or from clipboard with BI 70?
With older BW versions it was possible to fill a variable with lists.
Can someone help where I can find information about this issue?
Best Regards, Tina -
Just upgraded to Lion, can't open any pdf file downloaded from the internet that was fine with Leopard before. I just got a black screen when I clicked on a pdf icon on a given internet site, and same happened with several sites that I visited. How can I overcome this obstacle ?
Try two things with Safari not running:
1) Launch Adobe Reader, open its preferences, select the Internet category, and check the values under "Display PDF in browser using". If it's checked, try unchecking it.
2) Look in /Library/Internet Plug-Ins (at the top-level of your boot volume) for something names AdobePDFViewer.plugin. If you see such a file, try moving it to a folder named "Disabled Plug-Ins" (if such a folder exists) or onto the Desktop.
Then see how things work.
Maybe you are looking for
-
How do i reformat a case sensitive external hard drive without losing data
I know there are a lot of posts about this, and i have spent hours trying to find a soloution / understand what people have responded to others, but i can't work this out. I also have a Buffalo HD (let's call it HD1) that stores my itunes library. I
-
Video clips from FCP to website
We want to post 30 2-3min video clips on our business web site and will continue to do this on a ongoing basis. The process is for me to export as a QT file, post it on our server for our webmaster who will covert to flash and will then post on our w
-
Mirroring to my Sony TV results in my MBP screen dimensions (14:9) showing up
...instead of proprietary Sony TV's ones (16:9). I reset my MBP to factory settings and returned to Lion. Previously, on Mavericks, I was able somehow to set up this quite easy, but I forgot what I have to do to optimize screen size of mirrored MBP m
-
I have a very normal query to perform but I'm not sure how to do it in EJB-QL. I have 3 tables I need to join. 1) Person table 2) Project Member table 3) Project Member Role table You can extrapolate what's on each table pretty easily bas
-
Did a presentation folder update from a supplied AI/PDF; changed cymk pix, did minor edits, etc. All looked great from first proof to final. Did a hard copy proof on my personal Epson 4000 and it was fine. Got hard copy print proof from Partner Print