Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Wed May 20, 2020 3:57 am

hi,
I want to bind the byte array excel table in word document based on a bookmark.
can you plz share the link for reference.

Thanks
Tamilselvan S

Tamil6593
 
Posts: 3
Joined: Mon May 11, 2020 3:54 am

Wed May 20, 2020 7:31 am

Hi Tamilselvan,

Thanks for your inquiry.
Our Spire.Doc supports inserting OLE object in word document. You can first convert the byte array to Excel file, then embed the Excel file into the Word file by inserting the ole object. Please download the latest Spire.Office Platinum Version:5.4.2 for testing.
Code: Select all
    //If your byte array data is an Excel file
    public void ByteToExcel1(byte[] byteArray, string outputPath)
    {
        MemoryStream ms = new MemoryStream(byteArray);
        Workbook wb = new Workbook();
        wb.LoadFromStream(ms);
        wb.SaveToFile(outputPath, ExcelVersion.Version2013);
    }

    //If it is just some data in the form of byte array
    public void ByteToExcel2(byte[] byteArray, string outputPath)
    {
        Workbook workbook = new Workbook();
        Worksheet sheet = workbook.Worksheets[0];
        //Insert the data in worksheet
        sheet.InsertArray<byte>(byteArray, 1, 1, true);
        workbook.SaveToFile(outputPath, ExcelVersion.Version2013);
    }


If this is not what you want, to help us better understand your requirement, please provide your input files as well as the output file you expect, so that we could provide you with the corresponding solution.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon Jun 08, 2020 10:56 am

Hello,

Hope you are doing well.
Did my code help you? Any feedback would be greatly appreciated!

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.Doc

cron