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

running a macro

1 Answer 97 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 Jul 2013, 09:34 PM
in the following code would it be possible to pass code that deletes a page break and reformats the footer on the docx that the report is converted to.  I am thinking p.invokemethod(method name) or something like that.  This is a workaround to auto page break place in docx document at end of page.  I do not want to add to my app.config as earlier post suggests.

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
Stef
Telerik team
answered on 22 Jul 2013, 04:36 PM
Hi William,

Once the report document is exported into certain format it is outside the scope of the reporting engine. You can search for possible solutions of your issue in msdn. For example take a look at the following msdn KB article: HOW TO: Run Office Macros by Using Automation from Visual C# .NET

If you need further help, elaborate on the scenario and the need to modify the produced Word document, so we can check for possible solutions on report level

Regards,
Stef
Telerik

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

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