How to Export the BI Beans report to Excel sheet?
Hi all,
I have a requirement of exporting the report generated by using BI Beans to Excel sheet (*.xls NOT *.csv)
Is this possible directly using any feature of BI Beans?
If not can I get the java resultset object along with meta data like column header and row header, which I can use to write the report to Excel sheet using third party excel writers like JExcel?
Please provide the code excerpts for getting the resultset.
Thanks,
Mrutyunjay
Hi,
Currently we only support export to csv file. The code below might help you traverse a crosstab. It is from a demo system, when a user clicks on a data cell it finds where the user clicks and updates a linked graph. So this code gets a query and traverses a particular dimension. It should hopefully point you in the correct direction.
DataComponentHandle ch = (DataComponentHandle) e.getComponentHandle();
* Thru the ComponentInfo, you can determine the row and column number
* where the user clicked. We want the dimension/dimension member combinations
* for where the user clicked. This is achieved by looking at the QDR - or
* Qualified Data Reference. Data Access will resolve the row/col into
* a dimension/dimension member pair
DataAccess dataAccess = m_linkableCrosstab.getModel().getDataAccess();
QDR qdr = ch.getComponentInfo().getQDR(dataAccess, QueryDataAccess.QDR_WITH_PAGE);
// Get the Geography selection from the QDR
QDRMember member = qdr.getDimMember(GEOGRAPHY);
// Chnage the Graph to display the data for the Geographical
// region the user selected in the Crosstab
try {
// Get the Query of the top right Graph
QueryClient query = (QueryClient)m_linkableGraphTop.getDataSource();
if (query != null) {
Selection sel = query.findSelection(GEOGRAPHY);
sel.removeAllSteps();
// Create a new MemberStep for Geography,
// and set the member on it to be the one user cliekd on in the Crosstab
MemberStep ms = new MemberStep(GEOGRAPHY);
ms.setHierarchy(sel.getHierarchy());
ms.addMember(member.toString());
sel.addStep(ms);
// Apply the new Geography selection to the Graph
query.applySelection(sel);
catch (Exception ex) {
getParentFrame().showExceptionDialog(ex);
Hope this helps
BI Beans PM Team
Oracle
Similar Messages
-
How to export the data from table to excel sheet
hi experts i have some problem am trying to export the data fro table to Excel sheet in the view controller i have created one button wit public void onActionCLEAR(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionCLEAR(ServerEvent)
//wdContext.nodeBapi_Salesorder_Getlist_Input().
//wdContext.nodeBapi_Salesorder_Getlist_Input().invalidate();
//@@end
//@@begin javadoc:onActionExporToExcel(ServerEvent)
/** Declared validating event handler. */
//@@end
public void onActionExporToExcel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionExporToExcel(ServerEvent)
try{
FileOutputStream fos=new FileOutputStream("Test.xls");
PrintStream ps=new PrintStream(fos);
ps.println("<html><body><table border=1>");
int size=wdContext.nodeBapi_Salesorder_Getlist_Input().size();
Iterator attributes=wdContext.getNodeInfo().iterateAttributes();
ps.println("<tr>");
while(attributes.hasNext()){
ps.println("<th>");
DataAttributeInfo attrName=(DataAttributeInfo)attributes.next();
ps.println(attrName.getName());
ps.println("</th>");
ps.println("</tr>");
for(int i=0; i<wdContext.nodeBapi_Salesorder_Getlist_Input().size();i++)
attributes=wdContext.getNodeInfo().iterateAttributes();
ps.println("<tr>");
IWDNodeElement ele=wdContext.getElementAt(i);
while(attributes.hasNext()){
ps.println("<td>");
DataAttributeInfo attrName=(DataAttributeInfo)attributes.next();
ps.println(""+ele.getAttributeAsText(attrName.getName()));
ps.println("</td>");
ps.println("</tr>");
ps.println("</table></body></html>");
ps.flush();
ps.close();
fos.close();
catch(Exception e){
wdComponentAPI.getMessageManager().reportException(e.getMessage(), false);
finally{
//return("Test.xls") ;
//@@end
}h action and i have return the code
its running sucessfully but am not able to perform the action plz help meHi,
You shouldn't use DataAttributeInfo as it is an internal object, if I'm correct.
Use IWDAttributeInfo instead of DataAttributeInfo and it should work
(See also API doc of IWDNodeInfo.iterateAttributes() at http://help.sap.com/javadocs/nwce/ce711sp02/wdr/com.sap.wdr/com/sap/tc/webdynpro/progmodel/api/IWDNodeInfo.html#iterateAttributes())
Cheers,
Robin -
How to export the data as integer into excel sheet?
Hi All,
I am working on export to excel functionality and using JEXCEL API to create it. When I export the data to excel sheet, the data are stored in text format in the excel sheet. If I click on summation button on excel sheet, it is not summing up the column values since it is stored as the text format.
I am writing the following code:
for(Iterator iter = columnInfos.keySet().iterator(); iter.hasNext();){
String attributeName = (String)iter.next();
for(int index = 0; index < dataNode.size(); index++){
try{
IWDNodeElement nodeElement = dataNode.getElementAt(index);
String colVal = nodeElement.getAttributeAsTex(attributeName);
Label value = new Label(j, index + 1, colVal);
sheet.addCell(value);
j++;
Here colVal is the variable which holds the data in string format. So I was just trying to convert it into integer format and used Integer.parseInt(colVal).
But Label keyword accepts only the int,int,string arguments.
Is there any other option to change it as integer value while exporting to excel sheet.
Pls suggest.
This is very urgent.
Regards,
Subashini.Hi Gopal,
Pls refer the following link.
/people/subramanian.venkateswaran2/blog/2006/08/16/exporting-table-data-to-ms-excel-sheetenhanced-web-dynpro-binary-cache
I have used the same coding which is mentioned in this link.
And also I cannot use integer.parseInt(colval) because new Label() will accept only the int,int,string as parameters.
Here goes my to excel method code which exports the data to excel sheet .
private FileInputStream toExcel(IWDNode dataNode, Map columnInfos) {
String fileName = "output.xls";
IWDCachedWebResource cachedExcelResource = null;
int i = 0;
try{
File f = new File("output.xls");
WritableWorkbook workbook = Workbook.createWorkbook(f);
WritableSheet sheet = workbook.createSheet("First Sheet", 0);
for(Iterator coluinfoitr = columnInfos.keySet().iterator(); coluinfoitr.hasNext();){
Label label = new Label(i, 0, (String)columnInfos.get(coluinfoitr.next()));
sheet.addCell(label);
i++;
int j = 0;
for(Iterator iter = columnInfos.keySet().iterator(); iter.hasNext();){
String attributeName = (String)iter.next();
for(int index = 0; index < dataNode.size(); index++){
try{
IWDNodeElement nodeElement = dataNode.getElementAt(index);
String colVal = nodeElement.getAttributeAsText(attributeName);
Label value = new Label(j, index + 1, colVal);
sheet.addCell(value);
catch (Exception e){
wdComponentAPI.getMessageManager().reportException(" Data Retrive Err :" + e.getLocalizedMessage(),false);
j++;
workbook.write();
FileInputStream excelCSVFile = new FileInputStream(f);
cachedExcelResource = getCachedWebResource(excelCSVFile, fileName, WDWebResourceType.getWebResourceType("xls", "application/ms-excel"));
wdContext.currentContextElement().setExcelDownload(cachedExcelResource.getURL());
workbook.close();
It is exporting the data in text format. So I am unable to sum up the column values in the excel sheet.
I need an alternate solution wherein I can export the data in integer format to excel sheet and then sum up the column values by clicking on summation button.
Hope I am clear now.
Pls suggest.
Regards,
Subashini. -
How to export the text edit data to excel file without splitting the data in excel file?
how to export the text edit data to excel file without splitting the data in excel file?
I have a requirement in SAP HR where in the appraiser can add comments in the area given and can export that to excel file. Currently the file is getting exported but the comments getting split into deifferent rows.
I want the entire comment to be fit in one row.
Please help.
Thank youHi,
if your text edit value is stored in 'lv_string' variable.
then before exporting the value to excel you have to remove CL_ABAP_CHAR_UTILITIES=>NEWLINE
that is '#' from the variable lv_string.
for that use code some thing like this.
REPLACE ALL OCCURRENCES OF CL_ABAP_CHAR_UTILITIES=>NEWLINE in lv_string WITH space.
I think this will do the trick. -
How to export a dynamically generated datatable into excel sheet 2013?
I have one data table and in that data table i am fetching data from sharepoint 2013 lists.
When I export that data table into excel sheet, what ever data is static will be shown but the data which I fetch from lists are not coming.
How should I get that data in my excel sheet from that data table?
This is the code for Export to Excel:
public void ExportToExcel(DataTable dt)
if (dt.Rows.Count > 0)
string filename = "WebTrafficReport.xls";
System.IO.StringWriter tw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
DataGrid dgGrid = new DataGrid();
dgGrid.DataSource = dt;
dgGrid.DataBind();
//Get the HTML for the control.
dgGrid.RenderControl(hw);
//Write the HTML back to the browser.
//Response.ContentType = application/vnd.ms-excel;
Response.ContentType = "application/vnd.ms-excel";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename + "");
this.EnableViewState = false;
Response.Write(tw.ToString());
Response.End();
Thanks in Advance.ublic void ExportToExcel(DataTable dt)
if (dt.Rows.Count > 0)
string filename = "WebTrafficReport.xls";
System.IO.StringWriter tw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
DataGrid dgGrid = new DataGrid();
dgGrid.DataSource = dt;
dgGrid.DataBind();
//Get the HTML for the control.
dgGrid.RenderControl(hw);
//Write the HTML back to the browser.
//Response.ContentType = application/vnd.ms-excel;
Response.ContentType = "application/vnd.ms-excel";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename + "");
this.EnableViewState = false;
HttpContext.Current.Response.Write(sw.ToString());
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End();
}}try this should help -
How to Export The result of querry to Excel?
Hi ,
Can you tell me how can i export the result of a query is having to an excel or to any file in JDeveloper?
It is having 70 thousand records.Raphael is right, excl can£t load more then 65000 rows and from my experience using the excl export listener is too slow.
You can however use e.g. POI and generate a native exel file. Still the 65000 row limit is valid.
Timo -
How to get the Last cell in HSSFCell (Excel sheet)
Hello
I am trying to convert an excel sheet to a tab limited file.
I am using HSSF and unable to track how do i know if the cell encountered is a last filled cell in excel sheet
Some of the cells in the sheet can be blank. In that case i am just using inputting a '\t' for that cell and read the next one. But coz of this when i get the last cell, a tab is included for that too.
Can someone let me know how can i rectify this?
it seems like HSSFCell does not have any methos like lastCell or so
Thanxthen use getLastCellNum() in org.apache.poi.hssf.usermodel.HSSFRow
-
How to download the all applicant address to excel sheet
Hi Geeks,
I want to download all the applicant address in excel sheet as one record .in table address are stored as different records ex :present address,permanent ,emergencey .i want this to be downloaded to excel as one record.
Thanks and Regards,
Sudhakar YadavHI Madan,
How are you doing ? thanku for the reply .my requirement is :
I want all the address to be downloaded to excel sheet in the fallowing format as:
Pernr present address permanent address emergency address :
All this should be in one record but in the database it is storing different records for present address and permanent address ..
My select statement is :
SELECT PERNR SUBTY NAME2 STRAS LOCAT ORT01 PSTLZ ORT02 LAND1 TELNR
FROM PB0006
INTO TABLE ITAB1
FOR ALL ENTRIES IN ITAB
WHERE PERNR = ITAB-PERNR.
Where all the data is there in the itab and I want to move all the data to one internal table as one record . -
How to export the result of omniportlet to excel format?
Hi All,
does anybody know that? I just can do that from the report created in "Locally Built Providers" by setting the output format to excel but omniportlet.
Maksonhi makson,
there is no default functionality for this operation in omniportlet. what you could try is to use the new HTML layout and embed a java script function that allows you to somehow transform the data into a CSV file and save it/display it in the browser.
regards,
christian -
Generating webi report from excel sheet.
Hi to all.
can I generate the web intelligence report by excel sheets in info view,if yes how can I generate them or any alternative solution exist to this..
please reply
thanks in advanceHi Rajat,
Starting from BOXI R3.0 version, Rich client is used for accessing WebI reports other than Infoview. i.e. Similar to Desk top intelligence, it can be installed in any local machine and using it we can access WebI reports.
If you don't have Rich client then install it in your pc, then start creating WebI reports from excel using Rich client.
Navigation: Open rich client -> select local source(browse to your doucment i.e excel sheet) -> select required tab in excel(for the report) -> ok
Cheers,
Suresh Aluri.
Edited by: Suresh Babu Aluri on Feb 1, 2010 9:52 PM -
Export Multiple tables into a single Excel Sheet
We have a use case where we need to export multiple tables into an excel sheet. The exportCollectionActionListener only allows one table (which is provided in the exportedId attribute) to be exported into Excel. So is there a method provided by adf to export more that one table into excel ?
dvohra,
I need to export multiple tables into a single excel sheet. These links only show how to export a single table to an excel sheet.
I have tried out this : http://iadvise.blogspot.com/2007/04/export-adf-table-to-excel.html. But i am not getting the popup to save the file. So i can't find out where the file got created. -
How to export the dashboard reports for Excel in OBIEE 11.1.1.6.0?
Hi Experts,
How to export the dashboard reports for Excel in OBIEE 11.1.1.6.0?
For example:
Dashboard contains more than one report, and add one export button for downloading these reports for Excel.
Is it possible to implement this requirement?Thanks.There is no direct option, you can try the following workaround.
Page Option -> Print -> Printable Html
Then File -> Save Page as
Choos Save as type as -> All files
File name as Report.xls
When you Open the xls file, if you get a pop up saying problem during load just omit it and proceed.
The report will open in excel.
Or save the page as html /mht and open it with Excel, this also will work.
Note: I have tested this in Mozilla
Thanks,
Vino -
How to export the data to a Excel file
Hi all,
How to use the 'EXCEL_OLE_STANDARD_DAT'
to export the data from itab to EXCEL file.
REPORT ZT11.
data : begin of itab occurs 0,
t1(3) type c value 'sag',
t2(3) type c value 'ntc',
end of itab.
append itab.
write : itab-t1,itab-t2.
CALL FUNCTION 'GET_FIELDTAB'
EXPORTING
LANGU = SY-LANGU
ONLY = ' '
TABNAME = ' '
WITHTEXT = 'X'
IMPORTING
HEADER =
RC =
TABLES
FIELDTAB =
EXCEPTIONS
INTERNAL_ERROR = 1
NO_TEXTS_FOUND = 2
TABLE_HAS_NO_FIELDS = 3
TABLE_NOT_ACTIV = 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.
CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'
EXPORTING
FILE_NAME =
CREATE_PIVOT = 0
DATA_SHEET_NAME = ' '
PIVOT_SHEET_NAME = ' '
PASSWORD = ' '
PASSWORD_OPTION = 0
TABLES
PIVOT_FIELD_TAB =
DATA_TAB =
FIELDNAMES =
EXCEPTIONS
FILE_NOT_EXIST = 1
FILENAME_EXPECTED = 2
COMMUNICATION_ERROR = 3
OLE_OBJECT_METHOD_ERROR = 4
OLE_OBJECT_PROPERTY_ERROR = 5
INVALID_PIVOT_FIELDS = 6
DOWNLOAD_PROBLEM = 7
OTHERS = 8
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.Hi, you can even use control technology. There are several example programs how to export data to excel. Please go to transaction SE80. Choose enviroment->examples -> control examples. Take a look at office integration.
/Ernesto -
How to restrict the display of report variants
Hello All,
I want t know how to restrict the display of report variants.
I mean, when a user saves a variant for his/her purpuse on some report program, only he/she can refer the variant while other users cannot.
I know that by setting the attribute of the variant ("Protect Variant ", "Only Display in Catalog"), this would be possible, but I want to know another way, without this setting.
Thank you for your help in advance.
Regards,Hi,
Can you just try this
DATA:it_varid TYPE TABLE OF varid.
DATA:wa_varid TYPE varid.
INITIALIZATION.
SELECT * FROM varid INTO TABLE it_varid
WHERE report = sy-repid
and ename = sy-uname.
IF sy-subrc = 0.
LOOP AT it_varid INTO wa_varid .
CALL FUNCTION 'RS_SUPPORT_SELECTIONS'
EXPORTING
report = sy-repid
variant = wa_varid-variant
EXCEPTIONS
variant_not_existent = 1
variant_obsolete = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDLOOP.
ENDIF. -
How export report into excel sheet automatically using SSRS 2010?
Hi,
I have created many reports using SQL Server Data Tool 2010 and at my work, we are using active batch to ran reports every month.
Now question is, my boss want me to set up reports such a way that when active batch is ran, reports should be exported into excel sheet automatically with the default values given for parameters at some specific folder location. How can I export report
into excel sheet automatically when active batch is executed?
Please help me on this. Thanks for the help in advance.
VickyCheck this:
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:/test.xls'
filetype = 'ASC'
write_field_separator = 'X'
TABLES
data_tab = t_output
Regards.
Maybe you are looking for
-
Can I use a new ipod touch in an old dock/speaker system
I will be in the states soon and thinking of getting and I pod touch the 5th edition. However I have an older dock/speaker system and wonder will it work in it. I have heard that you have to buy an adaptor. Is this true and are they easy to get and h
-
Purchase order item - link to document
Hello! As you know it is possible to link a SAP document to every position of a purchase order. My problem is that I want to fill this fields automatically with the data of the material master data (additional data) when the PO is created. Do you hav
-
What happened to my subscription
I just signed up and paid for a subscription to the Adobe export program. When I went in to export a PDF file to my Word, I was told that I had to subsceribe. I will be cancelling my credit card payment in 24 hours if I don't get this matter straight
-
Troubles with converting VISTA to XP
Hi there. I've been trying to downgrade from Vista to XP with the discs that were given to me with my purchase of the x301. Everytime I boot the XP rescue and recovery disc in, I follow the directions as per the XP conversion kit. I get to Step 9 a
-
I dont seem to have a full inventory of tools, I am missing the eraser as well, it only shows 6 tools