ФОРУМ за света на PTC CREO CAD/CAM/CAE софтуерните решения
Здравейте,


office@cadcamcae.bg

www.soft.cadcamcae.bg - Софтуерни решения за машиностроене;

www.forum.cadcamcae.bg - Форум;

www.blog.cadcamcae.bg - Блог;

http://e-shop.cadcamcae.bg - Електронен CAD магазин;

https://www.facebook.com/cad.digest

http://twitter.com/cadcamcae

3D инженерни мишки;

Поздрави
ФОРУМ за света на PTC CREO CAD/CAM/CAE софтуерните решения
Здравейте,


office@cadcamcae.bg

www.soft.cadcamcae.bg - Софтуерни решения за машиностроене;

www.forum.cadcamcae.bg - Форум;

www.blog.cadcamcae.bg - Блог;

http://e-shop.cadcamcae.bg - Електронен CAD магазин;

https://www.facebook.com/cad.digest

http://twitter.com/cadcamcae

3D инженерни мишки;

Поздрави
ФОРУМ за света на PTC CREO CAD/CAM/CAE софтуерните решения
Would you like to react to this message? Create an account in a few clicks or log in to continue.

ФОРУМ за света на PTC CREO CAD/CAM/CAE софтуерните решения

ФОРУМ: Част от проекта на списание CAD ДАЙДЖЕСТ - www.cadcamcae.bg;

CAD ДАЙДЖЕСТ . Едно онлайн издание за CAD/CAM/CAE технологии и машиностроене
 

ИндексИндекс  PortalPortal  ГалерияГалерия  ТърсенеТърсене  Последни снимкиПоследни снимки  Регистрирайте сеРегистрирайте се  ВходВход  
Вход
Потребителско име:
Парола:
Искам да влизам автоматично с всяко посещение: 
:: Забравих си паролата!
Social bookmarking
Social bookmarking reddit      

Bookmark and share the address of ФОРУМ за света на PTC CREO CAD/CAM/CAE софтуерните решения on your social bookmarking website
Новини от twitter.
Latest topics
Търсене
 
 

Display results as :
 
Rechercher Advanced Search
Споделете с приятел.
Споделете форума В,,, с,,,в,,,е,,,т,,,а,,, н,,,а,,, CAD/CAM/CAE/PLM i Вашия форум за социално споделянеBookmark and Share
Навигация.
 Portal
 Индекс
 Потребители
 Профил
 Въпроси/Отговори
 Търсене
Май 2024
НедПонВтоСряЧетПетСъб
   1234
567891011
12131415161718
19202122232425
262728293031 
КалендарКалендар

 

 Как да изпратим данни от Pro/E към Excel? част 3 (с java script)

Go down 
АвторСъобщение
Admin
Admin
Admin


Male Брой мнения : 797
Местожителство : София, България
Job/hobbies : CAD/CAM специалист
Reputation : 3
Points : 8012
Registration date : 27.03.2008

Как да изпратим данни от Pro/E към Excel? част 3 (с java script) Empty
ПисанеЗаглавие: Как да изпратим данни от Pro/E към Excel? част 3 (с java script)   Как да изпратим данни от Pro/E към Excel? част 3 (с java script) Icon_minitimeВто 13 Май - 14:54:56

Occasionally data is needed in Microsoft Excel from Pro/ENGINEER, whether it is geometry values, parameter values, or BOM table contents. Data from any of these data sources can be sent directly to Excel with Pro/WebLink, without writing any external CSV files and without running any other applications.

Technically speaking it is JavaScript functionality, or JScript as Microsoft likes to call it, and not really Pro/WebLink at all. To be useful though, it will be running within the context of a Pro/WebLink application.

Listed below is a function that takes an array of (number or text) values and writes the data in a new Excel workbook. You'll probably find many examples on the Internet using Visual Basic having the same basic steps.

The most important part is getting the handle to an Excel session. The "new ActiveXObject()" call will start a new session of Excel, while the GetObject() call will obtain a handle to an existing Excel session. Depending on your Internet Explorer security settings (i.e. "Initialize and script ActiveX controls not marked safe for scripting"), you may have to use one or the other, but ideally both should work. Using an existing session is definitely more useful when sending data from Excel to Pro/ENGINEER.

After the handle is obtained, the session is setup to be visible with a new workbook (.xls file). A reference is then obtained to the active sheet. Using the "Value" property of a specific cell in the active sheet, we can put data into the cell, in this case from the array passed to the function.


function arrayToExcel ( array ) { var oXL; try { oXL = new ActiveXObject("Excel.Application"); // Use new session // oXL = GetObject("","Excel.Application"); // Use existing session } catch (e) { alert("Excel must be running!"); return; } try { oXL.Visible = true; var oWB = oXL.Workbooks.Add(); var oSheet = oWB.ActiveSheet; } catch (e) { alert("Problem creating new workbook."); return; } for (var i=0; i < array.length; i++ ) { oSheet.Cells(i+1, 1).Value = array[i]; }}
Here is some example code that populates an array and calls the "arrayToExcel()" function:

var array = new Array();array.push(1.11);array.push(2.22);array.push(3.33);arrayToExcel(array);
As always, comments and questions are welcome.
Върнете се в началото Go down
https://cadcamcae-bg.bulgarianforum.net
 
Как да изпратим данни от Pro/E към Excel? част 3 (с java script)
Върнете се в началото 
Страница 1 от 1
 Similar topics
-
» Mathcad - Excel integratation
» excel-compon...-2-0_5mb - Mathcad Prime 2.0
» J-Link: Compile Your Pro/ENGINEER Java Application with Intralink!

Права за този форум:Не Можете да отговаряте на темите
ФОРУМ за света на PTC CREO CAD/CAM/CAE софтуерните решения :: PTC CREO 4.0: СОФТУЕР ЗА МАШИНОСТРОЕНЕ :: CREO 4.0: Моделиер от висок клас (бивш Pro/ENGINEER Wildfire)-
Идете на: