Search Results

Search found 7183 results on 288 pages for 'export to excel'.

Page 88/288 | < Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >

  • Using excel, how can I count the number of cells in a column containing the text "true" or "false"?

    - by Jay Elston
    I have a spreadsheet that has a column of cells where each cell contains a single work. I would like to count the occurrences of some words. I can use the COUNTIF function for most words, but if the word is "true" or "false", I get 0. A B 1 apples 2 2 true 0 3 false 0 4 oranges 1 5 apples In the above spreadsheet table, I have these formulas in cells B1, B2, B3 and B4: =COUNTIF(A1:A5,"apples") =COUNTIF(A1:A5,"true") =COUNTIF(A1:A5,"false") =COUNTIF(A1:A5,"oranges) As you can see, I can count apples, but not true or false. I have also tried this: =COUNTIF(A1:A5,TRUE) But that does not work either. Note -- I am using Excel 2007.

    Read the article

  • Anyone using a web service as a data source in Excel 2007?

    - by Scott
    Can I use a web service as a data soruce for Excel pivot tables? Currently, the soure data for the pivot table is being exported from the DB to a CSV file. Then the CSV file is loaded into a worksheet in the workbook. From there, a pivot table is created in the same workbook. We are looking to streamline this process. The SQL db and pivot tables are the constants. The pivot tables are generated dynamically from a public-facing website. This is not an internal app so the preference is to not connect directly to the DB.

    Read the article

  • How to mimic an excel spreadsheet on a website in vb.net?

    - by user1439659
    I am building a website to capture data. I have many spreadsheets that are used for data entry or capture. Now I want to mimic these complex spreadsheets on the web forms but I am unsure of the correct control to use. Data entry must be allowed and live calculations also need to be made similar to formulas on normal excel spreadsheets. Later on the data must be captured into an SQL table. What would be the best control to use or method to mimic that functionality, albeit that the spreadsheet component is no longer available in visual studio 2010. Is it a data grid? Thanks

    Read the article

  • How do I get regex support in excel via a function, or custom function?

    - by blunders
    It appears that regex (as in regular expressions) is not supported in excel, except via VBA. Is this so, and is it is, are there any "open source" custom VBA functions that support regex. In this case I'm looking to extract complex pattern within a string, but any implementation of a custom VBA function that expose support of regex within the function itself would be of use. If you know of semi-related function such as the IS function, feel feel to comment, though I'm really looking for a full regular expression implementation that is exposed via functions. Might even be open to a pay to use add-in if the implementation is good. If you have questions, please comment.

    Read the article

  • How to create "lock" (stop updating of cells) in Excel?

    - by Oozi
    My question is pretty simple, but one to which I can't really find a solution myself. I use Excel quite frequently, but rarely the fancy stuff. Anyway, to the point: How do I create a dropmenu that will lock certain cells, rows or columns? (by lock I mean unable to change via hand and stops updating itself). Example: A1 = 5 B1 = A1 * 100 Can I "lock" the B1-cell, so that changing A1 will have no effect on B1 (Will remain at value 500)? I would preferably want to be able to "unlock" the cell as well, instead of simply making function into value. Is this possible? Thanks in advance!

    Read the article

  • Excel Interop: Fastest way to change color of portions of text in a huge range of cells

    - by Kyopaxa
    There some articles about the fastest way to write data using Excel interop assigning directly an Array of data to the value of the range. Like: string[,] multidimensionalArrayData = new string[200, 3]; // (...) Fill multidimensionalArrayData with your data dataSheet.Range["A1:C200"].Value = multidimensionalArrayData; There are also some articles about how to change the Font color of a specific portion of text, for example (VB this time): With ActiveCell.Characters(Start:=3, Length:=3).Font .Name = "Arial" .FontStyle = "Regular" .Size = 10 .Color = "Red" .ThemeFont = xlThemeFontNone End With The question now is, what would be the fastest way to change the color of specific portions of text for thousands of cells? Currently, in my C# code, I have to do it cell by cell, with a horrible performance hit. Is there a way to fill an array of 'Characters' objects in C# and pass that array to a range in one go? Any other solutions?

    Read the article

  • SQL SERVER – Copy Data from One Table to Another Table – SQL in Sixty Seconds #031 – Video

    - by pinaldave
    Copy data from one table to another table is one of the most requested questions on forums, Facebook and Twitter. The question has come in many formats and there are places I have seen developers are using cursor instead of this direct method. Earlier I have written the similar article a few years ago - SQL SERVER – Insert Data From One Table to Another Table – INSERT INTO SELECT – SELECT INTO TABLE. The article has been very popular and I have received many interesting and constructive comments. However there were two specific comments keep on ending up on my mailbox. 1) SQL Server AdventureWorks Samples Database does not have table I used in the example 2) If there is a video tutorial of the same example. After carefully thinking I decided to build a new set of the scripts for the example which are very similar to the old one as well video tutorial of the same. There was no better place than our SQL in Sixty Second Series to cover this interesting small concept. Let me know what you think of this video. Here is the updated script. -- Method 1 : INSERT INTO SELECT USE AdventureWorks2012 GO ----Create TestTable CREATE TABLE TestTable (FirstName VARCHAR(100), LastName VARCHAR(100)) ----INSERT INTO TestTable using SELECT INSERT INTO TestTable (FirstName, LastName) SELECT FirstName, LastName FROM Person.Person WHERE EmailPromotion = 2 ----Verify that Data in TestTable SELECT FirstName, LastName FROM TestTable ----Clean Up Database DROP TABLE TestTable GO --------------------------------------------------------- --------------------------------------------------------- -- Method 2 : SELECT INTO USE AdventureWorks2012 GO ----Create new table and insert into table using SELECT INSERT SELECT FirstName, LastName INTO TestTable FROM Person.Person WHERE EmailPromotion = 2 ----Verify that Data in TestTable SELECT FirstName, LastName FROM TestTable ----Clean Up Database DROP TABLE TestTable GO Related Tips in SQL in Sixty Seconds: SQL SERVER – Insert Data From One Table to Another Table – INSERT INTO SELECT – SELECT INTO TABLE Powershell – Importing CSV File Into Database – Video SQL SERVER – 2005 – Export Data From SQL Server 2005 to Microsoft Excel Datasheet SQL SERVER – Import CSV File into Database Table Using SSIS SQL SERVER – Import CSV File Into SQL Server Using Bulk Insert – Load Comma Delimited File Into SQL Server SQL SERVER – 2005 – Generate Script with Data from Database – Database Publishing Wizard What would you like to see in the next SQL in Sixty Seconds video? Reference: Pinal Dave (http://blog.sqlauthority.com)   Filed under: Database, Pinal Dave, PostADay, SQL, SQL Authority, SQL in Sixty Seconds, SQL Query, SQL Scripts, SQL Server, SQL Server Management Studio, SQL Tips and Tricks, T SQL, Technology, Video Tagged: Excel

    Read the article

  • The Best How-To Geek Articles About Microsoft Office

    - by Lori Kaufman
    We’ve published a lot of articles about Microsoft Office 2007 and 2010 and the programs in the suite. This article compiles many useful tips for Office, Word, Excel, Outlook, PowerPoint, OneNote, and a few links to articles about the latest version, Office 2013. HTG Explains: Does Your Android Phone Need an Antivirus? How To Use USB Drives With the Nexus 7 and Other Android Devices Why Does 64-Bit Windows Need a Separate “Program Files (x86)” Folder?

    Read the article

  • Custom Java Web Development vs Spreadsheet

    - by jacktrades
    Need some arguments why a small business should prefer a custom web developed solution using relational database (e.g. Java Servlet + MySQL) over standard Spreadsheet user programs like Excel. Specially now in these days that Office 365 is available in the cloud. As a Java programmer need good arguments to convince clients that this approach is better (if it really is) This is a generic situation, I understand that each case is different. Nevertheless answers so far has pinpointed right answers.

    Read the article

  • Stock Analysis and Moving Average with PowerPivot

    - by Marco Russo (SQLBI)
    One week ago Alberto Ferrari wrote a post about how to do working days calculation in PowerPivot . You might think this is necessary only for accounting department or something like that… but in reality the same techniques are really useful to implement calculations that might be useful when you want to implement some stock analysis using PowerPivot and Excel! As you might know, in PowerPivot it is important having a Dates table containing all the days, without exceptions. But when you manage stock...(read more)

    Read the article

  • How can I write an excel formula to do row based calculations; where certain conditions need to be met?

    - by BDY
    I am given: An excel sheet contains around 200 tasks (described in rows 2-201 in Column A). Each task can be elegible for a max of two projects (There are 4 projects in total, called "P1-P4" - drop down lists in Columns B and D); and this with a specific %-rate allocation (columns C & E - Column C refers to the Project Column B, and Column E refers to the Project in Column D). Column F shows the amount of work days spent on each task. Example in row 2: Task 1 (Column A); P1 (Column B) ; 80% (Column C) ; P3 (Column D) ; 20% (Column E) ; 3 (Column F) I need to know the sum of the working days spent on Project P3 respecting the %-rate for elegibility. I know how to calculate it for each Task (each Row) - e.g. for Task 1: =IF(B2="P3";C2*F2)+IF(D2="P3";E2*F2) However instead of repeating this for each task, I need a formula that adds them all together. Unfortunately the following formula shows me an error: =IF(B2:B201="P3";C2:C201*F2:F201)+IF(D2:D201="P3";E2:E201*F2:F201) Can anyone help please? Thank you!!

    Read the article

  • virtualisation with kvm: export services from guest to the host

    - by ascobol
    Hello, I would like to export some services from the guest os to the host os, via kvm, and by the same way learn some things about networking. I have tried the following commands: In the host (kubuntu 10.4): $ sudo tunctl -u ascobol Set 'tap0' persistent and owned by uid 2401 $ sudo ifconfig tap0 192.168.2.1 netmask 255.255.255.0 broadcast 192.168.2.255 The ifconfig command returns: $ /sbin/ifconfig tap0 Link encap:Ethernet HWaddr 3e:4e:e3:cc:bc:92 inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0 inet6 addr: fe80::3c4e:e3ff:fecc:bc92/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:17 overruns:0 carrier:0 collisions:0 txqueuelen:500 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) $ route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 tap0 Then I run the virtual machine (ubuntu server 10.4): $ sudo kvm -hda ubuntuserver104.qcow2 -net nic -net tap,name=tap0,script=no (I'm using sudo because without it fails with the following message:) warning: could not configure /dev/net/tun: no virtual network emulation With sudo the virtual machine boots, I just get this message: pci_add_option_rom: failed to find romfile "pxe-rtl8139.bin" In the virtual machine: $ ifconfig eth0 192.168.2.2 netmask 255.255.255.0 broadcast 192.168.2.255 Now if I run: $ ssh 192.168.2.2 I just get a No route to host What is wrong with this setup ? Thanks !

    Read the article

  • How can i export a folder of Firefox Bookmarks into a text file

    - by Memor-X
    I want to clean up my bookmark folders by getting rid of duplicated/links. i have created a program which will import 2 text files which contains a URL like this File 1: http://www.google/com http://anime.stackexchange.com/ https://www.fanfiction.net/guidelines/ https://www.fanfiction.net/anime/Magical-Girl-Lyrical-Nanoha/?&srt=1&g1=2&lan=1&r=103&s=2 File 2: http://scifi.stackexchange.com/ http://scifi.stackexchange.com/questions/56142/why-didnt-dumbledore-just-hunt-voldemort-down http://anime.stackexchange.com/ http://scifi.stackexchange.com/questions/5650/how-can-the-doctor-be-poisoned the program compares the 2 lists and creates a single master list with duplicate URLs removed. Now i have a few Backup bookmark folders in Firefox which on occasion i'll bookmark all tabs into a new folder with the date of the backup before i close off tabs or do reset my PC. each folder can have between 1000-2000 bookmarks, sometimes there are a bunch of pages which keep getting bookmarked, ie, i have ~50 pages on the Magical Girl Lyrical Nanoha Wiki on different spells, character and terminology which i commonly look back on. I'd like to know how i can export a bookmark folder so i have a list of URLs similar to what i use in my program

    Read the article

  • How to repair a corrupted Excel file

    - by SjoerdV
    I'm trying to restore some files for a friend who messed up a USB stick by pulling it out of the computer too soon. By searching invisible partitions I was able to restore the files. All files are intact, except 1 excel file that seems to be corrupted. I've googled about ways to repair an Excel file, because the default repair options in Excel 2003-2010 do not work for this file. I've came across a numerous third-party apps, of which the one seemes to be able to do the job: Recovery Toolbox for Excel. Of-course, this and all other apps I found require a purchase to actually repair the file. It seems a bit silly to pay 30 dollars for a one time thing, and something that is not for myself. So, I would like to keep that as a last-resort option. Is there anything I can try to fix this? I've attached a screenshot of how the file looks when I open it on my OSX when converted to a HTML file (to view the code), for the option that it could be a character set problem.

    Read the article

  • mysqldump isn't able to export a specific database, phpMyAdmin crashes

    - by Devils Child
    I'm experiencing problems with a database on my server (Note: All other databases work fine). Once I try to export it with mysqldump I get this error: # mysqldump -u root -pXXXXXXXXX databasename > /root/databasename.sql mysqldump: Couldn't execute 'show table status like 'apps'': Lost connection to MySQL server during query (2013) Also, phpMyAdmin throws an error when selecting this database and immediately logs out. However, the web site which uses this database works fine. I can also execute SELECT statements on the table named "apps" from the MySQL shell. I tried restarting the MySQL daemon as well as REPAIR DATABASE and REPAIR TABLE but the problem still persists. I had this problem before, then it disappeared somehow without me doing anything to resolve the issue. Now, the problem is back and I'm simply unable to create a backup of this database. Used software Debian 6.0.7 x64 MySQL 5.1.66-0 MySQL Version: mysql> SHOW VARIABLES LIKE "%version%"; +-------------------------+-------------------+ | Variable_name | Value | +-------------------------+-------------------+ | protocol_version | 10 | | version | 5.1.66-0+squeeze1 | | version_comment | (Debian) | | version_compile_machine | x86_64 | | version_compile_os | debian-linux-gnu | +-------------------------+-------------------+

    Read the article

  • Export unicode data from mysql

    - by Nayn
    Hi Folks, I have some data in one of my mysql table stored as utf8. The data is some japanese text. I need to export it to excel. Could you tell how to do it? Exporting by SELECT ... INTO OUTFILE returns some plain text file. I'm not sure how to read it back in excel so that japanese character would show properly Thanks Nayn

    Read the article

  • Export to Excel in Asp.net MVC

    - by BigJoe714
    I am working on an ASP.NET MVC application where I need to export data to an excel spreadsheet. Previously, in webforms apps, I used some code I found to render a GridView as an excel-compatible file. This was quite handy. I was wondering what the quickest/most effective method would be to do this in MVC. Thanks.

    Read the article

  • Variable number of arguments in ParamArray ArgList()

    - by Excel VBA guy
    If I want to pass a number of values for the ParamArray arglist via an array, how do I do it? From what I've read so far, on VBA, it appears that I need to explicitly list the values that I want to pass. But what if there are potentially different numbers of values to pass, so I do not know in advance how many I'll want to pass to the function? Is there not some way of using an array (a one-dimensional array) with a variable dimension?

    Read the article

  • How can I set PivotField.Calculation in Excel/VSTO?

    - by Kang Su
    I'm trying to set the Calculation property on an OLAP PivotField with VSTO 3.0. For example: pivotField.Calculation = XlPivotFieldCalculation.PercentOf; If I do the above, the value I assign does not stay (Excel appears to revert the change). I suspect the reason is that the BaseField property of the PivotField also needs to be populated (as PercentOf needs a BaseField). But it appears to me that you can't set the BaseField property until you've set the Calculation property (otherwise you get a COMException). I've tried to set ManualUpdate on the PivotTable to true, but with VSTO this rarely works, as this gets reverted immediately back to false. Note, that this seems to work fine in VBA as you can assign multiple values in a single statement, like this: With ActiveSheet.PivotTables("PivotTable1").PivotFields("[Measures].[Reseller Sales Amount]") .Calculation = xlPercentOf .BaseField = "[Geography].[Geography].[Country]" .BaseItem = "[Geography].[Geography].[Country].&[France]" .NumberFormat = "0.00%" End With But with C#/VSTO there's no construct like this (that I know of) and I'm stuck not able to do something like the above. Further note, Calculation values that don't require a BaseField, e.g., XlPivotFieldCalculation.xlPercentOfTotal, get set just fine. Any help on this would be greatly appreciated!

    Read the article

  • Creating a new workbook in Excel from Python breaks

    - by Marcelo Cantos
    I am trying to use the stock standard win32com approach to drive Excel 2007 from Python. However, when I try to create a new workbook, things go pear-shaped: Python 2.6.4 (r264:75706, Nov 3 2009, 13:23:17) [MSC v.1500 32 bit (Intel)] on win32 ... >>> import win32com.client >>> excel = win32com.client.Dispatch("Excel.Application") >>> wb = excel.Workbooks.Add() Traceback (most recent call last): File "<pyshell#3>", line 1, in <module> wb = excel.Workbooks.Add() File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", line 467, in __getattr__ if self._olerepr_.mapFuncs.has_key(attr): return self._make_method_(attr) File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", line 295, in _make_method_ methodCodeList = self._olerepr_.MakeFuncMethod(self._olerepr_.mapFuncs[name], methodName,0) File "C:\Python26\lib\site-packages\win32com\client\build.py", line 297, in MakeFuncMethod return self.MakeDispatchFuncMethod(entry, name, bMakeClass) File "C:\Python26\lib\site-packages\win32com\client\build.py", line 318, in MakeDispatchFuncMethod s = linePrefix + 'def ' + name + '(self' + BuildCallList(fdesc, names, defNamedOptArg, defNamedNotOptArg, defUnnamedArg, defOutArg) + '):' File "C:\Python26\lib\site-packages\win32com\client\build.py", line 604, in BuildCallList argName = MakePublicAttributeName(argName) File "C:\Python26\lib\site-packages\win32com\client\build.py", line 542, in MakePublicAttributeName return filter( lambda char: char in valid_identifier_chars, className) File "C:\Python26\lib\site-packages\win32com\client\build.py", line 542, in <lambda> return filter( lambda char: char in valid_identifier_chars, className) UnicodeDecodeError: 'ascii' codec can't decode byte 0x83 in position 52: ordinal not in range(128) >>> What is going wrong here? Have I done something silly, or is Python/win32com/Excel somehow broken?

    Read the article

  • Exporting de-aggregated data

    - by Ben
    I'm currently working on a data export feature for a survey application. We are using SQL2k8. We store data in a normalized format: QuestionId, RespondentId, Answer. We have a couple other tables that define what the question text is for the QuestionId and demographics for the RespondentId... Currently I'm using some dynamic SQL to generate a pivot that joins the question table to the answer table and creates an export, its working... The problem is that it seems slow and we don't have that much data (less than 50k respondents). Right now I'm thinking "why am I 'paying' to de-aggregate the data for each query? Why don't I cache that?" The data being exported is based on dynamic criteria. It could be "give me respondents that completed on x date (or range)" or "people that like blue", etc. Because of that, I think I have to cache at the respondent level, find out what respondents are being exported and then select their combined cached de-aggregated data. To me the quick and dirty fix is a totally flat table, RespondentId, Question1, Question2, etc. The problem is, we have multiple clients and that doesn't scale AND I don't want to have to maintain the flattened table as the survey changes. So I'm thinking about putting an XML column on the respondent table and caching the results of a SELECT * FROM Data FOR XML AUTO WHERE RespondentId = x. With that in place, I would then be able to get my export with filtering and XML calls into the XML column. What are you doing to export aggregated data in a flattened format (CSV, Excel, etc)? Does this approach seem ok? I worry about the cost of XML functions on larger result sets (think SELECT RespondentId, XmlCol.value('//data/question_1', 'nvarchar(50)') AS [Why is there air?], XmlCol.RinseAndRepeat)... Is there a better technology/approach for this? Thanks!

    Read the article

  • connecting to mysql from excel: ODBC driver does not support the requested properties.

    - by every_answer_gets_a_point
    i am trying to add data to mysql from excel. i am getting the above error on this line: rs.Open strSQL, oConn, adOpenDynamic, adLockOptimistic here is my code: Dim oConn As ADODB.Connection Private Sub ConnectDB() Set oConn = New ADODB.Connection oConn.Open "DRIVER={MySQL ODBC 5.1 Driver};" & _ "SERVER=localhost;" & _ "DATABASE=employees;" & _ "USER=root;" & _ "PASSWORD=some_pass;" & _ "Option=3" End Sub Function esc(txt As String) esc = Trim(Replace(txt, "'", "\'")) End Function Private Sub InsertData() Dim rs As ADODB.Recordset Set rs = New ADODB.Recordset ConnectDB With wsBooks For rowCursor = 2 To 11 strSQL = "INSERT INTO tutorial (author, title, price) " & _ "VALUES ('" & esc(.Cells(rowCursor, 1)) & "', " & _ "'" & esc(.Cells(rowCursor, 2)) & "', " & _ esc(.Cells(rowCursor, 3)) & ")" rs.Open strSQL, oConn, adOpenDynamic, adLockOptimistic Next End With End Sub whats wrong with rs.Open strSQL, oConn, adOpenDynamic, adLockOptimistic ? why am i getting the odbc error?

    Read the article

  • Excel I have a .Net object compiled as a tlb but cant not access any methods apart from Dispose.

    - by Mark O'Grady
    Hi This is ongoing issue to something I posted yesterday. I have a .net object that I want to use in Excel. I have an existing VBA script that i need to alter to call this the object from. I have then converted the object to a TLB. I've not really touched on this area before so any help will be appreciated. I have created an interface [Guid("0F700B48-E0CA-446b-B87E-555BCC317D74"),InterfaceType(ComInterfaceType.InterfaceIsDual)] [ComVisible(true)] public interface IOfficeCOMInterface { [DispId(1)] void ResetOrder(); [DispId(2)] void SetDeliveryAddress(string PostalName, string AddressLine1, string AddressLine2, string AddressLine3, string AddressLine4, string PostCode, string CountryCode, string TelephoneNo, string FaxNo, string EmailAddress); } I have also created an class that inherits that object. [ClassInterface(ClassInterfaceType.None), ProgId("NAMESPACE.OfficeCOMInterface"), Guid("9D9723F9-8CF1-4834-BE69-C3FEAAAAB530"), ComVisible(true)] public class OfficeCOMInterface : IOfficeCOMInterface, IDisposable { public void ResetSOPOrder() { } public void SetDeliveryAddress(string PostalName, string AddressLine1, string AddressLine2, string AddressLine3, string AddressLine4, string PostCode, string CountryCode, string TelephoneNo, string FaxNo, string EmailAddress) { try { SalesOrder.AmendDeliveryAddress(PostalName, AddressLine1, AddressLine2, AddressLine3, AddressLine4, PostCode); MessageBox.Show("Delivery address set"); } catch (Exception ex) { throw ex; } } } I can't access the object methods apart from dispose, I guess IDisposable is working fine. Is there anything I need to my Interface?

    Read the article

  • Reading Excel using ClosedXML

    I have used closedXML api to read the excel. Here is how you do it. Statistically, this performs better than OpenXML. public DataTable ReadDataFromExcelUsingClosedXML()         { string filePath ="@c:/temp/example.xlsx";             var LobjWorkbook = new XLWorkbook(filePath);             var LobjWorksheet = LobjWorkbook.Worksheets.First();             var LobjFullRange = LobjWorksheet.RangeUsed();             var LobjUsedRange = LobjWorksheet.Range(MobjImportMapper.HeaderRowIndex + 1, 1, LobjFullRange.RangeAddress.LastAddress.RowNumber,                                                     LobjFullRange.RangeAddress.LastAddress.ColumnNumber);             var LiNumberOfcolumnsInTheExcel = LobjUsedRange.ColumnCount();             //  for progress bar             int LiAggregateRowCounter = MobjImportMapper.HeaderRowIndex;             int LiTotalNumberOfRows = LobjWorksheet.RowCount() - LiAggregateRowCounter;             int LiPercentage = 0;             foreach (var LobjRow in LobjUsedRange.RowsUsed())             {                 int LiTemp = 0;                 object[] LobjrowData = new object[LiNumberOfcolumnsInTheExcel + 1];                 LobjrowData[LiTemp] = LobjRow.RangeAddress.FirstAddress.RowNumber;                 LiTemp++;                 LobjRow.Cells().ForEach(PobjCell => LobjrowData[LiTemp++] = PobjCell.Value);                 LdtExcelData.Rows.Add(LobjrowData);                 //  for progress bar                 LiPercentage = ((100 * LiAggregateRowCounter / LiTotalNumberOfRows) / 4) * 3;                 if (LiPercentage > 5)                     PobjBackgoundWorker.ReportProgress(LiPercentage);                 LiAggregateRowCounter++;                 // =====================             }             return LdtExcelData;         } span.fullpost {display:none;}

    Read the article

  • How to export ECC key and Cert from NSS DB and import into JKS keystore and Oracle Wallet

    - by mv
    How to export ECC key and Cert from NSS DB and import into JKS keystore and Oracle Wallet In this blog I will write about how to extract a cert and key from NSS Db and import it to a JKS Keystore and then import that JKS Keystore into Oracle Wallet. 1. Set Java Home I pointed it to JRE 1.6.0_22 $ export JAVA_HOME=/usr/java/jre1.6.0_22/ 2. Create a self signed ECC cert in NSS DB I created NSS DB with self signed ECC certificate. If you already have NSS Db with ECC cert (and key) skip this step. $export NSS_DIR=/export/home/nss/ $$NSS_DIR/certutil -N -d . $$NSS_DIR/certutil -S -x -s "CN=test,C=US" -t "C,C,C" -n ecc-cert -k ec -q nistp192 -d . 3. Export ECC cert and key using pk12util Use NSS tool pk12util to export this cert and key into a p12 file      $$NSS_DIR/pk12util -o ecc-cert.p12 -n ecc-cert -d . -W password 4. Use keytool to create JKS keystore and import this p12 file 4.1 Import p12 file created above into a JKS keystore $JAVA_HOME/bin/keytool -importkeystore -srckeystore ecc-cert.p12 -srcstoretype PKCS12 -deststoretype JKS -destkeystore ecc.jks -srcstorepass password -deststorepass password -srcalias ecc-cert -destalias ecc-cert -srckeypass password -destkeypass password -v But if an error as shown is encountered, keytool error: java.security.UnrecoverableKeyException: Get Key failed: EC KeyFactory not available java.security.UnrecoverableKeyException: Get Key failed: EC KeyFactory not available        at com.sun.net.ssl.internal.pkcs12.PKCS12KeyStore.engineGetKey(Unknown Source)         at java.security.KeyStoreSpi.engineGetEntry(Unknown Source)         at java.security.KeyStore.getEntry(Unknown Source)         at sun.security.tools.KeyTool.recoverEntry(Unknown Source)         at sun.security.tools.KeyTool.doImportKeyStoreSingle(Unknown Source)         at sun.security.tools.KeyTool.doImportKeyStore(Unknown Source)         at sun.security.tools.KeyTool.doCommands(Unknown Source)         at sun.security.tools.KeyTool.run(Unknown Source)         at sun.security.tools.KeyTool.main(Unknown Source) Caused by: java.security.NoSuchAlgorithmException: EC KeyFactory not available         at java.security.KeyFactory.<init>(Unknown Source)         at java.security.KeyFactory.getInstance(Unknown Source)         ... 9 more 4.2 Create a new PKCS11 provider If you didn't get an error as shown above skip this step. Since we already have NSS libraries built with ECC, we can create a new PKCS11 provider Create ${java.home}/jre/lib/security/nss.cfg as follows: name = NSS     nssLibraryDirectory = ${nsslibdir}    nssDbMode = noDb    attributes = compatibility where nsslibdir should contain NSS libs with ECC support. Add the following line to ${java.home}/jre/lib/security/java.security :      security.provider.9=sun.security.pkcs11.SunPKCS11 ${java.home}/lib/security/nss.cfg Note that those who are using Oracle iPlanet Web Server or Oracle Traffic Director, NSS libs built with ECC are in <ws_install_dir>/lib or <otd_install_dir>/lib. 4.3. Now keytool should work Now you can try the same keytool command and see that it succeeds : $JAVA_HOME/bin/keytool -importkeystore -srckeystore ecc-cert.p12 -srcstoretype PKCS12 -deststoretype JKS -destkeystore ecc.jks -srcstorepass password -deststorepass password -srcalias ecc-cert -destalias ecc-cert -srckeypass password -destkeypass password -v [Storing ecc.jks] 5. Convert JKS keystore into an Oracle Wallet You can export this cert and key from JKS keystore and import it into an Oracle Wallet if you need using orapki tool as shown below. Make sure that orapki you use supports ECC. Also for ECC you MUST use "-jsafe" option. $ orapki wallet create -pwd password  -wallet .  -jsafe $ orapki wallet jks_to_pkcs12 -wallet . -pwd password -keystore ecc.jks -jkspwd password -jsafe AS $orapki wallet display -wallet . -pwd welcome1  -jsafeOracle PKI Tool : Version 11.1.2.0.0Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.Requested Certificates:User Certificates:Subject:        CN=test,C=USTrusted Certificates:Subject:        OU=Class 3 Public Primary Certification Authority,O=VeriSign\, Inc.,C=USSubject:        CN=GTE CyberTrust Global Root,OU=GTE CyberTrust Solutions\, Inc.,O=GTE Corporation,C=USSubject:        OU=Class 2 Public Primary Certification Authority,O=VeriSign\, Inc.,C=USSubject:        OU=Class 1 Public Primary Certification Authority,O=VeriSign\, Inc.,C=USSubject:        CN=test,C=US As you can see our ECC cert in the wallet. You can follow the same steps for RSA certs as well. 6. References http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=356 http://old.nabble.com/-PATCH-FOR-REVIEW-%3A-Support-PKCS11-cryptography-via-NSS-p25282932.html http://www.mozilla.org/projects/security/pki/nss/tools/pk12util.html

    Read the article

< Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >