xls

Java save xls file as PDF

早过忘川 提交于 2020-01-17 02:54:05
问题 I have a simple java program that creates .xls file (open office excel file), and I want to save it as pdf. I saw some answers here but none of them worked for me. Is there a simple and free way to do so? The file contains only 1 page of .xls Thanks 回答1: Not sure, please provide more details , share code so that the answer can be more precise, but for code perspective it can be achieved via Apache POI.something like below .... //Instantiate a new workbook with excel file path Workbook

DataReader does not see data in Excel cell if previous cell in the column are empty

不打扰是莪最后的温柔 提交于 2020-01-16 10:15:45
问题 I have a weird problem with reading .xls file using OleDbDataReader . Basically, it does not see a data in the cell, if the previous cells in the column are empty. If I move the row with the data at the top of Excel sheet, then everything loads fine. I'm not sure, but I think that it has something to do with the amount of empty cells before the one with data. Any help or advice will be much appreciated. 回答1: You probably have a connectionstring like this: <add name="MyApp.Properties.Settings

IE6 opening XLSX file as an XLS file

帅比萌擦擦* 提交于 2020-01-15 12:07:00
问题 My application generates XLSX files based on a users requirements. After the XLSX file is generated the user is redirected to where the file is saved using Response.Redirect... Response.Redirect("filename.xlsx") When the user then opens the file... they recieve this message. The file you are trying to open, 'filename.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to

IE6 opening XLSX file as an XLS file

大兔子大兔子 提交于 2020-01-15 12:06:09
问题 My application generates XLSX files based on a users requirements. After the XLSX file is generated the user is redirected to where the file is saved using Response.Redirect... Response.Redirect("filename.xlsx") When the user then opens the file... they recieve this message. The file you are trying to open, 'filename.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to

PHP generated Excel file is different when downloaded

。_饼干妹妹 提交于 2020-01-14 14:13:25
问题 I have a PHP file that generates xls files using the module found at http://pear.php.net/package/Spreadsheet_Excel_Writer/ I can create the sample document just fine and when I open it, it looks fine. My next step it to turn it into a downloadable link. To do that, I did this: $mimeType = "application/vnd.ms-excel"; $file_name = "test.xls"; $file_path = "/tmp/".$file_name; header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

PHP generated Excel file is different when downloaded

感情迁移 提交于 2020-01-14 14:09:02
问题 I have a PHP file that generates xls files using the module found at http://pear.php.net/package/Spreadsheet_Excel_Writer/ I can create the sample document just fine and when I open it, it looks fine. My next step it to turn it into a downloadable link. To do that, I did this: $mimeType = "application/vnd.ms-excel"; $file_name = "test.xls"; $file_path = "/tmp/".$file_name; header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

Apache POI setPrintArea to A4 page size

て烟熏妆下的殇ゞ 提交于 2020-01-14 10:33:17
问题 I'm working with the Apache POI API to generate .xls files, and I want to set the printArea of my file. I know there is a funcion called setPrintArea() but this one receive as parameters start and end row and column of my print area. I want to know, if there is a way to set my print area for each sheet with the size of an A4 paper (210mmx290mm) Thanks. 回答1: For each Sheet in the workbook, get its PrintSetup object and call setPaperSize on it, passing the appropriate PrintSetup constant: A4

.xls convert to xlsx using java and POI APACHE

倖福魔咒の 提交于 2020-01-12 09:39:04
问题 I'm trying to use POI.APACHE to edit excel files in java. I have to convert a .xls to .xlsx because I need to send the file to sharepoint. Thats why it just can't be renamed with a different extension. How would I go about this? I couldn't find any examples on their site. Thanks 回答1: import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io

ASP.NET MVC returning an xls file inside an zip file

空扰寡人 提交于 2020-01-07 07:50:29
问题 I have an asp.net mvc action that returns an xls file: public void Excel(string filename) { DAOSolicitacao dao = new DAOSolicitacao(); System.Threading.Thread.Sleep(5000); var products = dao.GetSolicitacoes(); var grid = new GridView(); grid.DataSource = products; grid.DataBind(); Response.ClearContent(); Response.Buffer = true; Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", filename)); Response.ContentType = "application/ms-excel"; Response.Charset = "";

Open a file name +date as csv in Python [closed]

自闭症网瘾萝莉.ら 提交于 2020-01-07 06:24:36
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I want to be able to open a file name automatically and save it as a .csv, the files I produce are always called the same thing + todays date. For example todays spreadsheet could be called: "TODAYS SHEET" +