We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Save report as pdf file on IIS error

Thread ID:

Created:

Updated:

Platform:

Replies:

121119 Nov 10,2015 04:02 AM Nov 12,2015 04:55 AM WPF 1
loading
Tags: ReportViewer
Martin
Asked On November 10, 2015 04:02 AM

Hi,
When I use this code in VS in debug all works fine, but when I publish on IIS, don't generate PDF file, create but not populate with data and when try to open get error that file is corrupted.
Please help me, if have any suggestions...
var response = new HttpResponseMessage ();

var dataSources = new ReportDataSourceCollection ();


if (jsonResult.generalDataSet != null)
{
dataSources.Add (new ReportDataSource { Name = jsonResult.generalDataSet.name, Value = jsonResult.generalDataSet.value });
}

if (jsonResult.recordDataSet != null)
{
dataSources.Add (new ReportDataSource { Name = jsonResult.recordDataSet.name, Value = jsonResult.recordDataSet.value });
}


ReportWriter reportWriter = new ReportWriter (System.Web.HttpContext.Current.Server.MapPath ("~/Reports/ProAurum.rdlc"), dataSources);

MemoryStream stream = new MemoryStream ();

reportWriter.Save (System.Web.HttpContext.Current.Server.MapPath ("~/Reports/test.pdf"), WriterFormat.PDF);


Thanks!

Martin


Soundara Rajan S [Syncfusion]
Replied On November 12, 2015 04:55 AM

Hi Martin,

Thanks for contacting Syncfusion support.

We are unable to reproduce the mentioned issue and it’s working fine with our IIS server. We have prepared a runnable sample based on this and it can be downloaded from below location,
http://www.syncfusion.com/downloads/support/forum/121119/ze/ReportExportDemo898444123.zip

For your reference, we have deployed the above sample in our live server and please find the hosted sample link below,
http://ssrs.syncfusion.com/ReportExport

If the issue still persist, please share the reproducible sample with us to validate the issue?.

Regards,
Soundara Rajan S.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;