Query on Export to Excel
Hi All,
I need some suggestions in using "Export to CSV"
Situation is as follows:
I have a report that gets dispalyed based on many search condiitions. Once the report is dispalyed, and the user clicks on Export to CSV link, i set a hidden item value as 1. My CSV link looks like this(I use this instead of the custom #CSV_LINK#) -
href="f?p=&APP_ID.:&APP_PAGE_ID.:&APP_SESSION.:FLOW_EXCEL_OUTPUT_#REGION_ID#_en-us:::P0_capture_export:1:" >Export to Spreadsheet
Based on this value I have written a pl/sql process that inserts data into table. If this has to be executed, the page needs to be submitted if i select process point as "On Submit". Or the page needs to be reloaded if i select process point as "On Load".
But the problem is that, when user clikcs on "export to csv link" the page is not submitted, and neither is it reloaded.
I need the page to be submitted only after the file dialog box appears.
Any idea how this can be achieved? I tried Javascript reload. This only reloads the page and ignores the "Export request".
Please help. Any suggestions are welcome.
Thanks,
Sumana
Message was edited by:
Sumana
Sumana,
What you may want to try is to have your custom link submit the page, run your onSubmit process, and then re-direct to another page where you could roll your own CSV export procedure and execute that in a before header process.
You can use the same item references on the second page, so that your exported report has the same data as your displayed report.
See my blog posting on creating custom CSV exports here: http://spendolini.blogspot.com/2006/04/custom-export-to-csv.html
Thanks,
- Scott -
Similar Messages
-
Query on Export to Excel- Help needed
Hi All,
I wanted to know if we can set a hidden field value when user clicks on the "export to excel" link in the reports.
I am using the Apex Export feature itself. Is it possible to set an item value when user clicks on the link?
If yes then how can we do it? If no can you please let me know the other options available?
Thanks,
SumanaThanks Denes!
I understood how to trigger the process on click of the export to csv link. As of now i will implement that in my application..
I just wanted to know if "the" dialog box could be controlled.
But later maybe,( if my client really needs it...), I will have to use my custom export to excel option. I have even downloaded your download-excel.
But it says that it cant be used for pl/sql returning function....
Is there a workaround on that?
And I will tell you the difference it makes to my application.
Current Requirement: I need to track the information (for e.g say user id's) that have been sold to a customer. I am doing this by inserting the data exported by user to the table. This must happen only when user saves the file. Only when user saves the file, the information is considered as "Slod".
Now if the user click on export to csv link but simply opens or cancels the file download, that information is not considered as "Sold"
Hence my need, that i could control the dialog box. Hope this clears your doubt.
Regards,
Sumana -
Automate query that export to excel
Hi,
I'm not sure if this is the right place to post this question... but....
I run some queries every day and export to an excel file and send by email every day, there is any way to make it automatic?
Do anyone have any suggestion?
Thanks,
Leandro TakedaYou can use Dump_Csv developed by tom kyte. Below is the code that i modified for my requirement.
create or replace function dump_csv( p_query in varchar2,
p_separator in varchar2
default ',',
p_dir in varchar2 ,
p_filename in varchar2 )
return number
AUTHID CURRENT_USER
is
l_output utl_file.file_type;
l_theCursor integer default dbms_sql.open_cursor;
l_columnValue varchar2(2000);
l_status integer;
l_colCnt number default 0;
l_separator varchar2(10) default '';
l_cnt number default 0;
l_colDesc dbms_sql.DESC_TAB;
begin
l_output := utl_file.fopen( p_dir, p_filename, 'w' );
dbms_sql.parse( l_theCursor, p_query, dbms_sql.native );
for i in 1 .. 255 loop
begin
dbms_sql.define_column( l_theCursor, i,
l_columnValue, 2000 );
l_colCnt := i;
exception
when others then
if ( sqlcode = -1007 ) then exit;
else
raise;
end if;
end;
end loop;
dbms_sql.define_column( l_theCursor, 1, l_columnValue, 2000 );
l_status := dbms_sql.execute(l_theCursor);
dbms_sql.describe_columns(l_theCursor,l_colCnt, l_colDesc);
l_separator := '';
for lColCnt in 1..l_colCnt
loop
utl_file.put( l_output, l_separator || '"' || Upper(l_colDesc(lColCnt).col_name) || '"');
l_separator := p_separator;
end loop;
utl_file.new_line( l_output );
loop
exit when ( dbms_sql.fetch_rows(l_theCursor) <= 0 );
l_separator := '';
for i in 1 .. l_colCnt loop
dbms_sql.column_value( l_theCursor, i,
l_columnValue );
utl_file.put( l_output, l_separator || '"' ||
l_columnValue || '"');
l_separator := p_separator;
end loop;
utl_file.new_line( l_output );
l_cnt := l_cnt+1;
end loop;
dbms_sql.close_cursor(l_theCursor);
utl_file.fclose( l_output );
return l_cnt;
end dump_csv;Thanks,
Karthick. -
Export to Excel - data with leading zeros
Does anyone have any tips or tricks for running a query then exporting to Excel without dropping leading zeros from the data?
Examples: numeric Item codes with leading zeros, telephone numbers that have been entered with no spaces.
Regards,
Douglas McDove< Font Color="RED" Size = 3 Face=Verdana>
I liked the challenge and therefore.......I got this for you
</Font>
SELECT CHAR(28) + T0.CardCode [BP Code\] FROM [dbo\].[OCRD\] T0
SELECT CHAR(29) + T0.CardCode [BP Code\] FROM [dbo\].[OCRD\] T0
SELECT CHAR(30) + T0.CardCode [BP Code\] FROM [dbo\].[OCRD\] T0
SELECT CHAR(31) + T0.CardCode [BP Code\] FROM [dbo\].[OCRD\] T0
Any of the above 4 should work. T0.CardCode is the database field I tested, you can substitute this with any database field and it should work.
Regards
Suda -
Export to Excel from Report region (pl/sql returning sql query)
Hello all,
I have encountered an interesting problem. I have an HTMLDB application with a lot of sql reports coded straight inside the report region. In order to better organize my reports, I decided to
1. make all my report regions of type "Pl/Sql function returning SQL query"
2. create a package inside my database schema which houses all reports as pl/sql functions returning VARCHAR2, the string returned being the report query
3. just calling "return package_name.function_name" from inside my report region of type "Pl/sql function returning SQL query".
This technique seemed to work perfectly. The reports were being returned as expected. I was then asked to provide the "Export to Excel" capability to all my reports. This seemed like a piece of cake using HTML DB's "Export to Excel" extension. However, the "export to excel" does not function correctly when my reports are inside a package in the database. HTML DB tries to export but inside the excel spreadsheet, instead of seeing row data, I see:
<pre>failed to parse SQL query:
ORA-00936: missing expression
<!-- select a.username, b.table_name, 'View Row Data' from schema_browser_user_list a, all_tables b where a.user_id = and a.username = b.owner order by b.table_name asc
--!>
</pre>
I am building my query string inside of my package functions by using a combination of literal strings and concatenating them with some parameter values being passed in. It seems that the HTML DB engine which exports the report to excel does not properly understand the concatenation of variables as can be seen by the empty space to the right of the equal sign in the "a.user_id = " clause. Does anybody have any input as to whether this is a known issue or if I am doing something wrong? Thanks a lot for your time.
- Kenny R.James,
Thanks for the quick reply. I think you mis-understood what I'm doing. All I'm doing is creating packaged functions which return VARCHAR2. The VARCHAR2 that they return is the report query. With this technique, I no longer have to type the query into the HTML DB report region. Instead, I make the report region a "Pl/sql function returning sql query" and make the following call: return package_name.function_name(some_application_items passed in as parameters)
This makes for a much more organized html db app. The problem is that the "export to excel" function does not correctly interpret the VARCHAR2 that my packaged functions are returning. Is this a better explanation? Thanks again for your time.
- Kenny R. -
Hi,
I am filtering SharePoint list view web part based on Query string parameter and I am doing Export to Excel by using following code.
<a href="#" onclick="javascript:window.location='../_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List=0DC67399-BE11-48F3-ADFC-E911FB8B5845&View=54671412-3EFE-4281-835A-9EF747AE774E&CacheControl=1'"><img
alt="Excel" src="/_layouts/images/icxlsx.gif" border="0"/> Export to Excel</a>
Issue: Able to do Export to Excel when there are no filters applied on list view web part but if applied filters on web part and do export to excel , only header fields are displaying in the excel sheet.
I don't know why owssvr.dll is behaving like that .
Please share your ideas.
Thanks in Advance.Hi,
According to your post, my understanding is that you wanted to create hyperlink to export to excel.
The URL to execute the export is as follows:
{Site URL}/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List={List GUID}&View={View GUID}&CacheControl=1
After getting the GUID, you need to “decode” the list GUID.
Replace %7B with {
Replace %2D with –
Replace %7D with }
More information:
Create Link to Export Library Contents to Excel
SharePoint - Create a link to export to Excel
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
To export query from Access to Excel in Read/Write mode in VBA
Below is the code which exports the query named 'LatestSNR' from Access to Excel;
Public Sub Expdata()
Dim rst As DAO.Recordset
Dim Apxl As Object
Dim xlWBk, xlWSh As Object
Dim PathEx As String
Dim fld As DAO.Field
PathEx = Forms("Export").Text14 'path comes from the directory given in form
Set Apxl = CreateObject("Excel.Application")
Set rst = CurrentDb.OpenRecordset("LatestSNR")
Set xlWBk = Apxl.Workbooks.Open(PathEx)
'xlWBk.ChangeFileAccess xlReadWrite
Set xlWBk = Workbook("PathEx")
Apxl.Visible = True
Set xlWSh = xlWBk.Worksheets("Metadatasheet")
xlWSh.Activate
xlWSh.Range("A2").Select
For Each fld In rst.Fields
Apxl.ActiveCell = fld.Name
Apxl.ActiveCell.Offset(0, 1).Select
Next
rst.MoveFirst
xlWSh.Range("A2").CopyFromRecordset rst
xlWSh.Range("1:1").Select
' selects all of the cells
Apxl.ActiveSheet.Cells.Select
' selects the first cell to unselect all cells
xlWSh.Range("A2").Select
rst.Close
Set rst = Nothing
' Quit excel
Apxl.Quit
End Sub
After the execution of code, the query is transferred to excel sheet and is viewed in 'Read only' mode. If I try to save it, a copy of the excel file is produced. Can the Excel be opened in Read/Write mode ? so as to save the workbook and also to transfer
the query to same workbook repeatedly.
If in case the change of mode is not possible, then is there any alternative method?Try this version:
Public Sub Expdata()
Dim rst As DAO.Recordset
Dim Apxl As Object
Dim xlWBk As Object, xlWSh As Object
Dim PathEx As String
Dim i As Long
PathEx = Forms("Export").Text14 'path comes from the directory given in form
Set Apxl = CreateObject("Excel.Application")
Set xlWBk = Apxl.Workbooks.Open(PathEx)
Set xlWSh = xlWBk.Worksheets("Metadatasheet")
Set rst = CurrentDb.OpenRecordset("LatestSNR")
For i = 1 To rst.Fields.Count
xlWSh.Cells(1, i).Value = rst.Fields(i - 1).Name
Next i
rst.MoveFirst
xlWSh.Range("A2").CopyFromRecordset rst
xlWBk.Close SaveChanges:=True
Apxl.Quit
rst.Close
Set rst = Nothing
End Sub
or else
Public Sub Expdata()
Dim PathEx As String
PathEx = Forms("Export").Text14 'path comes from the directory given in form
DoCmd.TransferSpreadsheet TransferType:=acExport, _
SpreadsheetType:=acSpreadsheetTypeExcel12Xml, _
TableName:="LatestSNR", _
Filename:=PathEx, _
HasFieldNames:=True, _
Range:="Metadatasheet!"
End Sub
Regards, Hans Vogelaar (http://www.eileenslounge.com) -
Hyperion Workspace Financial Reporting Export to Excel Query-Ready Missing
Hyperion Workspace Financial Reporting Export to Excel "Query-Ready" option is Missing in the dropdown when you go to File>Export>Excel
Only the "Fully Formatted" option is available.
From what I recall this option for a "query-ready" export should be available from the HTML preview?
Is there something in configuration that needs to be enabled or something that needs to be checked on to get this option?
We are running 11.1.1.3
The Query-Ready option is available when exporting forms in Planning.
When opening Financial Reports in Smartview the option for "Query-Ready" is available.
For some reason this is not showing up in workspace, does it not exist in 11.1.1.3? Is this a bug?
TIAHi,
The option to export the financial report output in "Query-Ready" format is actually at the bottom right hand corner of the report page (look at the report footer) instead of File>Export>Excel.
Hope this helps
Genti -
Automatic export to excel of a query
Hi all,
I have a query I must run on a daily basis and export the results to excel format them with a certain font and size and send it via email. Is there a way to automate all of this?
ThanksHello;
Yes I believe so.
I would look to a reporting tool. For example Business Objects will auto generate and e-mail reports. Since they also export to Excel I'm thinking they can handle most of your requirements. If they can export to an Excel Template that might be one way to handle your font type and size.
In any event I believe a reporting tool is you best option.
Best Regards
mseberg
This example shows how to email Scheduled Reports in Business Objects and delivered / emailed in MS Excel format.
http://www.letslearnbi.com/2009/05/how-to-email-scheduled-reports-in.html
So certain third part tools will do the job.
Edited by: mseberg on Nov 18, 2011 7:26 AM -
WAD Export to Excel, PDF parameters query export
Hi,
I solve the problem with export to excel in WAD. Customer want to see all parameters (and also filters in query) with which are query execute in query in export to MS Excel or PDF.
Any advices?
Thanks
PetrHi,
Take a copy of template 0ANALYZER, it will have all the components which have the web analyzer.
Check the below link for the same:
http://help.sap.com/saphelp_nw04/helpdata/en/0d/af12403dbedd5fe10000000a155106/frameset.htm
Hope this helps........
Rgs,
Ravikanth -
MSS Report Export to excel - ERROR - load: class query not found
Hi All,
I am navigating and getting error as follows:
Manger Services ->My reports -> Report Selection -> HIS Reports -> General -> Employee Details -> add some people and click start report -> report shows -> click local file -> save as spreadsheet get ERROR - load: class query not found in the status bar or IE and IE then locks up
Please reply if any one has some clue.
Thanks & Regards,
VishalHey Vishal,
This issue gave us a very hard time. The query was HRIS manager. when you add some attributes to be exported to excel and then select export. It hangs there. or hangs at the step where you select save as spreadsheet, OR after it where it runs a query to export.
I came to know that Java JRE is used in the last step. So for solving this issue, go to java.com, on the first screen there will be big link to install java(i guess JRE). install it and then try exporting your query. I am sure it will work.
Just notice that after doing installation of Java you will get coffee cup in you system tray.
Thanks.
Ankur.
P.S. Points if works. -
"Export to Excel" does not work for query based on Master Data InfoSet
We have many queries based on InfoSet consisting 2 or more PS Master Data. After we upgraded from BW 3.1 to 3.5, the "Export To Excel" function no longer works via BEx Browser. It returns all blanks where master data should be shown. Only the non-data area like column headings are exported to excel.
Is this a bug introduced in BW 3.5?
Thanks,
KinukoIt seems that BW 3.5 SP10 may fix this problem.
-
Export to excel with javascript/vbscript or with plsql(html table)
i have searched for a way to export data from OracleXe to excel without losing formatting .
So far i have found 2 possible relatively easy ways that i am still researching
(i do not include the ask tom sylk format way of exporting )
1 to export the query to a html table, while using stylesheets for formatting
(using microsoft specific styles)
2. use of javascript/vbscript to fill an array and write this array to excel with use
of visual basic for applications in excel.This also provides charting capabilities.
I am still researching this two ways, and have
encountered a few obstacles (help would be appreciated)
1 the first way:
a. create a button " export to excel"
b. create the following pl/sql procedure:
owa_util.mime_header('application/vnd.ms-excel');
owa_util.http_header_close;
HTP.PRINT('<html>');
HTP.PRINT('<head>');
HTP.PRINT('<meta http-equiv="Content-Type" content="text/html">');
HTP.PRINT('<title>Title of the HTML File</title>');
HTP.PRINT('</head>');
HTP.PRINT('<body TEXT="#000000" BGCOLOR="#FFFFFF">');
HTP.PRINT('<h1>Heading in the HTML File</h1>');
HTP.PRINT('<p>Some text in the HTML file.');
HTP.PRINT('</body>');
HTP.PRINT('</html>');
htmldb_application.g_page_text_generated := true;
htmldb_application.g_unrecoverable_error := true;
c: run the procedure conditionally based on the button "export to excel"
the problem with this way is that using htmldb_application.g_unrecoverable_error := true; is not the ideal way, because it
stops further processing, but if i leave it out, the export doesn't happen.
To export to excel while retaining data formatting you have to use microsoft excel
specific styles(Seedocumentation on the microsoft site)
2.The second way:
a create a pl/sql procedure or sql query.
b use this query to fill a vbscript/javascript array with values
c write these values to excel with use of vba in excel :
the obstacle i encountered here was that i dont know how to export the result of a
query to a visual basic script or javascript array.Using approach 1) works fine for me.
the problem with this way is that using htmldb_application.g_unrecoverable_error := true;
is not the ideal way, because it
stops further processing, but if i leave it out, the export doesn't happen. Why is this a problem?
I created the button to export the excel file on page 1 and created your pl/sql procedure on page 2 using an onload process.
Works fine.
Other approaches for exporting to excel are:
http://www.oracle.com/technology/pub/articles/saternos_broadcast.html
http://htmldb.oracle.com/pls/otn/f?p=18326:54:5685133631021176591::::P54_ID:1962
~Dietmar. -
2013 versus 2010 - Export to Excel
Hi,
When exporting a view from Project Server 2013 Project Center to Excel, it seems to export without any formatting (no colours, etc).
It only exports rudimentary formatting such as the indenting.
This seems to be different than it used to be.
Does anyone know if this is expected behaviour? Or is there something wrong in our config? The configuration was upgraded from 2007 - 2010 - 2013.
thanks,
http://blogs.umtsa.co.za/nicooHi Nico,<o:p></o:p>
I can reproduce the same behaviour in Project Server 2013 environment. The export is without any
formatting (no colors etc.). Your environment configuration looks precise.<o:p></o:p>
I have found related thread to your query. Here is the link you may find useful – <o:p></o:p>
http://social.technet.microsoft.com/Forums/projectserver/en-US/85c8331f-85b9-4e34-9e27-612ffda0b7d4/project-server-2010-project-center-views-export-to-excel-with-formatting?forum=projectserver2010general<o:p></o:p>
Cheers, Badal -
Formatting of Excel worksheet While using Export to Excel
Hello Experts,
I have a requirement to format the workbook according to the user needs while the user clicks "Export to Excel" in the webpage of Web template.
The major problem is with the hierarchy.. when exporting, the hierarchy nodes have triangular symbols.. is there any way to remove them??
What can i do, so that i can make changes to the default export format of the workbook, while exporting it??
Any helpful suggession will be appreciated and rewarded.
Thanks and Best Regards,
Vikas Bittera.Hi Mark,
Thank you very much for the response.. however this is not the full solution of my problem..
Now, if i execute the same query in the BEx explorer analyzzer, then even this setting does not work... it shows traingles.. wht oue intention is to use Excel grouping function, so that the user will have better navigation in hierarchy..
so is there any way to do this? we need to other formatting of the output.. is it possible that we can change the standard query ouput in excel??
Looking ahead for your response..
Thanks and Best Regards,
Vikas Bittera.
Maybe you are looking for
-
IPhoto 6.0.5 - No full screen; no edit windows
For some reason the Edit windows for exposure, etc., have disappeared. I checked "help" and find that I can neither switch to a full screen nor see the "edit" buttons after hitting "edit." All I get are the "enhance", "crop," etc. I know I had these
-
Hi. I'm looking for a simple progress bar (a.k.a ticker) widget and wondering if anyone knows of one that might exist. Everything I see is for a specific purpose - none that match my need. I am looking for something more universal, where I can set th
-
XI Install SM59 destination error messages
I have an IDES system installed and now we are trying to get XI 3.0 SR1 on SQL Server installed for a project for one of our customers. I have followed the XI install guide and I think I have almost everything working except for one major issue. I ca
-
Hi i am making EDitable alv using refrence program 'BCALV_EDIT_03'. but i want to give error message in center of the window. then how is it possible. i am using same class ER_DATA_CHANGED->DISPLAY_PROTOCOL. so please let me know
-
Adobe Lightroom 3.3 BSOD
Hey guys, About two weeks ago I installed the trial version of Adobe Photoshop Lightroom 3.3. I am loving it to death and am considering purchasing the program, although there is a major issue that is standing in my way. Since I installed, I have pro