Conver excel to bytes

Last post 03-28-2012, 7:15 AM by Amjad Sahi. 7 replies.
Sort Posts: Previous Next
  •  12-30-2011, 12:09 AM 352159

    Conver excel to bytes

    i need to store a excel file into database as bytes
    This message was posted using Banckle Live Chat 2 Forum
     
  •  12-30-2011, 12:24 AM 352161 in reply to 352159

    Re: Conver excel to bytes

    Hi,

    Please see the following code, it illustrates how to save the workbook object into byte array.

    C#
    string filePath = @"F:\Shak-Data-RW\Downloads\source.xlsx";

    Workbook workbook = new Workbook(filePath);

    //Save the workbook in memory stream
    MemoryStream ms = new MemoryStream();
    workbook.Save(ms, SaveFormat.Xlsx);

    //Read bytes from memory stream
    byte[] bytes = new byte[ms.Length];
    ms.Read(bytes, 0, bytes.Length);


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
  •  02-09-2012, 4:53 AM 360353 in reply to 352161

    Mail Merge Replacement in Excel .NET

    HI

    I need a similar like mail merge option in Excel.In word we can use Mailmerge option to replace variables with values.similary in Excel Instead of PutValue() any option like mailmerge

     

    Regards

    Ajeesh

     
  •  02-09-2012, 4:55 AM 360354 in reply to 360353

    Re: Mail Merge Replacement in Excel

    Hi,

    Thanks for your posting and using Aspose.Cells for .NET.

    Please go through the following article and see if it is what you are looking for.
    Smart Markers

    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
  •  02-09-2012, 7:47 AM 360396 in reply to 360354

    Re: Mail Merge Replacement in Excel .NET

    hi

    Thanks for giving the Smart Makers topic and it use full and i have another question is,how to format the cell like Percentage,Numeric.I should display only Percentage values or Numeric values in som cells so how to format the Template file accordingly

    Regards

    Ajeesh

     
  •  02-10-2012, 2:33 PM 360826 in reply to 360396

    Re: Mail Merge Replacement in Excel

    Hi,

    I think, that's possible directly in smart markers.

    However, I need to confirm and find it out. However, what you can do is that once your data has been inserted in your worksheet, then you can format them using Aspose.Cells APIs.

    For  data formatting, see the documents in the section:


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
  •  03-28-2012, 6:51 AM 371494 in reply to 360826

    Re: Mail Merge Replacement in Excel .NET

    hi can you tell how to format excel directly using smart markers, that is i have template and in that template i have made format to each cell,according to that format my data should display like percentage,numeric and i don't want to do any coding.Everything i need to do in template
     
  •  03-28-2012, 7:15 AM 371506 in reply to 371494

    Re: Mail Merge Replacement in Excel

    Hi,

    Well, you may format the cell(s) which contains Smart Marker(s) in the template file. E.g you have a smart marker in a cell i.e. &=DataSource.FieldName  Now right click on the cell in MS Excel and click "Format Cells...", now you can format the cell accordingly.

    Thank you.

    Amjad Sahi
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
View as RSS news feed in XML