Closing an excel sheet using active X%3F
I am working with report generation toolkit.
Before generating the report I'm trying to close all the excel sheets using Active X. At times the excel application gets closed without asking for the save or dont save option.
What change should I do in the code?
Please find the attached code
Solved!
Go to Solution.
Attachments:
PRJA1832_Dispose all Excel.vi 15 KB
Hi,
Thanks for the help.
The VI is still not consistent at times. It closes without saving even if I'm using display alerts. I'm also getting an error when i keep running the code. And I think the error is because the excel sheet is maximised and I'm running the code. Please find the attached snapshot of the error.
Regards
Hridhya
Attachments:
Report disable alerts.png 51 KB
Similar Messages
-
Facing problem in writing data to excel sheet using ActiveX
Hi.
I want to write data from a one dimesional array to a particular excel sheet in a particular row.Please see the attached vi for explantion.
It is giving error.But If I give a new file name when the appliation is getting closed it is writing data to the new excel file.
Please help.
Thanks in advance
Attachments:
Excel sheetWrite.vi 90 KBThanks Jhoskin and Rudi .......
I am able to write data to excel sheet now. I am attaching one"test.zip" file that contains a VI named "Squence.vi "that contains another subVI named "Write U94006 Table To XL.vi"which does the functionality of counting the number of rows in the excel sheet and writing data in the next blank row. I am using the same subVI in the VI named "Sequence.vi"two times so it is taking a lot of time in opening and closing the excel sheet. Will you please suggest some way of calling the subVI only one time.
Rikki
Attachments:
Test.zip 105 KB -
Generating Excell Sheet using Reports 9i
Hello,
I wanna know how can I do to generate one excell sheet using reports, without
use the option that4s generate text file using tab. I wanna know if someone have
example codes, or library4s.
Thanks,
Paulo SergioHere are some notes we created from the demo below. This works great for generating true formated excel output in 9i Reports using 9ias Rel2.
Notes from
http://otn.oracle.com/products/reports/htdocs/getstart/demonstrations/index.html
Output to Excel with Oracle9i Report
1. Create an Excel template for the report. It should contain generic information such as title, logo and column headers
2. Cretae a sample line of data in the spreadsheet
3. Save the Excel spreadsheet as a Web page. File | Save As Web Page
4. Open the Web page you just created in Reports Builder
5. Double-click on Web Source node to display the HTML code for the Excel spreadsheet
6. Note how Excel generated HTML and XML code for the spreadsheet you created. Reports Builder also adds its own JSP tags
7. Add the Data Source An SQL Query
8. Modify the Web Source. Now that youve written the query, you can modify the Web source to tell Reports Builder to display your report in Excel.
9. Click on the Web Source icon in the toolbar.
10. To force the browser to open MS Excel it is necessary to change the HTTP Content Type to a specific MIME Type:
application/vnd.ms-excel
Insert the following line immediately before the <rw:report id=report> tag
<%@ page contentType=application/vnd.ms-excel %>
(This is a standard JSP directive to set a MIME Type (Content Type) )
11. To respect Excel format, you should delete the blank lines above the <html> tag.
12. Now, use Oracle 9i Reports JSP tags to add the data retrieved by your SQL Query to the report.
13. Search for the sample line of data you added to your Excel spreadsheet
14. Each line is saved as an HTML Table Row tag ( <tr> ).
15. Each column is mapped as an HTML Table Data tag ( <td> ).
16. Using Reports JSP Tags, add a Reports repeating frame tag to loop around the Data Model group.
17. To help, show the Object navigator next to the Web Source Window. All group information is now visible in the Object Navigator
18. Enclose the sample line of code in the Web source with the Reports9i JSP repeating tag.
Use from menu Insert | Repeating Frame at beginning of sample
Move the closing repeating tag after the </tr> tag.
Start of the repeating tag would be
<rw:foreach id=foreach src=>
Ending of the repeating frame would be
</rw:foreach>
19. In the opening of the repeating tag (<for each>), add the name of the group the tags enclose. JSP custom tags require a unique identifier.
For example: <rw:foreach id=gEmpNoId src=G_EMPNO>
20. Now, map the cells of the Excel spreadsheet to the corresponding field from your data model.
Select on the data value. From menu select Insert | Field. The source of the tag is the name of the field in the query.
21. Repeat the operation for each field of the report. Note: do not forget to specify a unique identifier for each field.
22. The code now contains a repeating frame. You have also mapped each cell in the Excel spreadsheet to the corresponding field in the data model
23. Save the report as a Reports JSP. You can test the report using the Run Web Layout icon in the toolbar
24. The execution of a Web Layout report from Reports Builder creates a temporary HTML file and launches the browser. The browser does not launch Excel because the document is saved as an HTML file. To launch Excel from the browser you need to test it from Reports Server.
25. In order to have the report appear inside Excel, you need to execute it with the Reports Server under OC4J. To do this you need to:
First, start an OC4J instance from Oracle 9iDS see How to Execute Reports Services from Oracle 9iDS on OTN. Then, copy the JSP to a directory. For example: $IDS_HOME/reports/j2ee/reports_ids/web/test
26. Enter the URL to execute the jsp. The JSP is executed from an OC4J instance.
http://reports9iTestServer:8888/reports/test/ListOfEmployees.jsp?userid=scott/tiger@ora901
27. The browser launches Microsoft Excel and displays the data from your report. -
Conneting the microsoft excel sheet using jdbc
HI all
my requirement is to connect to the excel sheet using the jdbc odbc dsn and read the worksheets and get the data.
i have created the dsn using vb scripting
so when i click on a button. a dsn is created dynamically and the same dsn is passed as parameter to the system which will call a java program
the java program will us the dsn to connect to the excel sheet to read the data.
This is working fine
the problem is sometimes the following exception is raised.
java.sql.SQLException: [Microsoft][ODBC Excel Driver] Cannot open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.zt.ebiz.install.client.ExcelDriver.getConnection(ExcelDriver.java:290)
at com.zt.ebiz.install.client.ExcelDriver.getHostInfo(ExcelDriver.java:337)
at com.zt.ebiz.install.client.InstallClient.executeActions(InstallClient.java:188)
at com.zt.ebiz.install.client.InstallClient.main(InstallClient.java:123)
For this we are just restarting the system.
Again it works fine.
i would like to know the cause of this problem.
please help me in this
thanks
Vijay SunderIt may be occured because of connection closing, make it sure to close connections after your transactions completed.
-
Unable to display double values in Excel sheet using JExcel API
Hi
I am writing code to generate report in the form of Excel Sheet using JExcel API.
Everything is going fine but whenever I want to put some double values in a cell it is only showing 2 decimal places. My problem is "I want to show upto five decimal places".
Any kind of reply might help me lot.
Thank U.If you enable the submit zero option, it still happens? This is a new feature on the display tabl
#NumericZero Enhancements
To display a numeric zero in place of an error message, you can enter #NumericZero in any of the three Replacement text fields. When you use the #NumericZero option:
· Excel formatting for the cell is retained.
· All calculations with dependency on the cell will compute correctly and will take the value of this cell as zero.
· This numeric zero is for display only. When you submit, the zero value is NOT submitted back to the data source.
You cannot set display strings for cells that contain an invalid member or dimension name (metadata error). Metadata errors produce standard descriptive error messages.
Errors are prioritized in the following order from highest to lowest. The error message for a higher-priority error takes precedence over that for a lower-priority error.
1. (Highest) Metadata errors
2. #No access
3. #Invalid/Meaningless
4. #No data\Missing -
The goal is to synchronize an excel sheet using Microsoft Excel 2010 with Sharepoint 3.0
The goal is to synchronize an excel sheet using Microsoft Excel 2010 with Sharepoint 3.0. We have already installed an add-in (Excel 2007 Add-in: Synchronizing Tables with SharePoint Lists) that was supposed
to help the synchronization of excel to Sharepoint, but it did not work. We would like to synchronize information about a calendar from excel to Sharepoint 3.0, so every time a change is made in excel it automatically updates in Sharepoint.ootb, changes in excel don't sync with a SharePoint list, the other way around is possible.
Kind regards,
Margriet Bruggeman
Lois & Clark IT Services
web site: http://www.loisandclark.eu
blog: http://www.sharepointdragons.com -
Upload Excel sheet using Data Integrator 6.1?
hi all ,
Upload Excel sheet using Data Integrator? and how to create ODBC for the PC and jobserver i am using version 6.1? i am using excel as my one of the data source and tell me how to use different types of data sources in DI . after uploading the xl file if i apply any transform on the excel data i will give error like
Posted: 25 Sep 2008 04:30
Post subject: Re: Upload Excel sheet using Data Integrator?
I am getting the error like
3128 292 CON-120302 09-25-08 09:59:40 ODBC call <SQLDriverConnect> for data source <sas> failed: <[Microsoft][ODBC Driver Manager] Data source name not found and no
3128 292 CON-120302 09-25-08 09:59:40 default driver specified>. Notify Customer Support.
1512 2992 CON-120302 09-25-08 09:59:41 ODBC call <SQLDriverConnect> for data source <sas> failed: <[Microsoft][ODBC Driver Manager] Data source name not found and no
1512 2992 CON-120302 09-25-08 09:59:41 default driver specified>. Notify Customer Support.
Please help me out
Thank uHi Shonti,
The DI 11.7 installer can be used to upgrade a DI 6.1 local repository (e.g. the upgrade is supported). This will migrate all jobs and flows. They will remain intact, however, this is always a major migration effort and should not be taken lightly. If you do upgrade, please make sure this is a planned effort with rigorous testing and validation. You should also ensure that you consult the release notes and [supported platforms documentation|https://websmp110.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000712240&_SCENARIO=01100035870000000202] for the 11.7 package you intend to install. The DI 11.7 documentation also contains info about how to install and configure the Excel Adapter, and what functionality it provides.
Thanks,
~Scott -
How to get the password of a password protected Excel Sheet using java/jxl
Hi ,
how to get the password of a password protected Excel Sheet using java / jxl program.
plz any one help me .
Ramesh P
[email protected]If they've implemented the password system correctly there probably isn't a way of getting the password at all.
-
I am trying to get the last column in an Excel sheet using the Report Generation toolkit. The function "Excel Get Last Row" does not give last column info. Is there a function that will do this?
ThanksHello –
I think the following example program might be helpful to get you started programming your application.
Get Excel Data from Specified Field.
Hope this helps!
SVences
Applications Engineer
National Instruments -
Can we create Multi Tabbed excel Sheet using Crystal Reports 2008
Hi,
We want to create a Crystal Report which will export the output as multiple Tab's ( we can use sub reports). Can we create a Multi Tabbed excel Sheet using Crystal Reports 2008 ( not Crystal reports Basic 2008). Please share any information/links on how to do that.
Also if it is not supported please let us know which version supports it.
Thanks,
VasuAt least one of the 3rd-party Crystal Reports Desktop Scheduling tools listed at: http://www.kenhamady.com/bookmarks.html provides that functionality. It allows you to burst a single report so that each Group at level 1 becomes a separate tab. You can control the tab names (and tab colors) via fields/formulas inside the report.
You can also automate the process of exporting to (and also replacing or appending to) specified tabs inside existing workbooks. -
Is it possible to create Excel Sheet using OLE automation in App server
Hi,
Is it possible to create Excel Sheet using OLE automation in Application server(Open Dataset)
Thanks in advance...Unless your application server is on Windows OS, or it is connected to a Windows server by RFC. What is the requirement exactly, I don't understand?
-
How to append in excel sheet using Java
Can anybody help me out in figuring out as how to append in already existing excel sheet using Java.
I am able to to write in the existing excel sheet using HSSF but is not able to append the data row wise.
So plz tell me how to do the same.Manisha_7 wrote:
Thnx for the link......No problem.
but i alsot wanted to know if apart from using poi there is a way to append the data in excel sheet like using JExcel.Don't know. JExcel is also not apart of Java's core API. -
Hi All,
Can any one help me to create an multiple excel sheet in an work book using OLE. I want to create more than 3 sheets in excel, which is default sheets in excel when we one excel.Hi,
Check the below sample code.
Here I'm downloading the same table twice into 2 different sheets for example purpose.
TYPE-POOLS ole2.
DATA: wf_cell_from TYPE ole2_object,
wf_cell_from1 TYPE ole2_object,
wf_cell_to TYPE ole2_object,
wf_cell_to1 TYPE ole2_object,
wf_excel TYPE ole2_object, " Excel object
wf_mapl TYPE ole2_object, " list of workbooks
wf_map TYPE ole2_object, " workbook
wf_worksheet TYPE ole2_object, " Worksheet
wf_cell TYPE ole2_object, " Cell Range
wf_cell1 TYPE ole2_object,
wf_range TYPE ole2_object, " Range of cells to be formatted
wf_range2 TYPE ole2_object,
wf_column1 TYPE ole2_object. " Column to be Autofit
DATA: BEGIN OF t_hex,
l_tab TYPE x,
END OF t_hex.
DATA: wf_deli(1) TYPE c, "delimiter
wf_action TYPE i,
wf_file TYPE string,
wf_path TYPE string,
wf_fullpath TYPE string.
TYPES: t_data1(1500) TYPE c,
int_ty TYPE TABLE OF t_data1. "line type internal table
*All the data was prepared as line type internal tables for faster
*download
DATA: int_matl TYPE int_ty ,
int_matl1 TYPE int_ty ,
wa_matl TYPE t_data1.
TYPES: BEGIN OF ty_mara,
matnr TYPE matnr,
mtart TYPE mtart,
matkl TYPE matkl,
meins TYPE meins,
END OF ty_mara.
DATA: int_mara TYPE STANDARD TABLE OF ty_mara,
wa_mara TYPE ty_mara.
FIELD-SYMBOLS: <fs> .
DATA: wc_sheets LIKE sy-index. "no.of sheets
DATA: it_tabemp TYPE filetable,
gd_subrcemp TYPE i.
CONSTANTS wl_c09(2) TYPE n VALUE 09.
CLEAR wc_sheets.
DEFINE ole_check_error.
if &1 ne 0.
message e001(zz) with &1.
exit.
endif.
END-OF-DEFINITION.
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
PARAMETERS: p_file LIKE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK block1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
REFRESH: it_tabemp.
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
window_title = 'Select File'
* default_extension = 'xls'
default_file_name = 'Material Details'
* with_encoding =
file_filter = '*.xls'
initial_directory = 'C:\'
prompt_on_overwrite = ' '
CHANGING
filename = wf_file
path = wf_path
fullpath = wf_fullpath
user_action = wf_action
* file_encoding =
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF wf_action EQ 9.
MESSAGE 'No File have been Selected' TYPE 'S'.
ELSE.
p_file = wf_fullpath.
PERFORM create_excel.
ENDIF.
*& Form create_excel
* text
FORM create_excel.
LOOP AT it_tabemp INTO p_file.
ENDLOOP.
* START THE EXCEL APPLICATION
CREATE OBJECT wf_excel 'EXCEL.APPLICATION'.
PERFORM err_hdl.
* PUT EXCEL IN FRONT
SET PROPERTY OF wf_excel 'VISIBLE' = 1.
PERFORM err_hdl.
* CREATE AN EXCEL WORKBOOK OBJECT
CALL METHOD OF wf_excel 'WORKBOOKS' = wf_mapl.
PERFORM err_hdl.
SET PROPERTY OF wf_excel 'SheetsInNewWorkbook' = 3. "no of sheets
PERFORM err_hdl.
CALL METHOD OF wf_mapl 'ADD' = wf_map.
PERFORM err_hdl.
*Assign the Delimiter to field symbol.
ASSIGN wf_deli TO <fs> TYPE 'X'.
t_hex-l_tab = wl_c09.
<fs> = t_hex-l_tab.
CLEAR int_matl.
REFRESH int_matl.
SELECT matnr
mtart
matkl
meins
FROM mara
INTO CORRESPONDING FIELDS OF TABLE int_mara.
*first the headings will be displayed in the excel sheet
CONCATENATE 'Material Number'
'Material type'
'Material Group'
'Base Unit of Measure'
INTO wa_matl
SEPARATED BY wf_deli.
APPEND wa_matl TO int_matl.
LOOP AT int_mara INTO wa_mara.
CONCATENATE wa_mara-matnr
wa_mara-mtart
wa_mara-matkl
wa_mara-meins
INTO wa_matl
SEPARATED BY wf_deli.
APPEND wa_matl TO int_matl.
CLEAR wa_matl.
ENDLOOP.
*Copyng thae same contents to another table to display in
*new sheet
MOVE int_matl TO int_matl1.
PERFORM f_material_details
TABLES int_matl
USING 1.
PERFORM f_material_details
TABLES int_matl
USING 2.
GET PROPERTY OF wf_excel 'ActiveSheet' = wf_map.
GET PROPERTY OF wf_excel 'ActiveWorkbook' = wf_mapl.
CALL FUNCTION 'FLUSH'
EXCEPTIONS
cntl_system_error = 1
cntl_error = 2
OTHERS = 3.
IF sy-subrc = 0.
CALL METHOD OF wf_map 'SAVEAS'
EXPORTING #1 = p_file.
ENDIF.
CALL METHOD OF wf_mapl 'CLOSE'.
CALL METHOD OF wf_excel 'QUIT'.
FREE OBJECT wf_mapl.
FREE OBJECT wf_map.
FREE OBJECT wf_excel.
ENDFORM. "create_excel
*& Form ERR_HDL
* text
FORM err_hdl.
IF sy-subrc <> 0.
WRITE: / 'OLE ERROR: RETURN CODE ='(i10), sy-subrc.
STOP.
ENDIF.
ENDFORM. "ERR_HDL
*-- End of Program
*& Form f_material_details
* text
* --> p1 text
* <-- p2 text
FORM f_material_details
TABLES lint_matl
USING l_sheet_no TYPE i.
DATA: lv_lines TYPE i,
lv_sheet_name(50) TYPE c.
wc_sheets = l_sheet_no.
CASE l_sheet_no.
WHEN 1.
lv_sheet_name = 'Material_sheet1'.
WHEN 2.
lv_sheet_name = 'Material_sheet2'.
ENDCASE.
*-- activating the worksheet and giving a name to it
CALL METHOD OF wf_excel 'WORKSHEETS' = wf_worksheet
EXPORTING
#1 = wc_sheets.
CALL METHOD OF wf_worksheet 'ACTIVATE'.
SET PROPERTY OF wf_worksheet 'NAME' = lv_sheet_name.
*--formatting the cells
CALL METHOD OF wf_excel 'Cells' = wf_cell_from
EXPORTING
#1 = 1
#2 = 1.
DESCRIBE TABLE lint_matl LINES lv_lines.
CALL METHOD OF wf_excel 'Cells' = wf_cell_to
EXPORTING
#1 = lv_lines
#2 = 4.
*--range of cells to be formatted (in this case 1 to 4)
CALL METHOD OF wf_excel 'Range' = wf_cell
EXPORTING
#1 = wf_cell_from
#2 = wf_cell_to.
*--formatting the cells
CALL METHOD OF wf_excel 'Cells' = wf_cell_from1
EXPORTING
#1 = 1
#2 = 1.
DESCRIBE TABLE lint_matl LINES lv_lines.
CALL METHOD OF wf_excel 'Cells' = wf_cell_to1
EXPORTING
#1 = lv_lines
#2 = 1.
CALL METHOD OF wf_excel 'Range' = wf_cell1 " Cell range for first
" column(Material)
EXPORTING
#1 = wf_cell_from1
#2 = wf_cell_to1.
SET PROPERTY OF wf_cell1 'NumberFormat' = '@' . "To disply zeros
"in Material number
DATA l_rc TYPE i.
*DATA download into excel first sheet
CALL METHOD cl_gui_frontend_services=>clipboard_export
IMPORTING
data = lint_matl[]
CHANGING
rc = l_rc
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
OTHERS = 4.
CALL METHOD OF wf_worksheet 'Paste'.
CALL METHOD OF wf_excel 'Columns' = wf_column1.
CALL METHOD OF wf_column1 'Autofit'.
FREE OBJECT wf_column1.
ENDFORM. " f_material_details
Regards,
Manoj Kumar P
Edited by: Manoj Kumar on Mar 5, 2009 11:25 AM -
Need to upload mass excel sheet using the bapi bapi_acc_document_post.
I am assigned with an object, where I need to post the records from a mass excel sheet in to ECC or/and BW basing the dimensions using the bapi bapi_acc_document_post.the excel sheet has header and Item data. I am pretty much new to this bapi's
please do the need fulCheck report "ACC_BAPI_TEST_INVOICE_RECEIPT",
this report calls BAPI "BAPI_ACC_INVOICE_RECEIPT_POST",
but the parameters are nearly the same.
Best Regards, Dirk -
HOW CAN I GET THE TIME IN EXCEL SHEET USING WRITE TO MEASUREMENT INSTRUCTION
HI, I am using GET TIME IN SECONDS ,and after that i placed SECONDS TO DATE /TIME instruction ,and i had taken a write to measurement file instruction
to get the time in excel sheet. Now i am not able to connect write to measurement source to seconds to date and time output . Is there any solution.
I am attaching my VI file also.
Attachments:
TEST.vi 43 KBHi
Im using Labview 8.2. Currently it just shows the data without the time. Im not sure what to do. It works perfectly though. I just want the time to appear on my notepad along with my data
holla
Attachments:
Testing1.txt 1 KB
Untitled 231_LV80.vi 23 KB
Maybe you are looking for
-
I had a warning while opening photoshop it stated I had to remove the program and reinstall it would
not open with out reinstalling. so I did it and now the program will not download at all...I am without the whole adobe creative suite 3 master collection. I called the help line and they are saying no info on the problem since it is old. Does anyon
-
PLEASE help! can no longer add music because of "error 48"
had ipod for nearly a year, adding music fine manually, now all of a sudden whenever i plug ipod in or try to add music manually it says "The ipod cannot be synced, unknown error occured (-48)." please help me or tell me if anyone is experiencing the
-
Preview.app and multipage tiff files (page number)
I scan completed job folders at my company and store the resulting files on a server for users to access. They are a multipage .tif format which is basically a fax file format that is very common among document scanners. Preview is pretty good at vie
-
GetPrincpalData is null on custom module after XISOAPAdapterBean
I have a custom module which executes after XISOAPAdapterBean on the receiver soap adapter. The getPrincipalData return null . This SOAP adapter is running under no-soap mode. Why is that? then how will I get access to the response msg. In a http sni
-
Debug ideas for navigation issue?
The single navigation to another page I have in a project no longer works after switching from 1.1 to 1.2. I've checked and rechecked syntax differences and libraries, but run out of ideas to debug this further. Any thoughts would be appreciated. Usi