This is a migrated thread and some comments may be shown as answers.

How to export reportbook to one pdf file?

4 Answers 258 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Maggie
Top achievements
Rank 1
Maggie asked on 30 Mar 2012, 07:07 PM
I have a problem to export reportbook to a pdf file. When I use report viewer to review the reportbook, I can see the 2 reports. But when I tried to open them with adobe reader, I got an error.

4 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 30 Mar 2012, 07:30 PM
Hello Maggie,

The provided information is insufficient for us to determine what might be the problem. Please provide us with the full error you get and elaborate when do you get this error - upon export from the report viewer or in the Acrobat Reader program? Are you able to successfully export the report book to other supported formats such as TIFF, XPS or Word?

Regards,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
0
Maggie
Top achievements
Rank 1
answered on 30 Mar 2012, 07:38 PM
I got the error :

An error has occurred while processing the report. Processing canceled. Check the InnerException for more information.

When I use reportviewer, I can see the reports and export the reports to pdf successfully. The problem is when I tried to open them from a webform with Acrobat Reader program. I got this error.

here is my code:

private

 

 

void ExportToPDF(Telerik.Reporting.Report reportToExport)

 

{

 

 

ReportBook reportBook = new ReportBook();

 

reportBook.Reports.Add(reportToExport);

 

 

var ReportID = Convert.ToInt64(hidReportId.Value.ToString());

 

 

 

if (CheckAddendum(ReportID))

 

{

 

 

 

var addendumReport = new Report.ReportAddendum();

 

reportBook.Reports.Add(addendumReport);

}

 

 

var deviceInfo = new System.Collections.Hashtable();

 

 

 

ReportProcessor reportProcessor = new ReportProcessor();

 

 

 

 

RenderingResult result = reportProcessor.RenderReport("PDF", reportBook, deviceInfo);

 

 

 

string fileName = result.DocumentName + ".pdf";

 

Response.Clear();

Response.ContentType = result.MimeType;

Response.Cache.SetCacheability(

 

HttpCacheability.Private);

 

Response.Expires = -1;

Response.Buffer =

 

true;

 

Response.AddHeader(

 

"Content-Disposition",

 

 

 

string.Format("{0};FileName=\"{1}\"",

 

 

 

"attachment",

 

fileName));

Response.BinaryWrite(result.DocumentBytes);

Response.End();

 

 

}
Thanks.

0
Maggie
Top achievements
Rank 1
answered on 30 Mar 2012, 09:09 PM
Can someone help me out?

Thank you so much!
0
Steve
Telerik team
answered on 02 Apr 2012, 09:37 AM
Hello Maggie,

The code you've provided looks correct and we cannot guess just by it what is causing the problem. Posting the InnerException which is the actual exception would definitely help us pinpoint the problem. You can also open a support ticket and attach a runnable project that exhibits the problem with steps to reproduce.

Kind regards,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
Tags
General Discussions
Asked by
Maggie
Top achievements
Rank 1
Answers by
Steve
Telerik team
Maggie
Top achievements
Rank 1
Share this question
or