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

Free Support Forum - aspose.com

Aspose word - render reports programmaticaly - exception

Hi,


I am trying to use Aspose.Word to render SSRS report to html in WPF(.net 4.0) in local mode. I followed your guide from link http://www.aspose.com/docs/display/wordsreportingservices/Rendering+Reports+Programmatically. However, I met exception Unable to cast object of type ‘Aspose.Words.ReportingServices.MhtmlRenderer’ to type ‘Microsoft.ReportingServices.OnDemandReportRendering.IRenderingExtension’. But I can render from report viewer toolbar.

Could you please support me to solve it?

Besides, can I render directly report to html without reportviewer? and where to configure Aspose word for reporting service?

Thanks,

Phuong

Hi Phuong,


Thanks for your inquiry. Yes, you can export RDL file into HTML without using Report Viewer. If you have a Report Server running with Aspose.Words for Reporting Services installed on it, you can render reports to Microsoft Word documents using the Reporting Service Web Service. Please read the section ‘Rendering via Reporting Services Web Service’ from here:
http://www.aspose.com/docs/display/wordsreportingservices/Rendering+Reports+Programmatically

Regarding mhtml issue, could you please attach your WPF along with RDL file here for testing? Are you facing this issue only with mhtml or all other export file format e.g Doc/Docx/HTML ?

Please use select statement (to populate the data) inside your RDL as shown in following DataSet example. I will investigate the issue on my side and provide you more information.


<DataSets><o:p></o:p>

<DataSet Name=DataSet1><o:p></o:p>

<Query><o:p></o:p>

<DataSourceName>DataSource1</DataSourceName><o:p></o:p>

<CommandText>select 1 as value, ‘label1’ as label<o:p></o:p>

union all<o:p></o:p>

select 2 as value, ‘label2’ as label<o:p></o:p>

union all<o:p></o:p>

select 3 as value, ‘label3’ as label<o:p></o:p>

union all<o:p></o:p>

select 4 as value, ‘label4’ as label<o:p></o:p>

</CommandText><o:p></o:p>

</Query><o:p></o:p>

<Fields><o:p></o:p>

<Field Name=value><o:p></o:p>

<DataField>value</DataField><o:p></o:p>

<rd:TypeName>System.Int32</rd:TypeName><o:p></o:p>

</Field><o:p></o:p>

<Field Name=label><o:p></o:p>

<DataField>label</DataField><o:p></o:p>

<rd:TypeName>System.String</rd:TypeName><o:p></o:p>

</Field><o:p></o:p>

</Fields><o:p></o:p>

</DataSet><o:p></o:p>

</DataSets>



Thanks your reply.


We cannot use report server. We must use SSRS with local mode and currently I am facing this issue when we call method render to any type. However, I can export from toolbar of report viewer.

Besides, to send mail with images, which output type can we do html or mhtml?

Thanks,

Phuong

Hi Phuong,


Thanks for sharing the detail. I am working over your query and will update you asap.

Hi Phuong,


Thanks for your patience. I have logged this issue as WORDSRPT-138 in our issue tracking system. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSRPT-138) have been fixed in this Aspose.Words for Reporting Services update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.