We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Word with LocalReport only (.Net)

Hi,

We are in the process of evaluating .Net Aspose.Word but would like to know if it is possible to render a word document from a LocalReport (RDLC) without having to instantiate a ReportViewer object or call the ReportingServices service?

We utilise the built-in Microsoft PDF rendering at present with the following code:

report.Render(“PDF”, null, out mimeType, out encoding, out extension, out streamids, out warnings);

Ideally we would simply call the AddExtension method on the LocalReport before this line of code, rather than create a ReportViewer object and call AddExtension on that just to render a Word document.

Thanks in advance

T

Hi

Thanks for your request. You can use the same technique as described here, but without ReportViewer:

http://www.aspose.com/documentation/ssrs-rendering-extensions/aspose.words-for-reporting-services/integrate-with-microsoft-report-viewer-in-local-mode.html

In this code, ReportViewer is needed onto to get the LocalReport, so you can add extension directly to your LocalReport. After this you can use code like the following to render your report:

string extension;

string mimeType;

string encoding;

Warning[] warnings;

string[] streamIds;

byte[] reportBytes = myLocalReport.Render(

"AWDOCX",

GetDeviceInfoString(layoutType),

out mimeType,

out encoding,

out extension,

out streamIds,

out warnings);

Hope this helps.

Best regards,

Worked a treat! Thanks for your help