// Create instance of ReportConverter
IReportConverter reportConverter = new ReportConverter();
/*
* PDF
* Create bytes of PDF.
*/
byte[] PDF = reportConverter.toByte(
reportFilePath: @"D:\test.rdl",
fileExtension: ReportExtension.PDF,
paramValues: new Dictionary<string, string> { { "id", "4" } }
);
// Create file from bytes.
File.WriteAllBytes("D:\\test\\test.pdf", PDF);
/*
* Excel
* Create bytes of Excel.
*/
byte[] Excel = reportConverter.toByte(
reportFilePath: @"D:\test.rdl",
fileExtension: ReportExtension.Excel,
paramValues: new Dictionary<string, string> { { "id", "4" } }
);
// Create file from bytes.
File.WriteAllBytes("D:\\test\\test.xls", Excel);
/*
* Word
* Create bytes of Word.
*/
byte[] Word = reportConverter.toByte(
reportFilePath: @"D:\test.rdl",
fileExtension: ReportExtension.Word,
paramValues: new Dictionary<string, string> { { "id", "4" } }
);
// Create file from bytes.
File.WriteAllBytes("D:\\test\\test.doc", Word);
/*
* Image
* Create bytes of Image.
*/
byte[] Image = reportConverter.toByte(
reportFilePath: @"D:\test.rdl",
fileExtension: ReportExtension.Image,
paramValues: new Dictionary<string, string> { { "id", "4" } }
);
// Create file from bytes.
File.WriteAllBytes("D:\\test\\test.jpg", Image);