Jump to content

Search the Community

Showing results for tags 'excel'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH


  • Community Calendar




Website URL








Found 14 results

  1. Help exporting xml

    Hello. Here is my problem that I really hope someone can help me solve. I work in the parts department at my company. On Monday, my boss is going to ask me to input a list of parts into a website that is going to take me about 4 hours to key in. It's about 400 or more lines of ten key that looks like this 1 123456-001 C14B23 5 123321-001-01 C1521 Repeat that with different numbers about 500 times. I found the website has an upload option so that I can import the parts. I know very little about XML. I got the company to send me an example upload file for the website. I have been playing with it for the last week and have had some success but mostly failure and I don't know why. I have been able to get a file to upload but that file will not save more than one record and will not upload more than one record. Most of the time when I try to export my file, I get an error from excel that says "Cannot save or export XML data. The XML maps in this workbook are not exportable. I took the example XML file they sent me as an example and opened it up in Visual Studio 2013. Then I went to the XML option and chose to save it as an XSD. I then open Excel, and choose the source button, click the XML maps button, load the xsd file that I just created from the XML file and then drag the fields on into the spreadsheet. This has both worked and failed for me. I don't know why it is that I have been able to get it to work and have not. My goal is to export the parts list from our database at work into an Excel sheet, import the XML template that I am trying to create and then copy and paste the parts. Export that as a parts list XML file and upload it to the website thereby saving me about 4 hours of typing. When I take the working example, import it into Excel, It automatically generates the map for me. I add a new line, and then try to export it and it won't. It fails. All the googling in the world has not taught me as to why. I don't understand the rules that Excel points to in order to fix this issue. I thought it had to do with repeating fields and that there needed to be 2 data sets but I can't figure out what that exactly means. I have attached my working example. Can someone please tell me how I can get this into a working spreadsheet template so that I can add rows for my import? Working-Example.xml
  2. I need to check if value inserting in database while **import excel file** , if it has already value in database then it should get update. Below is producttab table value in database prdid | prdname 00A | prd1 00B | prd2 00C | prd3 00D | prd4 Below is EXCEL FILE data prdid | prdname 00A | prdnew 00B | prd2new 00E | prd8 00H | prd9 So if i upload above excel file then , 00A , 00B should get UPDATE IN producttab table as they are already present there... but 00E,00H should get insert below is what i have tried, value is getting insert properly only UPDATE IS NOT HAPPENING if(isset($_POST["Upload"])) { $fileinfo = pathinfo($_FILES["uploadFile"]["name"]); $filetype = $_FILES["uploadFile"]["type"]; $remark = NULL; //Validate File Type if(strtolower(trim($fileinfo["extension"])) != "csv") { $_SESSION['msg_r'] = "Please select CSV file"; header("location:importfile.php"); exit; } else { $file_path = $_FILES["uploadFile"]["tmp_name"]; } $row = 0; $tempFileName = time().".csv"; if ( is_uploaded_file( $file_path ) ) { $fileCopied = copy( $file_path , $tempFileName); if (($handle = fopen($tempFileName, "r")) !== FALSE) { fgetcsv($handle); while (($data = fgetcsv($handle, 6000, ",")) !== FALSE) { $num = count($data); for ($c=0; $c < $num; $c++) { $col[$c] = $data[$c]; } $col1 = $col[0]; // prdid $col2 = $col[1]; // prdname $sql = "SELECT prdid FROM producttab WHERE prdid = '".$col1."' "; $query = db_query($sql); $pfetech = db_fetch($query); if($col1 == $pfetech['prdid']){ $sqlup = "UPDATE producttab SET prdid = ".$pfetech['prdid'].", prdname = ".$col2." "; $sqlup .= " WHERE prdid = ".$pfetech['prdid']." "; $resultsqlupdate = mysql_query($sqlup); }else{ $query = "INSERT INTO producttab(prdid,prdname) VALUES('".$col1."','".$col2.")"; $s = mysql_query($query); } } fclose($handle); } echo "<center>File data imported to database!!</center>"; } } }
  3. XML to Excel

    Hello, I have a XML file with a lot of nested tags like <levelone> <content>abc</content) <contentb>def</contentb> . . . </levelone> And I want to convert each tag into a separate column with the corresponding value in Excel. Has anyone a hint where to start here? I tried opening it in Excel but it only displays the structure like in any text editor. Cheers, John
  4. Hi Guys! I have a xls file ex: 9015000000 I france I FRANCE I would like to automatically generates a txt file for each set of lines xls to have a line like this: <option value = "901500000001"> france - FRANCE </ option> Be done with xml or possible way Thanks!
  5. I have written a SQL Query for my Database at work in Excel so that I can automatically update it. Took me a while to figure out the date sections and getting it to return just the current date with the below code. WHERE f.FolioStatusId in (1, 7, 8, 9, 13) AND cast(f.made_on as date) >= cast(getdate() as date) What I'd like to do is to have a section in Excel where I can type the Dates that I need the data from and too. I know that I can insert a "?" in the query section to make a cell reference but cant figure out what code would need to go in the WHERE section to do that. Any help would be greatly appreciated!
  6. Hi guys, here is what I have: an excel sheet (XLS, 4MB) with postal codes in the first column more data in the other columns here is what I need: looking for the postal code in the excel sheet get the information to this postal code from the other columns work with the other information (use them as variables) example: PC | A | B | C 1234 | 2.3 | 3.5 | 1.1 2345 | 3.3 | 3.3 | 7.8 ---> If I have the postal code 2345, I want to create the variables $a=3.3 ; $b=3.3 ; c=7.8 in PHP here is what I heard about: phpexcel.php php_excelReader here are my questions: What would you recommend (phpexcel.php or php_excelReder or something else)? Is there a tutorial on w3schools (I couldn´t find one)? Can you provide some code? Thanks for your help!
  7. PHP to XML to Excel

    I've created a php file that gathers data from my SQL tables and creates a multi-sheet Excel workbook file in XML. I started this process by creating the file as I wanted it to appear using MS Excel 2010 and saved it as a XML file. I then wrote my PHP code to dynamically create the MS Excel XML file. In internet Explorer 11, when this is done, the file opens as a MS Excel file. My problem is that it doesn't work in Firefox (Version 31.0). In Firefox, it prints out on the screen as an unformatted XML file with the following message above the screen - "This XML file does not appear to have any style information associated with it. The document tree is shown below." I think the problem is in my header. This is the way the opening of my PHP file appears now: <?phpheader("Content-type: text/xml");echo "<?xml version="1.0" encoding="UTF-8"?><?mso-application progid="Excel.Sheet"?>";?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"><-- More code follows --> Any help you can offer will be welcome!
  8. my focus is across a whole 3 years (156 weeks) of data, beginning January 1st 2011 (or nearest date) and ending December 31st 2013 (or nearest date) – so while we are looking at 3 years total, we will only end up with 52 weeks in our clean version of the data, labelled Week 1 to Week 52 (and not dates).there will be items in this list that launched before 1st Jan 2011, for which part of the launch year will show up in the period we’re focused on. In order that data percentiles (will be calculated at later stage) are not clouded by this, we also need to move any part year data from launches preceding 1st Jan 2011 to the relevant column. To illustrate by example, an item launched in July 2010 will have 26 weeks in 2010 (that fall outside of our 3 yr window) and 26 weeks that fall inside our 3yr window, but the first week we see is actually week 27 of that item’s launch, and not week 1. So the 26 weeks of data that fall into our window, should be shifted out to align with week 27-52 of the ‘clean’ data columns – does this make sense? So i want to have another column next to the WeekNumber column, which will give me the correct number (from 1 to 52) to place the sales value for each product. If then you do a pivot as shown in http://i.imgur.com/VZVIlPb.jpg by arranging the weeknumber column in the Pivots Column area and Sales Value in Pivots Value area, you will see the sales values are then shifted properly to fit the 52 columns. So for each Product, 1] if the sales data starts from 1st week (W 2011 01) and its total weeks count is < 52, then it means some weeks sales data lying in previous year. So this data needs to be numbered to correct week (between 1 to 52), by finding its column: (52 - count of weeks containing data for that product + 1).2] if the sales data does not start from 1st week (W 2011 01) and its total week count is < 52 then move it to 1st week (W 2011 01) column in 1 to 52 weeks i.e. number it as 1, 2, .....<=52.3] if the data starts from 1st week and is 52 weeks data then keep it as it is showing from 1 to 52 weeks. i.e. number it as 1,2,....52. Hope this makes sense. see the linkback for further clarity. http://stackoverflow.com/questions/23825905/shifting-156-weeks-sales-figures-to-52-weeks
  9. Javascript Calculator

    Hi, I am building some javascript calculators that must calculate according to an excel doc with formulas ; ie, (it must have same answers as excel sheet). I am fairly new at javascript but have gotten pretty far. The problem that im having is that the answers that my javscript calculators are producing arent exactly the same as the Excel formulas. (but very close) Example: Javascript Calculator- https://wzsdesign.com/WebTemplWP1/cal6.html Excel Formulas- If you take a look at the link with the javascript calculator and input the same numbers as the screen shot you will notice that there a small differences in the answers. Can someone please help?
  10. Hi all,Online registration form which allow users to fill in their details and send the data by submitting the form to my email using php.I need to create an online registration form and when the form is submitted, the data needs to go in to a spreadsheet in (MS EXCEL). Maybe a database I guess..The data should be able to be accessed at any time and read by a spreadsheet by someone in the office. Someone sent me this code $df = fopen("php://output", 'w'); fputcsv($df, array_keys(reset($array))); foreach ($_POSTas $row) { fputcsv($df, $row); } fclose($df); Can anyone help me as to where and how I use this snippet to get it to work. Basically the form data needs to be written into a CSV file. Here is the form: <form action="http://www.sohrabgoodar.com/w-hill-contactformprocess.php" method="post" id="comments_form"><div class="row"> <div class="label">Name</div><!--end .label--> <div class="input"> <input type="text" for="name" id="name" class="detail" name="name" /> </div><!--end .input--> </div><!--end .row--> <div class="row"> <div class="label">Work Location</div><!--end .label--> <div class="input"> <input type="text" for="worklocation" id="worklocation" class="detail" name="worklocation" /> </div><!--end .input--> </div><!--end .row--> <div class="row"> <div class="label">Work Contact Number</div><!--end .label--> <div class="input"> <input type="text" for="worknumber" id="worknumber" class="detail" name="worknumber" /> </div><!--end .input--> </div><!--end .row--> <div class="row"> <div class="label">Mobile Contact Number</div><!--end .label--> <div class="input"> <input type="text" for="mobile" id="mobile" class="detail" name="mobile" /> </div><!--end .input--> </div><!--end .row--> <div class="row"> <div class="label">Email Address</div> <!--end .label--> <div class="input"> <input type="text" for="email" id="email" class="detail" name="email" /> </div><!--end .input--> </div><!--end .row--> <div class="row"> <div class="label">Ability Level</div> <!--end .label--> <div class="input3"> <select name="ability" for="ability" id="ability" class="detail"> <option>Please Choose</option> <option value="strong">Strong</option> <option value="medium">Medium</option> <option value="weak">Weak</option> </select> </div><!--end .input3--> </div><!--end .row--> <div class="row"> <div class="label">Tennis Standard</div> <!--end .label--> <div class="input3"> <select name="standard" for="standard" id="standard" class="detail"> <option>Please Choose</option> <option value="school">School</option> <option value="club">Club</option> <option value="county">County</option> <option value="international">International</option> </select> </div><!--end .input3--> </div><!--end .row--> <div class="row"> <div class="label">Frequency of Play</div> <!--end .label--> <div class="input3"> <select name="frequency" for="frequency" id="frequency" class="detail"> <option>Please Choose</option> <option value="weekly">Weekly</option> <option value="monthly">Monthly</option> <option value="fewtimes">Few Times a Year</option> </select> </div><!--end .input3--> </div><!--end .row--> <div class="row"> <div class="label2">Anything else you would like to tell us?</div><!--end .label2--> <div class="input2"> <textarea id="comment" name="comment" class="mess"></textarea> </div><!--end .input--> </div><!--end .row--> <div class="submit"> <input type="submit" id="submit" name="submit" value="Send Message" /> </div><!--end .submit--></form> Here is the old php file I was using to send the form data to emails. <?php $emailSubject = 'Tennis Registration!';$webMaster = 'someone@yahoo.co.uk';$nameField = $_POST['name'];$worklocationField = $_POST['worklocation'];$worknumberField = $_POST['worknumber'];$mobileField = $_POST['mobile'];$emailField = $_POST['email'];$abilityField = $_POST['ability'];$standardField = $_POST['standard'];$frequencyField = $_POST['frequency'];$commentField = $_POST['comment'];$body = <<<EOD<br><hr><br>Name: $nameField <br>Work location: $worklocationField <br>Work Number: $worknumberField <br>Mobile: $mobileField <br>Email: $emailField <br>Ability: $abilityField <br>Standard: $standardField <br>Frequency: $frequencyField <br>Comment: $commentField <br>EOD;$headers = "From: $email\r\n";$headers .= "Content-type: text/html\r\n";$success = mail($webMaster, $emailSubject, $body, $headers);$theResults = <<<EOD<p>Thank you for your Message! You will be redirected to the home page in a moment</p><script type="text/javascript" >setTimeout ('ourRedirect()', 3000)function ourRedirect(){ location.href='http://www.google.com/'}</script>EOD;echo "$theResults";?>
  11. FileSearch no longer used?

    I have this script which runs OK on an XP PC with Excel 2003 installed. When I try to run it on my XP PC with Excel 2010 I get an "Object doesn't support this action" 800A01BD error. Is this something to do with Excel 2010? Can the code be rewritten to get round this? +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Set objExcel = CreateObject("Excel.Application")objExcel.Visible = False dim partnumpartnum = Inputbox("Enter Part Number", "Search for Quotation by Part Number") Set objSearch = objExcel.FileSearchobjSearch.Lookin = "S:\Quotes"objSearch.SearchSubfolders = TRUEobjSearch.FileName = "*.xls"objSearch.TextOrProperty = partnumobjSearch.Execute Set fso = CreateObject("Scripting.FileSystemObject")Dim outputFileoutputFile = "./Qsearch.txt"Set txtStreamOut = fso.OpenTextFile(OutputFile, 2, True) For Each strFile in objSearch.FoundFiles txtStreamOut.writeline strfileNext MsgBox "Search Complete" & vbCrLf & "Open Qsearch.txt to see the results." _& vbCrLf & vbCrLf & "If you need to save the results, use File Save As and enter a different file name." _& vbCrLf & "Qsearch.txt will be overwritten with new data next time you run a search.", vbInformation , _"Created by Code Numpty" 'Version 1.0 - written by Sharon 12/03/2008'version 1.1 amended for new server name SL 20/7/2013+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  12. import fields from an Excel spreadsheet.

    Hi there!! Is there any way to import values of an Excel spreadsheet's fields using PHP? any help will be appreciated! Thanks in advance!! atar.
  13. VBScript

    Hey guys. Hope everyone here had a great 4th of July holiday! I am building an internal site that of course is only accessible via intranet. Its primary coding is very simple. Its HTML based with some Javascript and some VBScript. I will be honest. I am not an expert programmer by any means. So here is the issue. We have no access to the server logs as we do not admin the logs nor are we allowed to request them. We are basically borrowing the space. My management wants to have each page, when accessed or clicked on (either one) to log the hit to a csv file and a txt file saved on the server. I know a lot of people dont think VBScript is the way to go. This is what is needed in each column in the log: Date\Time stamp \ Hostname \ NT Login \ Page that was loaded We are in a Windows XP\7 Environment. We know this server supports IIS. We are also currently using SSI for our DHMTL menu. I was hoping someone could help me use the DHTML menu as an "onclick" so that any option clicked on the menu by the client would log the above information to a specific file. We are very limited on the access we have on the server. I am not very skilled in VBS at all and this is simply a last minute side project they want to test out. So if someone could help me with this that would be excellent. Thank you in advance.
  14. Hi all, Just a general question really. I have an MS Excel 2007 workbook that is used as input for estimates of cost and prices. The workbook will export the data from the workbook to an xml file for further use by other teams and interested parties. There are several xslt files that are used to manipulate the data from the workbook into different formats for other users, i.e. management just receive high level data, client receives another set of data. Some xslt files produce a HTML summary, some produce xml files for use in other workbooks. Currently the xslt files are held in the same folder as the workbook and accessed when needed through VBA and MSXML to create the relevant files in required formats Can anyone suggest a good method of storage for the external xslt files please? I am trying to avoid the situation where as requests for different types of summary information from the workbook is required and another xslt is needed and users may miss the new xslt file that has been created. Can multiple xslt files be held in one file? Any best practices, thoughts or suggestions? Any pitfalls in storing many xslt stylesheets in one file? Thanks! Graham