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

How do I get a IReportDocument from a TRDX file?

5 Answers 812 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
ANDRE
Top achievements
Rank 1
ANDRE asked on 04 Jun 2012, 06:06 PM
I'm trying to follow these instructions to directly export reports from their definitions to the end file (Word or PDF) without passing through a viewer. This is the requirement of the application I'm doing.

I know how to obtain the PDF given the IReportDocument, but how do I get an IReportDocument from the TRDX file I just created using the Standalone builder?

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 07 Jun 2012, 12:30 PM
Hello ANDRE,

You should deserialize the trdx file to a report definition that you can then use for the RenderReport method, for more info see Serializing Report Definition in XML. We would consider introducing an easier way to handle this for future versions.

Kind regards,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Muhammad
Top achievements
Rank 1
answered on 12 Oct 2012, 10:23 AM
Hi an immediate response needed would be much appreciated,
i have tdrx file and in the   ReportSource Resolve(string reportName) method i am deserializing the tdrx file into Report Object,how i can convert Report object into ReportSource so that can be returned from the Resolve method as we cannot return Report object from the Resolve method.

with best regards shabbir

0
Peter
Telerik team
answered on 16 Oct 2012, 11:07 AM
Hello Muhammad,

Generally in your case you don't have to deserialize the trdx report definition to report object instead our suggestion is to directly create an UriReportSource and pass the Uri to the trdx definition.

Regards,
Peter
the Telerik team

HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

0
Muhammad
Top achievements
Rank 1
answered on 22 Oct 2012, 03:11 PM
Hi,
i am setting up the ReportSourceUri and have the following problems,
1)call to resolve method in the clientservice comes twice
2)i am creating the trdx file on the fly .
3)at the end it throws exception 
Invalid URI: The format of the URI could not be determined.
4)this is how i am setting up the reportsource

  StreamWriter writer = new StreamWriter(listResult.Code + ".trdx");
            writer.Write(listResult.Template);
            writer.Close();
            UriReportSource reportSource = new UriReportSource();
           
            reportSource.Uri = listResult.Code + ".trdx";
            return reportSource;
this code successfully create and write contents at the following location

C:\Program Files (x86)\Common Files\microsoft shared\DevServer\11.0

with kind regards
shabbir
0
Peter
Telerik team
answered on 25 Oct 2012, 03:02 PM
Hello Muhammad,

The resolve method by design is called every time the report service requires a new report definition instance. For example once to retrieve the report parameters definition and the second time to process the report. Generally our suggestion is to protect you resolve method implementation and based on the passed parameter to handle accordingly the report resolution.

If you still experience difficulties we will appreciate if you open a support thread and send us a sample project that exhibits the difficulties you are experiencing to review on our end.

All the best,
Peter
the Telerik team

HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

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