Import.RTF as method call

Stimulsoft Reports.NET discussion
Post Reply
Haraldf
Posts: 24
Joined: Thu Dec 05, 2013 8:21 pm

Import.RTF as method call

Post by Haraldf »

Hi,

are there any API functions for importing RTFs (e.g. as in Import.RTF).

(I'd like to have this as stream version, too).

If not, can you please include this in 2014.2?

Thank you!
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Import.RTF as method call

Post by HighAley »

Hello.

You could get all necessary information from Stimulsoft Programming Manual.

Thank you.
Haraldf
Posts: 24
Joined: Thu Dec 05, 2013 8:21 pm

Re: Import.RTF as method call

Post by Haraldf »

Sorry, I didn't explain the problem properly:

I'd like to create a .mrt file from an existing .rtf file (like the Import.RTF.exe)
programm can do.

How can I do that by code?

(This question is not about exporting .rtf from a report. That's sweet and easy in Stimulsoft!)
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Import.RTF as method call

Post by HighAley »

Hello.

Sorry, we didn't understand your question first time.

Our import convert RTF to Stimulsoft Report Template but anyway each report should be edited manually. We don't guaranty that you will achieve the expected results.

To import rtf by code you could use next code:

Code: Select all

StiReport report = new StiReport();
FileStream stream = new FileStream(rtf_filename, FileMode.Open);
Stimulsoft.Report.SaveLoad.StiRtfReportSLService rtfService = new Stimulsoft.Report.SaveLoad.StiRtfReportSLService();
rtfService.Load(report, stream);
if (RegionInfo.CurrentRegion.IsMetric) report.ReportUnit = StiReportUnitType.Millimeters;
report.Save(template_filename);
Thank you.
Haraldf
Posts: 24
Joined: Thu Dec 05, 2013 8:21 pm

Re: Import.RTF as method call

Post by Haraldf »

The quality of the autoimporter is often quite acceptable (compared to the manual work).

And it's nice for impressing customers ;)

Thank you!
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Import.RTF as method call

Post by HighAley »

Hello.

We are always glad to impress you. :)
Let us know if you need any additional help.

Thank you.
Haraldf
Posts: 24
Joined: Thu Dec 05, 2013 8:21 pm

Re: Import.RTF as method call

Post by Haraldf »

Hello Aleksey!

Stimulsoft.Report.SaveLoad.StiRtfReportSLService

isn't avaiable in the core DLLs.

I just found a reference in

C:\Program Files (x86)\Stimulsoft Reports.Ultimate 2014.1\Bin\Import.Rtf.exe

Any Idea?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Import.RTF as method call

Post by HighAley »

Hello.

Please, look at the "C:\Program Files (x86)\Stimulsoft Reports.Ultimate 2014.1\Imports\Import.Rtf.zip" archive.

You could find there a project with this tool.

Thank you.
Haraldf
Posts: 24
Joined: Thu Dec 05, 2013 8:21 pm

Re: Import.RTF as method call

Post by Haraldf »

+ 100 Like ;)
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Import.RTF as method call

Post by HighAley »

Hello.

Let us know if you need any additional help.

Thank you.
Post Reply