How to Display the content of Excel file into Webdynpro Table
Hi Experts
I am following the Blog to upload a file in to the webdynpro context,but my problem is after uploading a excel file i need to extract the content from that Excel file and that content should be displayed in the webdynpro table.Can any body please guide me how to read the content from excel and to Display in the Table.
Thanks and Regards
Kalyan
HI,
Take for example, if Excel file contains 4 fields,
Add jxl.jar to JavaBuild path and Use this snippet
File f=new File("sample.xls");
Workbook w=Workbook.getWorkbook(f);
Sheet sh=w.getSheet(0);
int cols=sh.getColumns();
int rows=sh.getRows();
Cell c=null;
String s1=null;
String s2=null;
String s3=null;
String s4=null;
ArrayList al=new ArrayList();
int j=0;
for(int i=1;i<rows;i++)
ITableElement table=wdContext.createTableElementz
s1=sh.getCell(0,i).getContents();
s2=sh.getCell(1,i).getContents();
s3=sh.getCell(2,i).getContents();
s4=sh.getCell(3,i).getContents();
table.setName(s1);
table.setAddress(s2);
table.setDesignation(s3);
table.setDummy(s4);
al.add(j,table);
j++;
wdContext.nodeTable().bind(al);
Regards
LakshmiNarayana
Similar Messages
-
How to load the data from excel file into temprory table in Forms 11g?
Hi
How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
Kindly Suggest the Solution.
Regards,
SachinDeclare
v_full_filename varchar2(500);
v_server_path varchar2(2000);
v_separator VARCHAR2(1);
v_filename VARCHAR2(400);
filename VARCHAR2 (100);
v_stop_load varchar2 (2000);
v_rec_error_log varchar2(4000);
v_error_log varchar2(4000);
ctr NUMBER (12);
cols NUMBER (2);
btn number;
RES BOOLEAN;
application ole2.obj_type;
workbooks ole2.obj_type;
workbook ole2.obj_type;
worksheets ole2.obj_type;
worksheet ole2.obj_type;
cell ole2.obj_type;
cellType ole2.OBJ_TYPE;
args ole2.obj_type;
PROCEDURE olearg
IS
args ole2.obj_type;
BEGIN
args := ole2.create_arglist;
ole2.add_arg (args, ctr);
ole2.add_arg (args, cols);
cell := ole2.get_obj_property (worksheet, 'Cells', args);
ole2.destroy_arglist (args);
END;
BEGIN
v_full_filename := client_get_file_name(directory_name => null
,file_name => null
,file_filter => 'Excel files (*.xls)|*.xls|'
||'Excel files (*.xlsx)|*.xlsx|'
,message => 'Choose Excel file'
,dialog_type => null
,select_file => null
If v_full_filename is not null Then
v_separator := WEBUTIL_CLIENTINFO.Get_file_Separator ;
v_filename := v_separator||v_full_filename ;
:LOAD_FILE_NAME := substr(v_filename,instr(v_filename,v_separator,-1) + 1);
RES := Webutil_File_Transfer.Client_To_AS(v_full_filename,"server_path"||substr(v_filename,instr(v_filename,v_separator,-1) + 1));
--Begin load data from EXCEL
BEGIN
filename := v_server_path||substr(v_filename,instr(v_filename,v_separator,-1) + 1); -- to pick the file
application := ole2.create_obj ('Excel.Application');
ole2.set_property (application, 'Visible', 'false');
workbooks := ole2.get_obj_property (application, 'Workbooks');
args := ole2.create_arglist;
ole2.add_arg (args, filename); -- file path and name
workbook := ole2.get_obj_property(workbooks,'Open',args);
ole2.destroy_arglist (args);
args := ole2.create_arglist;
ole2.add_arg (args, 'Sheet1');
worksheet := ole2.get_obj_property (workbook, 'Worksheets', args);
ole2.destroy_arglist (args);
ctr := 2; --row number
cols := 1; -- column number
go_block('xxx');
FIRST_RECORD;
LOOP
--Column 1 VALUE --------------------------------------------------------------------
olearg;
v_stop_load := ole2.get_char_property (cell, 'Text'); --cell value of the argument
:item1 := v_stop_load;
cols := cols + 1;
--Column 2 VALUE --------------------------------------------------------------------
olearg;
:item2 := ole2.get_char_property (cell, 'Text'); --cell value of the argument
cols := cols + 1;
--<and so on>
ole2.invoke (application, 'Quit');
ole2.RELEASE_OBJ (cell);
ole2.RELEASE_OBJ (worksheet);
ole2.RELEASE_OBJ (worksheets);
ole2.RELEASE_OBJ (workbook);
ole2.RELEASE_OBJ (workbooks);
ole2.RELEASE_OBJ (application);
END;
--End load data from EXCELPlease mark it as answered if you helped. -
How to load the data from excel file into table in oracle using UTL_FI
How to load the data from excel file into table in oracle
and from table to excel file
using UTL_FILE package
Please give me some exampleThis is something i tried in oracle apex
http://avdeo.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/
Regards,
CKLP -
How to display the content from a file stored in database
when i am trying to display the content from a file which stored in database on oracle report 10g
data are displaying as following. please help me to display the data in readable format
<HTML LANG="en-US" DIR="LTR">
<!-- Generated: 1/11/2006, postxslt.pl [1012] v1
Source: amsug304286.xml
File: amsug304286.htm
Context: nil
Tiers: ALWAYS
Pretrans: YES
Label: Release 12 -->
<HEAD>
<!-- $Header: amsug304286.htm 120.4 2006/11/01 20:57:29 appldev noship $ -->
<!--BOLOC ug1_OMPO1010302_TTL--><TITLE>Product Overview (ORACLE MARKETING)</TITLE><!--EOLOC ug1_OMPO1010302_TTL-->
<LINK REL="stylesheet" HREF="../fnd/iHelp.css">
</HEAD>
<BODY BGCOLOR="#F8F8F8">
<A NAME="T304286"></A><A NAME="ProdOve"></A>
<CENTER><H2><!--BOLOC ug1_OMPO1010302--><B>Product Overview</B><!--EOLOC ug1_OMPO1010302--></H2></CENTER>
<p><!--BOLOC ug1_OMPO1010304-->Oracle Marketing drives profit, not just responses, by intelligently marketing to the total customer/prospect base. By leveraging a single repository of customer information, you can better target and personalize your campaigns, and refine them in real time with powerful analytical tools.<!--EOLOC ug1_OMPO1010304--></p>
<p><!--BOLOC ug1_OMPO1006611-->With tools necessary to automate the planning, budgeting, execution, and tracking of your marketing initiatives, Oracle Marketing provides you with:<!--EOLOC ug1_OMPO1006611--></p>
<ul>
<li>
<p><!--BOLOC ug1_OMPO1006612--><B>Customer Insight</B> - With sophisticated customer management and list generation, Oracle Marketing enables you to quickly generate target lists and segments using an intuitive user interface. The easy to use Natural Query Language Builder (NLQB) lets you query for customers or prospects using a natural language while hiding data complexity; fatigue management ensures that you do not over-contact the same customers with marketing messages; and predictive analytics helps you predict customer behavior that you can leverage to produce significant increases in marketing return on investments (ROI).<!--EOLOC ug1_OMPO1006612--></p>
</li>
<li>
ls.<!--EOLOC ug1_OMPO1010304--></p>
<p><!--BOLOC ug1_OMPO1006611-->With tools necessary to automate the planning, budgeting, execution, and tracking of your marketing initiatives, Oracle Marketing provides you with:<!--EOLOC ug1_OMPO1006611--></p>
<ul>
<li>
<p><!--BOLOC ug1_OMPO1006612--><B>Customer Insight</B> - With sophisticated customer management and list generation, Oracle Marketing enables you to quickly generate target lists and segments using an intuitive user interface. The easy to use Natural Query Language Builder (NLQB) lets you query for customers or prospects using a natural language while hiding data complexity; fatigue management ensures that you do not over-contact the same customers with marketing messages; and predictive analytics helps you predict customer behavior that you can leverage to produce significant increases in marketing return on investments (ROI).<!--EOLOC ug1_OMPO1006612--></p>
</li>
<li>
<p><!--BOLOC ug1_OMPO1006613--><B>Sales Alignment</B> - Oracle Marketing's leads management helps you compile and distribute viable leads so that sales professionals can follow up valuable opportunities and not just contact interactions. Additionally, support for distributing proposals and marketing material drive speedy and consistent setups and collaboration of best practices.<!--EOLOC ug1_OMPO1006613--></p>
</li>
<li>
<p><!--BOLOC ug1_OMPO1006614--><B>Marketing Insight</B> - While Oracle Marketing Home page reports and Daily Business Intelligence (DBI) for Marketing and Sales provide aggregated management level information in almost real time, operational metrics help in tracking the effectiveness of individual marketing activities.<!--EOLOC ug1_OMPO1006614--></p>
</li></ul>
</BODY>
</HTML>
<!-- Q6z5Ntkiuhw&JhsLdhtX.cg&Zp4q0b3A9f.&RQwJ4twK3pA (signum appsdocopis 1162406236 2673 Wed Nov 1 10:37:16 2006) -->Hi,
you can try to use the:
<b>ConsumerTreeListPreview</b>
layout for KM navigation ivew (or customize to your own).
This layout shows a folder tree on the left, a document list on the right. When you click on a document from the list it shows the contents of the file on the bottom of the iview.
Hope this helps,
Romano -
How to store the content of a file in oracle table.
Hello,
I have a .xml file in unix , how can i upload the content of that file into a column of a table in oracle?Did you look at the link posted in response to the OP? At a quick look, it seems fairly reasonable to me.
John -
How to display the content of a file in the portal?
Hey guys, could anyone help?
I just created a page which includes two iView, one is KM Navigation iView to display a certain repository, while the other is for displaying the content of a certain file I click in the navigation iView.
And now the problem is when I click a file in the KM Navigation iView, it will pop up a new window to display it. How can I make it displayed in a fixed iView, which type of this iView should be?Hi,
you can try to use the:
<b>ConsumerTreeListPreview</b>
layout for KM navigation ivew (or customize to your own).
This layout shows a folder tree on the left, a document list on the right. When you click on a document from the list it shows the contents of the file on the bottom of the iview.
Hope this helps,
Romano -
How to validate the contents of excel file after uploading it.
hi Experts,
we have a requirement in which we need to create business transactions with the data in the excel file after it was uploaded. we are creating this transactions(BP,LEAD..) in webui -marketing professional role-external lists. what i have to do is, after uploading the data from excel file, i need to check for the mandatory fields in the data ,if anything is missing then i need to display the error message to the user. i am new to this webclinet frame work. please help me in achieving this functioanlity.any code snippet would be very helpful.
THANKS IN ADVANCE.Hi ,
Try with the below code.
in the upload class ihn attributes declare
go_messages
level static
visibility public
Associated Type CL_CRM_GENIL_GLOBAL_MESS_CONT.
in the event for upload
lo_core = cl_crm_bol_core=>get_instance( ).
go_messages = lo_core->get_global_message_cont( ).
go_messages->reset( ).
REFRESH : t_return.
create a function module to validate the mandatory fields.
loop at i_table
call a function module
endloop.
In function module validate the mandatory fields if empty fill a error message and append to internal table.
loop at t_return INTO st_return WITH KEY type = 'E'.
CALL METHOD go_messages->add_message
EXPORTING
iv_msg_type = st_return-type
iv_msg_id = st_return-id
iv_msg_number = st_return-number
iv_msg_v1 = st_return-message_v1
iv_msg_v2 = st_return-message_v2
iv_msg_v3 = st_return-message_v3
iv_msg_v4 = st_return-message_v4
iv_show_only_once = abap_true.
endloop.
Regards,
Gangadhar.S -
How to display the data in XML files into JSP using Jdeveloper.
Hi All,
I have two XML files one XML file has the view names and the other has the table names of a particular views, how to display the data in JSP using JDeveloper where when i click a particular view the list of tables of that particular view from XML file two should be displayed in JSP Page.
Are there any reference documents, regarding the above process please can anyone guide through how to do it.Let the servlet ask your business tier to provide the data, then stuff it into beans, and pack those into the Session instance. Then forward the request to the JSP, let the JSP get those beans and display them.
-
How to call the methods of JAR file into webDynpro Environment
Hi All ,
I have a requirement to call the methods of a JAR file into
WebDynpro Environment. can anybody suggest me How this can be achieved. I Have a JAR file named FastTrack.API
which contains few methods and i want these methods to be accessable into WebDynpro as other methods.
Plz Somebody help me to sort this out.
Regards,
Deepak.Deepak,
Please follow these 2 steps:
1. Add jar into webdynpro project
Right Click on ur project -> Select properties -> Java Buil path -> Choose Libraries Tab -> Add External Jars -> add the file from ur computer
2. Use the jar
write the import statement in your webdynpro code to utilize the properties of added jar.
Thanks & Regards,
Ram -
How to save the contents of one file into another file?
Hai,
i'm trying to save the contents of an existing file into a new file...
for example.. if i'm having a ms word file namely ss.doc..
now i want to save itz contents into another file namele dd.doc..
How shall i do it..
Can an one plzz explain me...
senthil.Hi, Senthil.
This Forum is not a general discussion forum.
You don't believe that the InDesign SDK is a general purpose API. Do you?
I think you must post issues like this where they belong, in this case in a Microsoft Word Forum.
Best regards.
Oscar. -
How to copy the content of one file into another
I have tried this code
try {
fin = new FileInputStream("file path");
catch(FileNotFoundException exc)
System.out.println("File not found");
return 0;
catch(ArrayIndexOutOfBoundsException exc)
System.out.println("Usage: Showfile file");
return 0;
while(true){
i=fin.read();
if(i==-1)
break;
cnt++;
fin.close();*/
now in this way i can lift one character at a time and copy it into another file (note i have not done the copy part in this code but that can be implemented) however this whole procedure is taking too much time if the size of the file is too big....kindly suggest another way to copy one file into anotherhave you ever copied and pasted a large file in Windows or another OS? Larger files take more time to copy, that's just how it is.
-
How to read the data from Excel file and Store in XML file using java
Hi All,
I got a problem with Excel file.
My problem is how to read the data from Excel file and Store in XML file using java excel api.
For getting the data from Excel file what are all the steps i need to follow to get the correct result.
Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
Thanks & Regards,
Sreenu,
[email protected],
india,If you want someone to do your work, please have the courtesy to provide payment.
http://www.rentacoder.com -
How to Load the data from excel file(Extension is .CSV) into the temp.table
Hi
How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
Kindly Suggest the Solution.
Regards,
SachinHello Sachin,
You can use the following metalink note:How to Read Data from an EXCEL Spreadsheet into a Form Using Webutil Client_OLE2 (Doc ID 813535.1) and modify it a little bit.
Instead of copy values into forms you can save them in your temporary table.
Kind regards,
Alex
If someone's helpful or correct please mark it accordingly. -
How to display the content of a region on a different page
Hello,
Does anyone knows how to display the content of a region on an other page. I try to make page that displays content that resides somewhere else in my portal, so I can give a summarization of some hot topics. I really want to display the whole content of some regions (not a display with custom search).
Thanks a lot,
HansSet that page as portlet, include it in a region in another page and in the edit defaults decide which regions you want to display.
Mere. -
How to display the content of a BLOB column in a ADF/BC pages ?
How to display the content of a BLOB column in a ADF/BC pages ?
There is some image in database table blog column. And we want to display image on the screeen.
There is some example about upload and dowload blog columns.
(steve not yet document example page etc...)
But We want to display blog picture in a image component...
is there any basic way to do it ?
Thanks a lot...Ali,
You could just download the sample app... but... here is the servlet code from the demo (look at it just for technique - you'll obviously have to change it for your needs)...
John
package oracle.fodemo.storefront.servlet;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.servlet.*;
import javax.servlet.http.*;
import oracle.jbo.ApplicationModule;
import oracle.jbo.Key;
import oracle.jbo.Row;
import oracle.jbo.ViewObject;
import oracle.jbo.client.Configuration;
import oracle.jbo.domain.BlobDomain;
import oracle.jbo.domain.DBSequence;
import oracle.jbo.domain.Number;
import oracle.jbo.server.ViewObjectImpl;
public class ImageServlet
extends HttpServlet
private static final String CONTENT_TYPE =
"image/jpg; charset=windows-1252";
public void init(ServletConfig config)
throws ServletException
super.init(config);
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
response.setContentType(CONTENT_TYPE);
response.setContentType(CONTENT_TYPE);
String detailProductId = request.getParameter("detail");
String thumbnailProductId = request.getParameter("thumbnail");
boolean thumbnail = true;
String productId = null;
OutputStream os = response.getOutputStream();
String amDef = "oracle.fodemo.storefront.store.service.StoreServiceAM";
String config = "StoreServiceAMLocal";
ApplicationModule am =
Configuration.createRootApplicationModule(amDef, config);
ViewObjectImpl vo =
(ViewObjectImpl) am.findViewObject("ProductImages"); // get view object (the same as used in the table)
if (detailProductId != null)
productId = detailProductId;
thumbnail = false;
else
productId = thumbnailProductId;
vo.defineNamedWhereClauseParam("paramThumbnail", null, null);
vo.defineNamedWhereClauseParam("paramProductId", null, null);
vo.setWhereClause("DEFAULT_VIEW_FLAG = :paramThumbnail AND PRODUCT_ID = :paramProductId");
vo.setNamedWhereClauseParam("paramThumbnail", (thumbnail? "Y": "N"));
vo.setNamedWhereClauseParam("paramProductId", productId);
vo.executeQuery();
Row product = vo.first();
BlobDomain image = (BlobDomain) product.getAttribute("Image");
InputStream is = image.getInputStream();
// copy blob to output
byte[] buffer = new byte[10 * 1024];
int nread;
while ((nread = is.read(buffer)) != -1)
os.write(buffer, 0, nread);
os.close();
vo.setWhereClause(null);
vo.removeNamedWhereClauseParam("paramProductId");
vo.removeNamedWhereClauseParam("paramThumbnail");
Configuration.releaseRootApplicationModule(am, false);
}
Maybe you are looking for
-
Dragging over a Subdiagram Label breaks drag-and-drop from Project Explorer
This bug has proven to be perfectly repeatable on my system. I'm using the LabVIEW Core 3 Course Project to reproduce: 1. Open the block diagram of a VI with while loop or case structure whose Subdiagram Label is visible. 2. Drag a VI or control from
-
Pavilion g6 2291sa not booting up
Hello, I have a Pavilion g6 2291sa that is refusing to boot up. The power light is on, the wireless light is on and the caps lock light turns on and off but there is no sound coming from the hardrive and nothing coming on the screen. I have tried a h
-
When I hold my mouse on the icon the iPhoto 09 program opens on the desktop, but does not permit the usual interaction...when I try to click on the program it disappears again at the bottom of my screen. Please help, Thanks in advance, Charles
-
Where are the redaction policies stored?
I am testing redaction features for a client and it works fine. But I still did not find one single table or view where I can find active or inactive policies. Can anybody help me out on this please. thx Oskar
-
Opening a .htm file in acrobat reader?
I downloaded a adobe file from a site I trust and it shows the adobe logo and states I need adcrobat reader to open... so I download the most receint version of reader and then download the file when it downloads it shows the file as ".htm" and when