Вставить картинку в XML, а потом PDF файл - C#
Формулировка задачи:
Задача - вставить на страницы PDF отчета картинку(лого фирмы). PDF создаю экспортом из XML с помощью ReportViewer. Мой XML - это, собственно, 1 таблица, создаваемая динамически. Возможно ли(и как) в готовый XML положить картинку(и, главное, как?) Спасибо!
Решение задачи: «Вставить картинку в XML, а потом PDF файл»
textual
Листинг программы
private void ShowReport()
{
try
{
this.reportViewer1.Reset();
Rectangle rr = new Rectangle(10, 10, 500, 500);
Image img = Image.FromFile(@"d:\logo.bmp");
Bitmap bb = new Bitmap(img, new Size(100, 100));
this.reportViewer1.DrawToBitmap(bb, rr);
this.reportViewer1.LocalReport.EnableExternalImages = true;
this.reportViewer1.BackgroundImage = img;
this.reportViewer1.BackgroundImageLayout = ImageLayout.Tile;
this.reportViewer1.LocalReport.LoadReportDefinition(m_rdl);//динамические столбцы, строки и т.д
this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("MyData", m_dataSet.Tables[0])); //собственно моя таблица с данными
this.reportViewer1.RefreshReport();
}
catch(Exception e)
{
Console.WriteLine(e.Message);
}
}