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,
Thanks for your inquiry and sorry for the delayed response. I am a representative of the Aspose.Words team.
I would like to inform you that with the Mail Merge feature of Aspose.Words, you can easily generate a look-alike Word document report. I have attached a template Word document and the final report document here for your reference. I used the following code to generate the out.docx
:
Document 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;
}
I would also like to suggest you please read the following articles to learn more about Aspose.Words’ full-fledged reporting feature:
Please let me know if I can be of any further assistance.
Best regards,
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,