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

Display rtf or pdf

3 Answers 99 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 17 Jun 2013, 03:56 PM
ActiveReports has this option to display report:
pdfReport.Options.DisplayMode = DataDynamics.ActiveReports.Export.Pdf.DisplayMode.FullScreen;

Does telerik reporting have a similar option?  I can not seem to locate it .  So far I have tried the following:
Telerik.Reporting.Report Telrpt = new TelRptContract();
                    Telerik.Reporting.Processing.ReportProcessor TelContractrp = new Telerik.Reporting.Processing.ReportProcessor();
                    System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
                    Telerik.Reporting.InstanceReportSource TelContractirs = new Telerik.Reporting.InstanceReportSource();
                    TelContractirs.ReportDocument = Telrpt;
                    Telerik.Reporting.Processing.RenderingResult result = TelContractrp.RenderReport("PDF", TelContractirs, deviceInfo);
                    string dContract = DateTime.Now.ToString().Replace("/", "");
                    dContract = dContract.Substring(0, 9);
                    string fileName2 = result.DocumentName + "_" + dContract + "." + result.Extension;
                    //string path2 = "c:\\Users\\akinw\\Desktop\\";
                    //string path2 = System.IO.Path.GetTempPath();
                    string path2 = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
                    string filePath2 = System.IO.Path.Combine(path2, fileName2);
                    FileStream fs = new FileStream(filePath2, FileMode.Create);
                    fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
                    fs.Close();
                    //fs = File.Open(filePath2, FileMode.Open);                   
                    System.IO.File.Open(filePath2, FileMode.Open);

The commented out part is an option I have tried.  The report converts and is saved to my desktop but does not open. What is missing?  Thanks in advance.

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 17 Jun 2013, 04:19 PM
Hi William,

You have to use the PDF JavaScript device setting. For more information check out the JavaScriptâ„¢ for Acrobat® API Reference.

Telerik.Reporting.Report Telrpt = new TelRptContract();
                    Telerik.Reporting.Processing.ReportProcessor TelContractrp = new Telerik.Reporting.Processing.ReportProcessor();
                    Telerik.Reporting.InstanceReportSource TelContractirs = new Telerik.Reporting.InstanceReportSource();
                    TelContractirs.ReportDocument = Telrpt;
 
                    System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
                    deviceInfo["JavaScript"] = "app.fs.isFullScreen = true;";
 
                    Telerik.Reporting.Processing.RenderingResult result = TelContractrp.RenderReport("PDF", TelContractirs, deviceInfo);
                    string dContract = DateTime.Now.ToString().Replace("/", "");
                    dContract = dContract.Substring(0, 9);
                    string fileName2 = result.DocumentName + "_" + dContract + "." + result.Extension;
                    //string path2 = "c:\\Users\\akinw\\Desktop\\";
                    //string path2 = System.IO.Path.GetTempPath();
                    string path2 = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
                    string filePath2 = System.IO.Path.Combine(path2, fileName2);
                    FileStream fs = new FileStream(filePath2, FileMode.Create);
                    fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
                    fs.Close();
                    //fs = File.Open(filePath2, FileMode.Open);                  
                    System.IO.File.Open(filePath2, FileMode.Open);

Regards,
Peter
Telerik

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

0
William
Top achievements
Rank 1
answered on 17 Jun 2013, 04:43 PM
this is using a winform not web based.  Do I still need to use javascript api in that case?
0
Peter
Telerik team
answered on 18 Jun 2013, 07:12 AM
Hi William,

This is a PDF JavaScript that is interpret by the PDF viewer you can render PDF in any application with PDF JavaScript.

Regards,
Peter
Telerik

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

Tags
General Discussions
Asked by
William
Top achievements
Rank 1
Answers by
Peter
Telerik team
William
Top achievements
Rank 1
Share this question
or