w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
HTML + CSS issue, Chrome/Safari vs Firefox text positioning issue
Add the following CSS to the container div: vertical-align: middle; display: table-cell; Example: <div style="vertical-align: middle; display: table-cell; height: 500px; width: 400px; border: 1px solid black;"> <div id="header-social-icons"><a href="http://test">C</a><a href="http://test">M</a><a href="http://test">F</a></div> <div>

Categories : HTML

Export content of HTML Table to Excel Sheet so as to be supported by browsers like IE , Mozilla , Firefox etc.?
use this following java code to export Html to Excel: var tableToExcel = (function() { var uri = 'data:application/vnd.ms-excel;base64,' , template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9] ><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet} </x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbo ok></xml><![endif]--></head><body><table>{table}</table></body></html>' , base64 = function(s) { return window.btoa(unescape(encodeURI

Categories : Java

.Net 4.0 Excel export issue
Interop is NOT supported in sever-scenarios (like IIS) by MS. AFAIK there is no option without any library to achieve what you want in a server-scenario! There are many options to read/edit/create Excel files without Interop/installing Excel on the server: I read in the comments that 3rd-party libraries are against company policy BUT I think since the OpenXML library is from MS itself AND free it might be an option MS provides the free OpenXML SDK V 2.0 - see http://msdn.microsoft.com/en-us/library/bb448854%28office.14%29.aspx (XLSX only) This can read+write MS Office files (including Excel). The other options are in case you get an exception from company policy and/or someone else comes looking for a solution to a similar problem Another free option see http://www.codeproject.com/

Categories : C#

Excel export issue - from Jquery dialog
There are some errors: filename should be enclosed in double quotes, and inline should be used instead of attachment, if you want to open it in the browser instead of downloading it: httpServletResponse.setHeader("Content-disposition", "inline; filename=""+filename+"".xls"); You should always specify the contentType: httpServletResponse.setContentType( "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); (or application/vnd.ms-excel for older Excel files); from the Action you should return NONE instead of null (this is causing your error). That said, you really don't have the need to use an Action like a Servlet (like instead I had here): just use a Stream result, set the ContentType and the ContentDisposition in the St

Categories : Jquery

Font-Awesome onlick issue on Safari, works on Chrome and Firefox
The only solution I can think of is calling the JavaScript event from the script source itself. For example, you have: <i class=“g120 icon-large icon-expand” border=“0” name=“exp49269” id=“exp49269” alt="Expand Body" title="Expand Body"></i> I assume you already have a function for changing the class, but just to be sure, Using JQuery: var $exp49269 = $('#exp49269'); // set a variable to store icon ID function collapseIcon() { this.removeClass('icon-expand').addClass('icon-collapse'); } $exp49269.click(collapseIcon); // call the function on click If you need it to expand and collapse multiple times, you can use a conditional statement to check if it has a certain class, then execute the class change: var $exp49269 = $('#exp49269'); // set a variab

Categories : Javascript

Puzzling Cross Browser Display Issue With Product Columns in Chrome & Firefox
Your source indicates that those li elements have an inline style setting the width. Chrome reports this: <li class="Odd" style="width: 159px !important; height 316px;">...</li> But Firefox reports this: <li style="width: 251px; height: 301px;" class="Odd">...</li> Whatever is generating those list item elements is your problem.

Categories : Google Chrome

how to implement Chrome extension 's chrome.tabs.sendMessage API in Firefox addon
In add-ons build using the Add-on SDK, content scripts are managed by main.js. There's no built-in way to access all of your add-on's content scripts. To send a message to all tabs, you need to manually keep track of the content scripts. One-way messages are easily implemented by the existing APIs. Callbacks are not built-in, though. My browser-action SDK library contains a module called "messaging", which implements the Chrome messaging API. In the following example, the content script and the main script use an object called "extension". This object exposes the onMessage and sendMessage methods, modelled after the Chrome extension messaging APIs. The following example adds a content script to every page on Stack Overflow, and upon click, the titles of the tabs are logged to the consol

Categories : Javascript

Menu items break on Chrome/Safari (Mac) but not on Firefox and Chrome for Win
This is probably because Chrome is rendering the fonts slightly differently and there will be a few pixels difference (about 4 or 5px over the screen width in this case). Here's a little trick I picked up a while ago to center the nav without padding and such: .site-header .site-nav ul { display: table; margin: 0 auto; } .site-header .site-nav li { display: block; float: left; } Notice there's no other margins or padding on the ul apart from the auto left and right. You'll also need to clear the ul with a clearfix because the li's are now floated. Or if you don't like using display:table you can do the same with display:inline-block on the ul, then set text-align:center on the .site-nav

Categories : HTML

Porting Chrome extension to Firefox : equivalent to chrome.storage
Yes exactly, it is simple-storage. You can use it like this : const storage = require("sdk/simple-storage").storage; storage.tokenFu = token;

Categories : Javascript

Export excel range as a new excel sheet with save as dialog box
Try below code : Sub copyValueTable() On Error Resume Next Dim rng As Range Dim wkb As Workbook Dim sht As Worksheet Set rng = Application.InputBox("Please select the range" & vbNewLine & "Enter named range", Type:=8) On Error GoTo 0 If Not rng Is Nothing Then fileSaveName = Application.GetSaveAsFilename(fileFilter:="xls Files (*.xls), *.xls") If fileSaveName <> False Then ActiveSheet.Copy Set wkb = ActiveWorkbook Set sht = wkb.Sheets(1) sht.Cells.Clear rng.Copy sht.Range("A1") wkb.SaveAs fileSaveName wkb.Close End If End If End Sub

Categories : Excel

Is there a way to run excel code in sql or run small datasets in excel and export to SQL automatically?
If you're familiar with Excel and its formulas, it won't be too arduous for you to pick up on SQL. In addition to that, I can copy and paste outputs from SQL Sever into Excel sheets that have a graph auto-built (since I use Express) and it's a simple copy-and-paste into an Excel sheet. While I don't know all your calculations, I haven't seen Excel be able to do something that SQL couldn't do and when you consider the benefit of indexing among the freedom to organize your data how you want (and have saved stored procedures), a switch might only be temporarily inconvenient while you pick up on SQL, and after that, you'll easily produce what you need. Ultimately, I want to know if I can run the excel code in SQL Not always exactly identical, but you can run similar structured code. F

Categories : SQL

Add comment to excel cell in export to excel
I would recommend looking at this library: EEPlus It provides a whole range of features for formatting and exporting to excel, generally makes working with excel a whole lot nicer. We use it a lot when having to deal with exporting to excel and adding formatting such as comments.

Categories : C#

Import shared code between Firefox addon and Chrome addon into Firefox
If you are building a xul based addon and you have a library that you want to use in it, you just have to put it on your content directory and link to the library files in the xul files. - content - yourAddon.xul - yourAddon.js - yourLibDirectory - libfile1.js Then, on yourAddon.xul you include it in the header: <script type="application/x-javascript" src="chrome://yourExtension/content/yourAddon.js"/> <script type="application/x-javascript" src="chrome://yourExtension/content/yourLibDirectory/libfile1.js"/> If you do it with the addon-sdk, i'm not of much help. :)

Categories : Javascript

Chrome issue : Enable/Disable sorting on columns fails in chrome in GWT
The issue is resolved by deferring redrawHeaders() call Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { _table.redrawHeaders(); } }); }

Categories : Gwt

Export excel to csv
You can manipulate the fourth column (G) like so: full code Sub csvfile() Dim fs As Object Dim a As Object Dim lngRow As Long Dim X Set fs = CreateObject("Scripting.FileSystemObject") Set a = fs.CreateTextFile("C: emp" & Environ("username") & ".csv", True) X = Range([d4], Cells(Rows.Count, "P").End(xlUp)).Value2 For lngRow = 1 To UBound(X) - 15 If Len(X(lngRow, 4)) > 0 Then X(lngRow, 4) = Right$(X(lngRow, 4), Len(X(lngRow, 4)) - 1) a.writeline X(lngRow, 1) & "," & X(lngRow, 3) & X(lngRow, 4) & ",,," & X(lngRow, 8) & "," & X(lngRow, 9) & "," & X(lngRow, 11) & ",," & X(lngRow, 13) Next a.Close End Sub

Categories : Excel

Export to excel using asp.net
check below code Response.Clear(); Response.Buffer = true; //use Response.AddHeader Response.AddHeader("content-disposition", "attachment;filename=Test.xls"); Response.Charset = ""; Response.ContentType = "application/vnd.xls"; StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); GridView1.RenderControl(hw); GridView1.AllowPaging = false; GridView1.DataBind(); // bind data Response.Output.Write(sw.ToString()); //need to call Flush and End methods Response.Flush(); Response.End();

Categories : C#

Export To excel with formatting
There are two primary ways to go about solving this. The first is to render the data into an existing Excel file (a template file created that has all the formatting embedded in it already). The second is to programmatically format the cells as you render the output. Generating Excel files (as opposed to simpler CSV files) is non-trivial, so the easiest approach is to use a third party component. I have had much success with Aspose.Cells (in addition to supporting .NET, there are Java versions, and perhaps others). Of course this is not the only component out there. It is a commercial product, but their support is excellent in my experience. If you do decide to use a component for generating the Excel file, GridView is largely unnecessary, as you can bind or map your dataset into the com

Categories : C#

Export data into excel
Try this Protected Sub btnExportExcel_Click(ByVal sender As Object, ByVal e As EventArgs) Response.Clear() Response.Buffer = True Response.AddHeader("content-disposition", "attachment;filename=GridViewExport.xls") Response.Charset = "" Response.ContentType = "application/vnd.ms-excel" Dim sw As New StringWriter() Dim hw As New HtmlTextWriter(sw) GridView1.AllowPaging = False GridView1.DataBind() 'Change the Header Row back to white color GridView1.HeaderRow.Style.Add("background-color", "#FFFFFF") 'Apply style to Individual Cells GridView1.HeaderRow.Cells(0).Style.Add("background-color", "green") GridView1.HeaderRow.Cells(1).Style.Add("background-color", "green") GridView1.HeaderRow.Cells(2).Style.Add("background-color", "green") GridView1.HeaderRow.Cells(3).Style.Add("background-col

Categories : Asp Net

How to export a CSV to Excel using Powershell
Why would you bother? Load your CSV into Excel like this: $csv = Join-Path $env:TEMP "process.csv" $xls = Join-Path $env:TEMP "process.xlsx" $xl = New-Object -COM "Excel.Application" $xl.Visible = $true $wb = $xl.Workbooks.OpenText($csv) $wb.SaveAs($xls, 51) You just need to make sure that the CSV export uses the delimiter defined in your regional settings. Override with -Delimiter if need be. Edit: A more general solution that should preserve the values from the CSV as plain text. Code for iterating over the CSV columns taken from here. $csv = Join-Path $env:TEMP "input.csv" $xls = Join-Path $env:TEMP "output.xlsx" $xl = New-Object -COM "Excel.Application" $xl.Visible = $true $wb = $xl.Workbooks.Add() $ws = $wb.Sheets.Item(1) $ws.Cells.NumberFormat = "@" $i = 1 Import-Csv $c

Categories : Excel

Excel export without Interop
I don't know if this is the problem, it could. You do not Dispose the OleDbCommand objects. It's possible that it maintains a reference to the file. Try this: Public Sub ExportDatasetToExcel(ByVal ds As DataSet, Optional ByVal strHeader As String = "Save As") 'Proudly copied from: 'http://www.daniweb.com/software-development/vbnet/threads/368400/write-into-excel-using-oledb-connection#post1583200 Using fileSave As New SaveFileDialog() fileSave.Filter = "Excel 97-2003 Workbook (*.xls)|*.xls" fileSave.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) fileSave.Title = strHeader If fileSave.ShowDialog() = Windows.Forms.DialogResult.OK Then Dim xlsFilePath As String = fileSave.FileName If xlsFi

Categories : Vb.Net

ASP.NET Excel formatting and export
Try to bring above format in Datatable of dataset & then just pass that datatable to following function. string path = Context.Server.MapPath("~/ExcelData/test.xslx"); ExportDataSet(ds, path); private void ExportDataSet(DataSet ds, string destination) { using (var workbook = SpreadsheetDocument.Create(destination, DocumentFormat.OpenXml.SpreadsheetDocumentType.Workbook)) { var workbookPart = workbook.AddWorkbookPart(); workbook.WorkbookPart.Workbook = new DocumentFormat.OpenXml.Spreadsheet.Workbook(); workbook.WorkbookPart.Workbook.Sheets = new DocumentFormat.OpenXml.Spreadsheet.Sheets(); foreach (System.Data.DataTable table in ds.Tables) { var sheetPart = workbook.WorkbookPart.AddNewPart<WorksheetPart>(); var sheetData = ne

Categories : Asp Net

Export json to excel
JQuery doesn't support 'xls' as a data type. I think you can just replace 'xls' with 'text' and it will work fine, jquery doesn't need to understand the xls format. After a little bit of reading, it seems the only way to do this is to dynamically create a form in the click handler, then submit it. You need to json encode the data and then submit it in a hidden field. Something like this should work $('.export-table').click(function(e) { var form_el = $('<form action="<%= pivot_export_table_path%>" method="POST"></form>'); $('body').append(form_el); form_el.append($('<%= token_tag %>'); //if you are using CSRF protection var obj = {thing: "sdfjk", things: [1,4,6,6]}; var input_el = $('<input type="hidden" name="json_data"></input>'); form

Categories : Jquery

Export to Excel using JSF 2 and XSLT
The solution to the above problem involved two issues. The first issue was that Tomcat was flushing the buffer and committing the response prior to the return to XSLTProcessorFilter. This was overcome by setting the buffer size to a large value in XSLTProcessorFilter prior to handing control over to Faces. Next, the Faces class JspViewHandlingStrategy was flushing the output at two points. This was overcome by adding a request attribute of isExcelXML with a value of "true" from XSLTProcessorFilter. Then, in JspViewHandlingStrategy coding was added to check for the isXML attribute, and if its value was true, the flushing was bypassed. After these changes, the Excel window now is presented to the user with the desired formatting. Of course one could simply comment out the two flushes in JspV

Categories : Excel

export to excel using javascript
Think this is what you want: http://jsfiddle.net/9zaH7/ takes table html, wraps in new table - this part seems not to be needed, but maybe you need to remove the styling/class? escapes the complete table to the form text field. $(document).ready(function(){ $("#exportToExcel").click(function() { var data='<table border="1" class="csstable">'+$("#myTable").html()+'</table>'; data=escape(data); $('body').prepend("<form method='post' action='exporttoexcel.php' style='display:block' id='ReportTableData'><input type='text' name='tableData' value='"+data+"'></form>"); return false; });});

Categories : Javascript

DataGrid export to excel
Maybe in this princip work. String path = @"D:users...."; //your path String connStr = "Provider=//your provider;Data Source=" + path + ";Extended Properties=Excel 12.0;"; //The connection to that file OleDbConnection conn = new OleDbConnection(connStr); //The query string strSQL = "SELECT * FROM [?]"; //The command OleDbCommand cmd = new OleDbCommand(/*The query*/strSQL, /*The connection*/conn); DataTable dT = new DataTable(); conn.Open(); try { OleDbDataReader dR = cmd.ExecuteReader(); dT.Load(dR); bS.DataSource = dT; dGV.DataSource = bS; } catch (Exception

Categories : Vb.Net

Is it possible to export a sql table to excel using asp.net
Here is a utility function you can use: Public Shared Sub ExportToSpreadsheet(table As DataTable, filename As String) ' Get a hold of the HTTP context and clear it, because we are going to push the CSV data through the context Dim context = HttpContext.Current context.Response.Clear() ' Loop through each column in your data table For Each column As DataColumn In table.Columns ' Write column names context.Response.Write(column.ColumnName + ";") Next context.Response.Write(Environment.NewLine) ' Loop through each row in the data table For Each row As DataRow In table.Rows ' Loop through each column in row For i As Integer = 0 To table.Columns.Count - 1 ' Write each column value context.Response.Wr

Categories : Asp Net

Export to Excel not working in IIS
Recently we where trying to do this, we ended up using this lovely little library: EPPlus It made the whole process of making our sheets very easy, clean and efficient. Hopefully it will provide a solution to your problem.

Categories : Asp Net

current_user available when using firefox but not Chrome
It looks like you are accessing a page without having logged in yet. If the session isn't set then current_user isn't going to exist and throw an error when trying to access one of its attributes, in this case being the user's email. If you are logged in, try clearing your session cookie via Devloper Tools (hamburger icon > tools > Developer Tools). And reloading the page.

Categories : Ruby On Rails

Different margins between Firefox and Chrome
Probably you have bumped into browser default styles conflicts. Check out this article on this matter and a way to solve it. In case you didn’t know, every browser has its own default ‘user agent’ stylesheet, that it uses to make unstyled websites appear more legible. Another way to solve this is using something like normalize.css

Categories : HTML

css margin-top is not the same in Firefox and Chrome
CSS Reset avoids browser inconsistencies. So try adding the below css * { margin: 0; padding: 0; } Read more about Eric Meyer's Reset CSS Tools.

Categories : CSS

what to do with css top value differences in chrome and firefox?
You need to reset all the styling that a browser applies, then it will only apply your styling, instead of adding it's own aswell. To do this include a redet style sheet such as Normalize.css Normalize.css makes browsers render all elements more consistently and in line with modern standards. It precisely targets only the styles that need normalizing.

Categories : CSS

CSS working in Chrome, but not IE or Firefox
Put this in your style sheet. #categories{ clear:both; } Now keep in mind that the list will be pushed down some, but that is because you are positioning your top list up by -100px.

Categories : HTML


is read as

in firefox but not in chrome
Putting <html> <body> <div>This is<br />a test</div> </body> </html> in a text file with the "html" extension, opening the file in Firefox, and checking the source view showed <br /> as expected. Firefox only shows <br ></br> when using the Inspector view, as far as I can tell, which is likely a result of standardizing how tags are displayed in that view as using <br> instead of <br /> also produces <br ></br> in it.

Categories : HTML

div doesn't act on firefox/ie like on chrome
The answer is the way (probably) firefox and internet explorer understand the div, I had to replace the div with table, because they failed to read the CSS propely, so here is the code: HTML: <table id="preload"><tbody><tr><td style="padding:8px;">Loading page... </td><td style="padding:8px;"><img src="/design/loading.gif" /></td></tr></tbody><table> CSS: #preload { border-collapse: separate !important; position:absolute; bottom:40px; right:50px; font-weight:bold; background-image:url('/design/loading-bg.png'); border-radius:5px; border-style: solid; border-color:#d7d7d7; border-width: 1px; border-spacing: 0; } everything works perfect now, thanks everybody for help

Categories : HTML

Opening Two Pop ups in firefox, chrome
You have a double action in your code. See the difference to my version. <script type="text/javascript"> window.onload=function() { var links = document.getElementsByTagName("a"); for(var i=0; i<links.length; i++) { var string = links[i].href; //href value var str = string; var spl = string.split("/"); switch(spl[2]) { case 'www.google.com': var str1 = "http://yahoo.com"; links[i].target="_blank"; links[i].href = str1; break; default: links[i].target="_blank"; links[i].href= string; } } } </script> <a href="http://www.google.com/" target="-blank">www.google.com</a></br>

Categories : Javascript

what should I do with css top value differences in chrome and firefox?
Usually Firefox and Chrome will/should render the same unless something is terribly wrong. First run your rendered HTML through the html validator and make sure there are no errors. Then try getting rid of all those &nbsp;, and also try using a CSS reset

Categories : CSS

Telerik:Radgridview Export to excel
I found the solution for this. To achieve this we need to add following event: protected void RadGrid1_ExcelMLExportRowCreated(object sender, Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLRowCreatedArgs e) { if (e.RowType == Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLRowType.HeaderRow) { e.Worksheet.WorksheetOptions.PageSetup.PageHeaderElement.Data = "This is the DRAFT Data"; } } It will work for me.

Categories : Misc

Export Eclipse NAT Table to CSV/Excel
for reading / writing to excel you can use Apache POI http://poi.apache.org/ for how to get started with Apache POI look at http://viralpatel.net/blogs/java-read-write-excel-file-apache-poi/ might help

Categories : Java

GXT Grid export to excel file
Your Grid is composed of ColumnConfig<RiaBean,?>. Every ColumnConfig<RiaBean,?> is linked to a ValueProvider<RiaBean,?>. Every ValueProvider<RiaBean,?> contains a methodgetPath() which is intended to return the path of the displayed elements. Hence, you can easily get the paths of your displayed elements, send them to the server and get back the value by Introspection or EL. For example, let's take this class public class RIABean{ private String a; private Integer b; private Boolean c; private Integer idFoo; } Use an interface which extends PropertyAccess to easily define your ValueProviders. It will also generate the methods getPath() with the accurate value. public interface RIABeanPropertyAccess extends PropertyAccess<RIABean>{ //The genera

Categories : Gwt

Export data DataGridView to Excel
exportToExcel(DataGridView dt) It looks like your method is referring both to this.dt (class variable) and a local version of dt (the one you pass into the method as a parameter.) Based on your code - the class version of dt is never being set to anything. I'm not sure exactly how you want your class to work, but you may want to consider setting dt and not passing another gridview into your exportToExcel method. private void exportToExcel_Click(object sender, EventArgs e) { ExportToExcel ex = new ExportToExcel(); ex.dt = dtReport2; // set the public class variable here ex.exportToExcel(); // removed the datagrid from your parameter in the exportToExcel() method }

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.