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

programmatically set Reportsoure of Sub-Sub Report

2 Answers 167 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Lars
Top achievements
Rank 1
Lars asked on 01 Feb 2017, 12:33 PM

Hi,

i am facing a problem setting the ReportSource of a Sub - Sub Report.

At the end a PDF should be generatet complete programmatically. (That ist working fine, but without detailed Data)

I am trying it like this....

using (System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create(reportingPath + report_Name, settings))
{
    Telerik.Reporting.XmlSerialization.ReportXmlSerializer xmlSerializer = new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();
    ExportReport = (Telerik.Reporting.Report) xmlSerializer.Deserialize(xmlReader);
    if ((ExportReport != null))
    {
        ExportReport.ReportParameters["Id"].Value = Id;
 
        // Subreport for Column1
        if ((ExportReport.Items.Find("SubReport_Column1", true)).Count() == 1)
        {
            Telerik.Reporting.SubReport SubReport_Column1 = (Telerik.Reporting.SubReport) ExportReport.Items.Find("SubReport_Column1", true)[0];
            ((Telerik.Reporting.UriReportSource) (SubReport_Column1.ReportSource)).Uri = reportingPath + SubReport_Colum1_Name;
                         
            if ((SubReport_Column1.Items.Find("SubReport_Column1_Details", true)).Count() == 1)
            {
                Telerik.Reporting.SubReport Report_SubReport_Column1_Details = (Telerik.Reporting.SubReport) SubReport_Column1_Details.Items.Find("Column1_Details", true)[0];
                ((Telerik.Reporting.UriReportSource) (Report_SubReport_Column1_Details .ReportSource)).Uri = reportingPath + report_Column1_Details;
            }
        }
         
        ...

 

the SubReport_Column1.Items.Find does not find anything.

What am i doing wrong? Could anybody help me out?

KR

Lars

 

 

 

2 Answers, 1 is accepted

Sort by
0
Lars
Top achievements
Rank 1
answered on 02 Feb 2017, 10:28 AM

@Telerik, what is the best way to set the URIReportSource of the Subreports into deeper Level?

Do i have to DeSerialize the SubReport to set it?
How does the MainReport get notice of that, when i do so?

 

0
Katia
Telerik team
answered on 06 Feb 2017, 09:50 AM
Hi Lars,

You can check the update in the support ticket #1088145 that you opened on the same question.

For other community members interested in this topic, a sample project demonstrating how to set the ReportSource for the SubReport item programmatically is attached here.


Regards,
Katia
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Report Designer (standalone)
Asked by
Lars
Top achievements
Rank 1
Answers by
Lars
Top achievements
Rank 1
Katia
Telerik team
Share this question
or