Hi,
Thank you for your quick response.
Hi Mloy,
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[0].Pictures.Add(5, 5, ms);//Save the excel file
excel1.Save(“MyFile.xls”);
Hi,
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);”.
Hi,
Hi,
doc = new Document(@“C:\Temp\Template.docx”);
doc.MailMerge.ExecuteWithRegions(GetDataTable());
doc.Save(@"C:\Temp\out.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)));
DataRow dataRow;
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";
dataTable.Rows.Add(dataRow);
}
return dataTable;
}
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
Hi,