Thank you for your quick response.
One more question. I tried to attach barcode images via excel template using image smart tags. Simplified code below (lines missing, so it’s so short as possible). Just to give the idea, how I’d like to use barcodes. Excel template contains several image smart tags, named table0.barcode1, etc. At this moment only results were text “memorystream” or “…tem.byte” instead of barcode images.
//Instantiate Excel class that represents an excel file
Workbook excel1 = new Workbook();
//Add the barcode image into the pictures collection of the first worksheet of
//the excel file in the form of a MemoryStream, ms with upper left row=5 and
//upper left column=5
excel1.Worksheets.Pictures.Add(5, 5, ms);
//Save the excel file
I have tested both ‘object’ and ‘byte array’ already. Both gave same results, only text shows in document, if I used “wd.SetDataSource(“table” + sheet.Index.ToString(), sheetData);”.
doc = new Document(@“C:\Temp\Template.docx”);
private static DataTable GetDataTable()
DataTable dataTable = new DataTable("report");
dataTable.Columns.Add(new DataColumn("bc1", typeof(string)));
dataTable.Columns.Add(new DataColumn("bc2", typeof(string)));
dataTable.Columns.Add(new DataColumn("bc3", typeof(string)));
dataTable.Columns.Add(new DataColumn("bc4", typeof(string)));
for (int i = 0; i < 10; i++)
dataRow = dataTable.NewRow();
dataRow["bc1"] = @"C:\Temp\Aspose logo.png";
dataRow["bc2"] = @"C:\Temp\Aspose logo.png";
dataRow["bc3"] = @"C:\Temp\Aspose logo.png";
dataRow["bc4"] = @"C:\Temp\Aspose logo.png";
Thanks for your answers. I got this work other way. I have now document created by excel template with smart markers, where is several information with many barcodes.
You can forget question above. We decided to change barcode type, so the above problem is not relevant any more. We have everything clear now. Thanks for your quick answers