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

export to docx

1 Answer 111 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 01 Jul 2013, 06:51 PM
I have created a telerik report useing textboxes and a subreport.  When I export it to a docx all the controls are exported to the docx.  I would like the text only to come over when exported.  Following is the code i use to export:

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 = currRpt;
            Telerik.Reporting.Processing.RenderingResult result = TelContractrp.RenderReport("DOCX", TelContractirs, deviceInfo);
            string dContract = DateTime.Now.ToString().Replace("/", "");
            dContract = dContract.Substring(0, 12);
            dContract = dContract.Replace(":", "");
            string fileName2 = result.DocumentName + "_" + dContract + "." + result.Extension;
            string filePath2 = System.IO.Path.Combine(saveLocation, fileName2);
            FileStream fs = new FileStream(filePath2, FileMode.Create);
            fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
            fs.Close();
            System.Diagnostics.Process p = new System.Diagnostics.Process();
            p.StartInfo.UseShellExecute = true;
            p.StartInfo.FileName = filePath2;
            p.Start();

1 Answer, 1 is accepted

Sort by
0
Squall
Top achievements
Rank 1
answered on 02 Jul 2013, 06:58 AM
The report can't be changed per exported format. Instead my suggestion is to prepare another report definition that will generate simpler report with only the data and use that report definition when exporting to word.
Tags
General Discussions
Asked by
William
Top achievements
Rank 1
Answers by
Squall
Top achievements
Rank 1
Share this question
or