Data displayed in CSV format
Hi,
I'd like to be able to render the data returned from a collection as plain-text (preferably as a CSV) on the page, rather than put into a table or something.
Is this possible in ADF (JDeveloper 10.1.3) ? I can't see anything obvious that might allow this.
Thanks,
Andy
Hi Andy,
Were you able to get the data in csv format? If yes, then do let me know.
I am also looking for a similar requirement.
You can mail me at [email protected]
Thanks in advance,
Regards,
Vineet
Similar Messages
-
Export Of Data In The .CSV Format With Column Headings On Top
I'm trying to export data in the .csv format from a report (Crystal Reports XI Release 2). When I export the data, the heading appears in the first few columns on the left hand side (i.e. columns "A" thru "G") for every row, rather as a column heading on top. These header describe the data beneath it. I tried various combinations of export options. The file needs an extension .csv (or .xls) for the tool that uses the data. Any suggestions how I can accomplish this ?
Abhishek,
I tried to apply your solution, but forgot that the Crystal Reports support desk updated my version of Crystal Reports XI to Release 2 for a previous problem. My CDs are Crystal Reports XI Release 1. Now I can't export at all until I figure out how to turn on the export option. I do have access to older version (version unknown) that came with one of business system. The options it has are "Character", "Tab", and "Delimeter" for "Separated Values (CSV)". It does not have the option that you mentioned. Is there a similar option with this older version ? Lastly, How can I turn on the "Export" for "Crystal Reports XI Release 2" ? Thanks ! ! ! -
Unable to save the data in a .CSV format
Hi All,
I am trying to pull some data with the help of the sql query from the database and then trying to save this string of data in csv file by using the following code as shown below.The problem iam facing here is that while the file Save as window opens stating to be saved as .CSV format but when i try to save it ,it doesnt givme a csv option ,only html option appears.Can any one help me on this..,,,,,,,,,,,,?
<%@include file="jtfincl.jsp" %>
<%@page session="false" %>
<%@page import="java.io.PrintWriter"%>
<%@page import="oracle.apps.ibe.util.RequestCtx"%>
<%@page import="oracle.apps.iri.iribe.postsales.IrIbeOrderSearch"%>
<%@page import="oracle.apps.ibe.util.*" %>
<%@page import="java.io.IOException" %>
<%
pageContext.setAttribute("_securePage", "true", PageContext.REQUEST_SCOPE);
pageContext.setAttribute("_guestNotAllowed", "true", PageContext.REQUEST_SCOPE);
pageContext.setAttribute("_unapprovedNotAllowed", "true", PageContext.REQUEST_SCOPE);
RequestCtx rCtx = RequestCtx.start(request, response);
int status = Session.checkContextValues(request, response);
if(RequestCtx.userIsAnonymous()) {
signin(out, pageContext, request, response, false);
return;
// Set the response type which in this case will be a .csv file
response.setContentType("application/csv");
response.setHeader("Content-disposition","attachment;filename=SearchResults.csv");
String queryStartDate = request.getParameter("queryStartDate");
String queryEndDate = request.getParameter("queryEndDate");
String queryField = request.getParameter("queryField");
String queryOperator = request.getParameter("queryOperator");
String queryValue = request.getParameter("queryValue");
String queryOrderByField = request.getParameter("queryOrderByField");
String showOpenOrdersOnly = request.getParameter("showOpenOrdersOnly");
IrIbeOrderSearch orderSearch = new IrIbeOrderSearch(
queryStartDate,
queryEndDate,
queryField,
queryOperator,
queryValue,
queryOrderByField,
showOpenOrdersOnly
orderSearch.initialise();
java.util.ArrayList results = orderSearch.getItemTrackerSearchResults();
out.println("The result array size is======="+results.size()) ;
// Output the results as the page resonse as a csv file
try
write(results, response.getWriter());
catch(exception e)
out.println("The stack trace is======="+e.printStackTrace()) ;
if(IBE_logEnabled) IBEUtil.log("iribeCOtdOrdSearchExport.jsp","Inside the exception"+e.toString);
%>
<%!
* This method will take a ResultSet and JspWriter object and print out the details of the ResultSet as a
* comma seperated value file.
* @param results
* @param writer
public static void write(java.util.ArrayList results, PrintWriter writer) {
if(results == null || results.size() == 0) {
writer.print("No Data Available");
return;
String [] data = null;
String output = "";
if(IBE_logEnabled) IBEUtil.log("iribeCOtdOrdSearchExport.jsp","Inside the write method");
for(int i = 0; i < results.size(); i++) {
data = (String []) results.get(i);
output = "";
for(int j = 0; j < data.length; j++) {
// If its not the last column
if(j != data.length - 1) {
output += formatField(data[j]) + ",";
// If it is the last column
} else {
output += formatField(data[j]);
writer.println(output);
writer.flush();
* Format a string value so that it becomes a valid field in a .csv file. This involves making sure that any null
* data is treated as an empty string, that any quotes are padded and if the file contains any commas that the
* field is surrounded by quotes.
* @param value
private static String formatField(String value) {
String output = null;
// Check for null values
if(value == null) {
output = "";
} else {
output = value;
// Pad any existing quotes
output = output.replaceAll("\"", "\"\"");
// If there is a space or commas then add surrounding quotes
if(output.startsWith(" ") || output.endsWith(" ") || output.indexOf(",") != -1) {
output = "\"" + output + "\"";
return output;
%>
<%!
void signin(
JspWriter out,
PageContext pageContext,
HttpServletRequest request,
HttpServletResponse response,
boolean reauth
) throws IOException, SQLException, FrameworkException {
String query = IBEUtil.passQueryString(request, null).toString();
String uri = request.getRequestURI();
String targetJsp = uri.substring(uri.lastIndexOf("/") + 1);
String ref = null;
if ("true".equals(pageContext.getAttribute("_securePage", PageContext.REQUEST_SCOPE))) {
ref = RequestCtx.getSecureFormAction(targetJsp);
} else {
ref = RequestCtx.getNonSecureFormAction(targetJsp);
if(!query.equals("")) {
ref = oracle.apps.jtf.util.Utils.encode(ref + "?" + query);
String redirect = RequestCtx.getSecureURL("ibeCAcpSSOLogin.jsp", "ref=" + ref + (reauth ? "&reauth=t" : ""));
// don't add the ref if the session expired and restarted
RequestCtx rCtx = RequestCtx.getRequestCtx();
if(rCtx.startRequestException!=null) {
redirect = RequestCtx.getSecureURL("ibeCAcpSSOLogin.jsp", "ibe_se=t"+(reauth ? "&reauth=t" : ""));
RequestCtx.end(request);
response.sendRedirect(redirect);
regds
manish
%>This would occur if you were using IE and the requested URL doesn't contain the filename part. The real web browsers would pick up the filename from the response header flawlessly.
Having said that, this kind of logic doesn't belong in a JSP. Use Java classes (Servlet, Bean, DAO). Further on, JSP/Servlet related questions should be posted in the JSP/Servlet forum. -
Error when transferring table data to a CSV format file.
Hi
I am getting an error when I am passing the parameter value for the file name from the selection screen. If i hard code the path and name it works fine. can any one help me please. here is my code:
PARAMETERS: OUTFILE LIKE dxfile-filename
DEFAULT 'C:\Apositivepay.txt',
RUNDATE LIKE PAYR-LAUFD,
Bank LIKE T012K-HBKID. "List of Possible Banks
type-pools:TRUXS.
DATA: BEGIN OF OUTPUT_REC OCCURS 0, "Output file for USBANK
ACCT(12), "bank account no
Payee2(40) type c, "payee 2
END OF OUTPUT_REC.
data: itab1 type TRUXS_T_TEXT_DATA.
CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
EXPORTING
I_FIELD_SEPERATOR = ','
TABLES
I_TAB_SAP_DATA = OUTPUT_REC
CHANGING
I_TAB_CONVERTED_DATA = itab1
EXCEPTIONS
CONVERSION_FAILED = 1
OTHERS = 2.
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 FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = OUTFILE "This doesn't work
filename = 'C:\Apositivepay.txt' "This works
TABLES
DATA_TAB = itab1
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
OTHERS = 8.
Message was edited by: Anwarul Kabirhi,
use this code and save that file in CSV format it will work
OPEN DATASET P_IFILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC NE 0.
MESSAGE E000 WITH 'Problem in opening Application Server file'.
ELSE.
DO.
READ DATASET P_IFILE INTO IT_UPLOAD.
IF SY-SUBRC NE 0.
EXIT.
ELSE.
APPEND IT_UPLOAD.
CLEAR IT_UPLOAD.
ENDIF.
ENDDO.
CLOSE DATASET P_IFILE.
ENDIF.
IF IT_UPLOAD[] IS INITIAL.
MESSAGE E000 WITH 'NO data in the file/upload problem'.
ENDIF.
LOOP AT IT_UPLOAD.
SPLIT IT_UPLOAD AT ','
INTO
IT_FDATA-MATNR
IT_FDATA-WERKS.
IT_FDATA-SLGORT.
APPEND IT_FDATA.
CLEAR IT_FDATA.
ENDLOOP.
IT_TOTAL1[] = IT_FDATA[]. -
Issues with data exported in CSV format
Hi,
I'm wondering if anyone else is having problems with exporting system data as a CSV? I can successfully run an export, however many of the CSV files contain superfluous line breaks resulting in the comma delimiting not working properly when viewing the records in Excel.
Does this sound familiar to anyone else?
Cheers,
CameronAre you talking about the case where you export some records and when you open using microsoft excel everything looks as if in a text file? If so,then yes. Infact yesterday I was exporting and having the issue. Donot remember having the issue before the upgrade. What I did is opened a blank microsoft excel sheet.Then File>Open and chose the csv file.Then modified in the text import wizard to get it in the right format.
-
Input Date display and submit formats
I need to insert Timestamp into the Oracle database table field.
My particular EO attribute is of type "Timestamp", so that I can insert the Date with time. Also in the control hints format is "dd/MM/yyyy hh:mm:ss a"
The problem is that I just need to show only the Date without time in my table cell using input date.
If change the format in the control hints then I am unable to insert timestamp.
I also see there is a af:convertDateTime component inside af:inputDate.
Can some show easy path to achieve this?
In short how to display only selected date but to insert actual timestamp.
I use JDev. 11.1.1.3
Thanks.Thanks for the concern.
But if I use "af:convertDateTime" and set pattern to "dd/MM/yyyy" to achieve showing date only I will loose the timestamp to be inserted.
Basic requirement is to show date only and insert real timestamp using input date, also note that I insert timestamp on another user action after the user change the input date value.
I feel like this can not be achieved with single input date in ADF. Am I right? Or is there a way?
Please help. -
Apply conditional formatting when a report is exported to CSV format
Hello
OBIEE dasboard has the option to export the report data to CSV format.
But the problem is that on some columns of the report, it uses various different types of conditional formatting that tells, what to display when data is equal to one of those edge cases. So hence the report on the dashboard page shows accordingly which is fine.
But when the report is exported to CSV format, no conditional formatting is applied and all the raw data is shown without any formatting.
Is there any way to make sure that the conditional formatting is applied even in the data exported to CSV format.
thanksCSV is supposed to be a data dump .. i dont think you can have formatting saved when u download csv file.. try downloading it to excel and changing it to CSV
-
Function to download in csv format
Hi Every Body,
am using asp.net as a front end and oracle 11g as back end am wondering if there is a way to download data in an csv format and merge them into a table.
i.e i need to provide a button for this functionality.
Regards
Nii MoiNii Moi wrote:
Hi Every Body,
am using asp.net as a front end and oracle 11g as back end am wondering if there is a way to download data in an csv format and merge them into a table.How is this related to Application Express ? Please explain -
Obiee 11g hierarchy columns download into csv format.
When using hierarchical columns, Is there a way to download the results as the user see it on the view (be it table or pivot view) into a CSV format.
Excel format works, but if the user drill down on the hierarchy column and then export in CSV format... the data gets exported to the level the report was originally set.
Is there any way to change this behavior?
One option we can recommend to users is to download in excel format and then convert to CSV....if needed.
FYI, we just starting looking into 11g 11.1.1.5 version... planning to migrate from 10g to 11g...
Thanks
SundarNii Moi wrote:
Hi Every Body,
am using asp.net as a front end and oracle 11g as back end am wondering if there is a way to download data in an csv format and merge them into a table.How is this related to Application Express ? Please explain -
How to convert from line chart data to CSV format
Hi ,
I am using Flex 3 and AS.
I am getting data from MS SQL and display the data as line
chart this is ok.
But i want to convert this line chart data to CSV or .xsl
format.I find one example in fourms the from data grid to CSV
For this URL is
http://www.abdulqabiz.com/blog/archives/flash_and_actionscript/datagriddataexporter.php
But i want Line chart to CSV.Please help me.Line chart is a just a visual representation of some data
that's sitting in your database. Isn't it? You load this in Flex,
probably using HTTPService class, and pass it to some chart object.
Now when use says that she needs it in CSV format, you're
gonna have to send another request to the server to produce the
same data, convert into CSV or XLS format and let user download it.
Of course, if use doesn't want to download, you don't have to
go to the server, at least for CSV format. You can convert the same
data that used plot the chart to convert to CSV.
Am I missing something here?
ATTA -
Show user entered date when ssrs report exported to csv format
Hi All,
How can I show date range parameter entered by user when ssrs report is exported to csv format.
my csv output should look like this....
Date : 01/01/2015 TO 01/31/2015 (user selected dates)
ID,EmpFirstName,EmpLastName,Location
1,Tom,Garry,NY
2,John,Graham,NJ
3,Ron,Lorrie,CA
Thanks,
RH
sqlHi RH,
You can add two textbox at the top outside the tablix and using expression to get the parameter value use have selected to display in the textbox as blew:
TextBox1: =Parameters!Date.Value
TextBox2: =Parameters!To.Value
For Multiple value parameter you can use the expression like : =Join(Parameters!Date.Value,",")
You can rename the two textbox' name in the properties as "Date" and "To" then the two textboxs will display like belkow in the CSV report:
Date TO
01/01/2015 01/31/2015
ID EmpFirstName EmpLastName Location
1 Tom Garry NY
2 John Graham NJ
3 Ron Lorrie CA
If you still have any problem, please feel free to ask.
Regards
Vicky Liu
Vicky Liu
TechNet Community Support -
Data ONTAP PowerShell Toolkit - Collect SYSSTAT type of information in CSV format
As part of performance monitoring and analysis collecting performance data is crucial. Even though historical data could be collected with other monitoring tools we are often using SYSSTAT command to collect such data during short period of time of specific activity to analyze performance of NetApp array. Raw output of SYSSTAT command is useful but in some cases it needs to be presented in more visual form such graphs and charts. Producing Comma-Separated-Values file from SYSSTAT command output is long and painful process.
Working with customer on performance analysis made me to develop PowerShell script which can capture such data in CSV format, so that data can be processed much faster and presented to customer in nice graphical format.
Script Get-NaSysStat.ps1 uses Get-NaPerfCounter and Get-NaPerfData commandlets to extract performance data of NetApp array and store them into CSV file. Script uses next parameters:
NaIP : IP address or Name of the Filer
NaUS : Filer User Name. Default Value - root
NaPW : Filer User's Password. Default Value - password.
Output : Display/<File Name or Path>. Default Value - Display
Interval : Interval in minutes between samples. Default Value - 5 min.
Iterations : Number of sample iterations.
Default Value - 0, for no limit.
Execution can be ended by pressing Ctrl-C
Example of calling script and screen output:
PS C:\@work\Scripts> .\Get-NaSysStat.ps1 -NaIP 10.58.97.11 -NaUS root -NaPW <password> -Output Perf.csv -Interval 1
Name Value
Time 4/7/2011 4:37:03 PM
system_model FAS6070
ontap_version NetApp Release 8.0.1RC2 7-Mode: Thu Oct 21 01:27:45 PDT 2010
serial_no ***
system_id ***
hostname Array-01
nfs_ops 0.00
cifs_ops 0.00
http_ops 0.00
fcp_ops 8.50
iscsi_ops 0.00
read_ops 0.00
sys_read_latency 0.00
write_ops 8.50
sys_write_latency 0.32
total_ops 8.50
sys_avg_latency 0.32
net_data_recv 2.20
net_data_sent 9.25
disk_data_read 169.61
disk_data_written 584.21
cpu_busy 2.12
avg_processor_busy 1.49
total_processor_busy 5.98
num_processors 4
Screen output is valuable part but parameter -Output tells script to save data into CSV file. Here is an example of CSV files:
Time, avg_processor_busy, cifs_ops, cpu_busy, disk_data_read, disk_data_written, fcp_ops, hostname, http_ops, iscsi_ops, net_data_recv, net_data_sent, nfs_ops, num_processors, ontap_version, read_ops, serial_no, sys_avg_latency, sys_read_latency, sys_write_latency, system_id, system_model, total_ops, total_processor_busy, write_ops,
3/28/2011 5:32:25 PM, 3.17, 0.00, 17.30, 6773.59, 21667.06, 1031.74, BP-SAN-04, 0.00, 0.00, 17.41, 284.66, 0.00, 12, NetApp Release 8.0.1 7-Mode: Wed Jan 5 17:23:51 PST 2011, 558.10, 700000501660, 0.83, 0.89, 0.75, 1873760944, FAS6280, 1031.54, 37.98, 473.44,
3/28/2011 5:33:26 PM, 2.07, 0.00, 10.88, 8511.15, 16221.77, 869.91, BP-SAN-04, 0.00, 0.00, 6.29, 91.75, 0.00, 12, NetApp Release 8.0.1 7-Mode: Wed Jan 5 17:23:51 PST 2011, 656.24, 700000501660, 0.80, 0.79, 0.84, 1873760944, FAS6280, 869.70, 24.89, 213.46,
3/28/2011 5:34:27 PM, 0.83, 0.00, 3.59, 3311.89, 5268.20, 131.53, BP-SAN-04, 0.00, 0.00, 1.84, 9.72, 0.00, 12, NetApp Release 8.0.1 7-Mode: Wed Jan 5 17:23:51 PST 2011, 50.07, 700000501660, 0.81, 1.05, 0.65, 1873760944, FAS6280, 131.35, 10.00, 81.28,
3/28/2011 5:35:28 PM, 1.66, 1.70, 10.61, 2518.90, 3812.95, 241.06, BP-SAN-04, 0.00, 0.00, 12.41, 25.53, 0.00, 12, NetApp Release 8.0.1 7-Mode: Wed Jan 5
Performance data is exported into Microsoft Excel for further analysis and nice performance graphs created within minutes:
Script is attached to this post.i can't start this script - i have error:================C:\ps\Get-NaSysStat.ps1:52 row:10 + $Filer = Connect-NaController $NaIP -Credential $Creds + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Connect-NaControllertring) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException================what can i do?
-
Need help in writing data to a flat file in .csv format
Hi All,
could you please show with a sample example to write data in .csv format using UTL_file.
The result of the refcursor i want to write to a file in .csv format.
How can i achieve this.
ThxHi,
There are two ways to acheive this.
First and which I prefer is creating a SQL script which will generate csv file at the specified location in CSV format. And then this SQL script can be called from your cron job similar to how you call stored procedure. Following is pseudo code that can be used -
set linesize 500
set echo off
set feedback off
set prompt off
set pagesize 0
spool <name of the csv file>.csv
<Your select statement>;
spool offPut select statement delimiting columns you want to use with ','. E.g. following query should create a CSV file named as abc.csv with one record and 2 columns delimited by comma. First column is ENO and second column is ENAME.
set linesize 500
set echo off
set feedback off
set prompt off
set pagesize 0
spool abc.csv
select ENO || ',' || ENAME from employee;
spool offSecond, you can write a PLSQL procedure and then call this procedure from cron job. There is a generic procedure shared by BluShadow some time back which is a very good example for this. Please refer to following link for this solution -
REF Cursor creating CSV files
I will suggest to use first method above if possible since it will be faster and less complicated in my opinion. Second method is recommended for scenarios where select statement is created dynamically and cannot be written during development.
Hope this solves your purpose.
Cheers,
Anirudha -
Search report - error-no data found when printing to csv format
Hi all,
I have a search report,
I have 4 select list and two text field and two date field to search for the result.
I have even put the computation for the select list items in
on load - before header ie setting the items to default value.
Still when i try to print it in the csv format , and try to open the excel, it is saying "no data found" error
Please, Could any one give me a solution to solve this bug?
Note: Ordinary report is getting printted in the csv format.
Thanks in advance
bye
SrikaviHi Denes and Scott,
sorry, only when i select the values for all the 4 select list
csv is working. default values are not restored in the session.
How to restore the values in the session state after pressing the search button.
i have set the default values for the select list and the query is working fine
but when i see the session from the toolbar the default values are not present.
but when i see the debug from the toolbar the values are set properly.
@Denes
In your example the session is showing the values of the select list and check box
The same way i did, but in "session" values are not seen so again no data found is seen when printing csv .
Bye
Srikavi -
Output report data to excel file format or csv format
Is there any way to save softcopy of report output to excel file format or csv format.
Hi,
Regarding csv file format, i have no issues. The file is generating without any issues in using oracle reports without using any PL/SQL code.
My requirement is to design oracle reports to generate excel (.xls) file with multiple worksheets. Each sheets are having many data and graphs(chart).
Using oracle reports alone, how to achieve this.
In oracle reports 10g 1.2.0 version, I tried by creating .rdf file but, it is generating single worksheet only.
In oracle reports 10g 1.2.0 ver, I tried by creating .jsp file. For this first i am creating excel template about how my ouput column headings all that going to be with one sample hard coded data and save the excel file as web page.
Eg employee.html.
Next open the html file in oracle reports builder and double click the websource now, you will see the jsp tags, html and xml tags. Now include the contentType="application/vnd.ms-excel " and charset also.
Next, include the <rw:foreach id="G_EMPNO_1" src="G_EMPNO">
here insert the fieldl for each column by removing the hard coded values.
close the tag
</rw:foreach>
Save the file as .jsp and deploy it in oc4 enabled folder (say, devsuite_home/reports/j2ee/reports_ids/web
Start the oc4J server
Run it in the browser http://server:port/reports/emp.jsp?useride=uid/pwd@db
It is invoking the Microsoft excel with 3 sheets default and my emp table output in the first page.
We can save this output file as .xls file by clicking file -> save as.
1) The question is, it is working fine with Microsoft excel 97-2003 version. But for excel 2007, i am not able to create single html file like how 2003 save web page option.
2) I found this in oracle getting started demo
http://www.oracle.com/technology/products/reports/htdocs/getstart/demonstrations/index.html
Which is more useful. This is what i am looking for.
I done that in excel 2003 as per demo. But excel 2007 with reports 10g issues.
Is there any demo for 10g with excel 2007
3) For most of excel issues working fine with excel 2003 and 10g. But excel 2007 with 10g reports are issues.
I want the excel output from oracle reports with multiple worksheet similar to the above demo.
Thank you.
Maybe you are looking for
-
Delivery proposal for free item
Dear All, While creating sales order with free item the delivery proposal deactivated, how we can make it editble in case free items (in schedule lines) regards murthy
-
How do I install mountain lion onto my 2009 macbook?
Just bought my first Mac and not sure what I'm doing.
-
Error of method not found in C# class in VS 2013 on win7
I am changing a C# code in a solution (it has many files and projets) from VS 2013 on win 7. I added some properties in class1. It was built well. But, it has run-time error: Method not found : class1.set_p1(system.string) The code logic is as follow
-
Hi..I'm having trouble wiht my query. I'm getting way too many rows when displayed. I should have either 12 or 24 row...I think 12, but not sure. What I am getting is 228 rows displayed. This is all my code, including the select statment that dsiplay
-
I'm having some general trouble figuring out how to set properties and handle events and listeners in response to state changes. For starters, I have an application, which currently has two states: "audioMenu" and "videoMenu". Both states share a Vi