标签: excellibrary

无法打开使用excelLibrary生成的excel文件

我正在使用excelLibrary以编程方式创建excel文件,但是当我尝试在Microsoft Office Excel中打开生成的文件时出现文件格式错误.

我已经看到这已被报道,但仍然没有答案.

我使用Office 2010,我可以打开任何其他.xls(97-2003文件格式),但使用excelLibrary生成.我也尝试过Open Office,但仍无法打开生成的文件.我没有尝试在Office 97-2003中打开它们.

只需尝试示例代码即可重现错误.

有没有人找到如何使用该库而不是遇到这个问题?

c# excel excellibrary

15
推荐指数
2
解决办法
1万
查看次数

将XLS(Excel)文件附加到电子邮件

我的应用程序使用intent方法向用户发送电子邮件,这是导出Excel电子表格数据(由JExcell API创建)的便捷方式.

该文件包含在名为records的文件夹中的SD卡上.

我试图发送的文件是call measurments.xls.

我已经在代码中测试了在发送之前是否存在该文件.电子邮件编辑器显示附件,但是当我发送然后接收电子邮件时,附件不存在.

但是,如果我将excel文件替换为png图像,则会收到附件.那是什么给了??

下面是我用来发送电子邮件的代码,它只是一个类中的一个短暂的静态方法.

    public static  void sendEmailWithAttachment(Context ctx, String to,String subject, String message, String fileAndLocation)
    {
        Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); 
        emailIntent.setType("text/plain");
        emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] {to}); 

        emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,  subject); 
        emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,  message); 


          File file = new File(fileAndLocation);
         //  File file = getFileStreamPath();
           if (file.exists())
           {
               Log.v("Farmgraze", "Email file_exists!" );
           }
           else
           {
               Log.v("Farmgraze", "Email file does not exist!" );
           }


        Log.v("FarmGraze", "SEND EMAIL FileUri=" + Uri.parse("file:/"+ fileAndLocation));
        emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:/"+  fileAndLocation));

        ctx.startActivity(Intent.createChooser(emailIntent, …
Run Code Online (Sandbox Code Playgroud)

email android attachment excellibrary

3
推荐指数
1
解决办法
4638
查看次数

如何使用Excellibrary将数据集添加到工作表

我必须在单个文件中添加多个工作表。我找不到将数据集添加到工作表的任何方法,但是我知道如何添加工作表

asp.net excellibrary

2
推荐指数
1
解决办法
7155
查看次数

如何在vb.net中使用MVC 4中的控制器创建和返回Excel文件?

我在这里使用ExcelLibrary 输入链接描述,因为我不想安装Microsoft Office Excel(microsoft.interop.office.excel)

 Public Function ObtenerExcel() As ActionResult
      Dim workbook As New Workbook()
      Dim worksheet As New Worksheet("Sheet1")
      worksheet.Cells(5, 5) = New Cell(999999)
      worksheet.Cells(10, 10) = New Cell(12354)
      workbook.Worksheets.Add(worksheet)

      Dim stream As New System.IO.MemoryStream
      workbook.SaveToStream(stream)
      stream.Position = 0

      Dim buffer(4096) As Byte
      stream.Read(buffer, 0, buffer.Length)

      Return File(buffer, "application/vnd.ms-excel", "mytestfile.xls")
    End Function
Run Code Online (Sandbox Code Playgroud)

此代码返回一个excel文件,但是当我尝试打开此文件时,它显示一条错误消息(Excel在'text.xls'中找到了不可读的内容.您要恢复此工作簿的内容吗?如果您信任该来源的这个工作簿,单击是.)并没有显示任何内容.

我在Windows 8.1(64位)和Microsoft Office 2013上工作

vb.net excel asp.net-mvc-4 excellibrary

2
推荐指数
1
解决办法
8593
查看次数

标签 统计

excellibrary ×4

excel ×2

android ×1

asp.net ×1

asp.net-mvc-4 ×1

attachment ×1

c# ×1

email ×1

vb.net ×1