Telerik Forums
Reporting Forum
2 answers
226 views

We have a legacy web application leveraging "Telerik Reporting Q1 2015 SP1 (version 9.0.15.324)" and would like to bring it up to date with the current version "ProgressĀ® TelerikĀ® Reporting R2 2019 SP1 (13.1.19.618)".

I have not been able to find anything to indicate what, if any, breaking changes were introduced in more recent versions or any other pitfalls we may face thus it is difficult to plan the effort or weigh the value.

Does anyone know if the newest version is backward compatible with version 9.0.15.324?

Thanks in advance,

Matt

Telerik Reporting Version History: https://www.telerik.com/support/whats-new/reporting/release-history

Missing User
 answered on 23 Sep 2019
1 answer
337 views
Telerik version SP1.11.1.17.614

 
function createSingleSelectEditor(placeholder, options) {
        console.log(placeholder);
            var dropDownElement = $(placeholder).html('<div></div>');
            var parameter,
                  valueChangedCallback = options.parameterChanged,
                  dropDownList;
 
            function onChange() {
                var val = dropDownList.value();
                valueChangedCallback(parameter, val);
            }
 
            return {
                beginEdit: function (param) {
 
                    parameter = param;
 
                    $(dropDownElement).kendoDropDownList({
                        dataTextField: "name",
                        dataValueField: "value",
                        value: parameter.value,
                        dataSource: parameter.availableValues,
                        change: onChange
                    });
 
                    dropDownList = $(dropDownElement).data("kendoDropDownList");
                }
            };
        }
 

@(Html.TelerikReporting().ReportViewer()
            .Id("VisorInformes")
            .ServiceUrl(Url.Content("api/reports/"))
            .TemplateUrl("/Resources/Templates/telerikReportViewerTemplate-FA.html")
            .ReportSource(typeReportSource)
               .ViewMode(ViewMode.Interactive)
            .ScaleMode(ScaleMode.Specific)
            .Scale(1.0)
            .PersistSession(false)
            .PrintMode(PrintMode.AutoSelect)
            .ParameterEditors(p =>
            p.SingleSelectEditor("createSingleSelectEditor"))
Neli
Telerik team
 answered on 23 Sep 2019
2 answers
694 views

Hello,
Can I show a field from a table using a Telerik Reporting HTML TextBox?

 

Claudio
Top achievements
Rank 1
Iron
 answered on 23 Sep 2019
2 answers
4.3K+ views

     Dear Admins.

I'm Developing Application Using Telerik Winform UI R2 2019 SP1. But i was using Microsoft RDLC report's for Printing and Displaying the Results.

But i was to Shift to Telerik Reports.

After spending too much time i was not able to create a single report. Did not find any to the point tutorial for creating report.

I'm Using SqlServer Database.

Please if possible provide any step by step helping material.

thank you

Neli
Telerik team
 answered on 23 Sep 2019
2 answers
260 views
Can I not split my table when exporting a document to PDF? I use telerik.reporting.table element.
Roman
Top achievements
Rank 1
 answered on 23 Sep 2019
1 answer
131 views

I have tried two different machines and the online demos at :  https://demos.telerik.com/reporting/  show only loading report.

I want to show these demos to management so we can evaluate using Telerik reporting.

Are the demos offline?

 

 

Silviya
Telerik team
 answered on 19 Sep 2019
2 answers
270 views

Hi there, 

I'm new to Telerik Reporting and I'm building a report that shows a list of images.  The images are uploaded from a mobile app, processed, and then are made available to be displayed on the report.

In some cases there could be an issue with the processing and the image file is not available or the processing hasn't completed yet before the report is executed.  In this case I would rather display nothing than the big red error message that shows when the image can't be found.  Is there a way for me to suppress this message somehow?

I've attached a sample of the error message.

Thanks for the help,

Greg

Greg
Top achievements
Rank 1
Iron
 answered on 18 Sep 2019
3 answers
499 views

I successfully make an example Winforms App which is taking parameters from user and then exports report which has a subreport to pdf. But I have an problem which I can solve just by putting the subreport's trdp file in the debug folder which is in the project. But I want to put subreport's trdp file where I want to put without getting the error. How can I do that ? I will attach the error I am getting. The error is written in Turkish. But It basically says I couldn't find the file "C:\Users\OE\source\repos\TelerikReportsDenemeForm\TelerikReportsDenemeForm\bin\Debug\denemereportabv.trdp".       

Here is my code : 

001.namespace TelerikReportsDenemeForm
002.{
003.    class ReportConnectionStringManager
004.    {
005.        readonly string connectionString;
006. 
007.        public ReportConnectionStringManager(string connectionString)
008.        {
009.            this.connectionString = connectionString;
010.        }
011. 
012.        public ReportSource UpdateReportSource(ReportSource sourceReportSource)
013.        {
014.            if (sourceReportSource is UriReportSource)
015.            {
016.                var uriReportSource = (UriReportSource)sourceReportSource;
017.                // unpackage TRDP report
018.                // http://docs.telerik.com/reporting/report-packaging-trdp#unpackaging
019.                var reportInstance = UnpackageReport(uriReportSource);
020.                // or deserialize TRDX report(legacy format)
021.                // http://docs.telerik.com/reporting/programmatic-xml-serialization#deserialize-report-definition-from-xml-file
022.                // var reportInstance = DeserializeReport(uriReportSource);
023.                ValidateReportSource(uriReportSource.Uri);
024.                this.SetConnectionString(reportInstance);
025.                return CreateInstanceReportSource(reportInstance, uriReportSource);
026.            }
027. 
028.            if (sourceReportSource is XmlReportSource)
029.            {
030.                var xml = (XmlReportSource)sourceReportSource;
031.                ValidateReportSource(xml.Xml);
032.                var reportInstance = this.DeserializeReport(xml);
033.                this.SetConnectionString(reportInstance);
034.                return CreateInstanceReportSource(reportInstance, xml);
035.            }
036. 
037.            if (sourceReportSource is InstanceReportSource)
038.            {
039.                var instanceReportSource = (InstanceReportSource)sourceReportSource;
040.                this.SetConnectionString((ReportItemBase)instanceReportSource.ReportDocument);
041.                return instanceReportSource;
042.            }
043. 
044.            if (sourceReportSource is TypeReportSource)
045.            {
046.                var typeReportSource = (TypeReportSource)sourceReportSource;
047.                var typeName = typeReportSource.TypeName;
048.                ValidateReportSource(typeName);
049.                var reportType = Type.GetType(typeName);
050.                var reportInstance = (Report)Activator.CreateInstance(reportType);
051.                this.SetConnectionString((ReportItemBase)reportInstance);
052.                return CreateInstanceReportSource(reportInstance, typeReportSource);
053.            }
054. 
055.            throw new NotImplementedException("Handler for the used ReportSource type is not implemented.");
056.        }
057. 
058.        ReportSource CreateInstanceReportSource(IReportDocument report, ReportSource originalReportSource)
059.        {
060.            var instanceReportSource = new InstanceReportSource { ReportDocument = report };
061.            instanceReportSource.Parameters.AddRange(originalReportSource.Parameters);
062.            return instanceReportSource;
063.        }
064. 
065.        void ValidateReportSource(string value)
066.        {
067.            if (value.Trim().StartsWith("="))
068.            {
069.                throw new InvalidOperationException("Expressions for ReportSource are not supported when changing the connection string dynamically");
070.            }
071.        }
072. 
073.        Report UnpackageReport(UriReportSource uriReportSource)
074.        {
075.            var reportPackager = new ReportPackager();
076.            using (var sourceStream = System.IO.File.OpenRead(uriReportSource.Uri))
077.            {
078.                var report = (Report)reportPackager.UnpackageDocument(sourceStream);
079.                return report;
080.            }
081.        }
082. 
083.        Report DeserializeReport(UriReportSource uriReportSource)
084.        {
085.            var settings = new System.Xml.XmlReaderSettings();
086.            settings.IgnoreWhitespace = true;
087.            using (var xmlReader = System.Xml.XmlReader.Create(uriReportSource.Uri, settings))
088.            {
089.                var xmlSerializer = new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();
090.                var report = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
091.                return report;
092.            }
093.        }
094. 
095.        Report DeserializeReport(XmlReportSource xmlReportSource)
096.        {
097.            var settings = new System.Xml.XmlReaderSettings();
098.            settings.IgnoreWhitespace = true;
099.            var textReader = new System.IO.StringReader(xmlReportSource.Xml);
100.            using (var xmlReader = System.Xml.XmlReader.Create(textReader, settings))
101.            {
102.                var xmlSerializer = new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();
103.                var report = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
104.                return report;
105.            }
106.        }
107. 
108.        void SetConnectionString(ReportItemBase reportItemBase)
109.        {
110.            if (reportItemBase.Items.Count < 1)
111.                return;
112. 
113.            if (reportItemBase is Report)
114.            {
115.                var report = (Report)reportItemBase;
116. 
117.                if (report.DataSource is SqlDataSource)
118.                {
119.                    var sqlDataSource = (SqlDataSource)report.DataSource;
120.                    sqlDataSource.ConnectionString = connectionString;
121.                }
122.                foreach (var parameter in report.ReportParameters)
123.                {
124.                    if (parameter.AvailableValues.DataSource is SqlDataSource)
125.                    {
126.                        var sqlDataSource = (SqlDataSource)parameter.AvailableValues.DataSource;
127.                        sqlDataSource.ConnectionString = connectionString;
128.                    }
129.                }
130.            }
131. 
132.            foreach (var item in reportItemBase.Items)
133.            {
134.                //recursively set the connection string to the items from the Items collection
135.                SetConnectionString(item);
136. 
137.                //set the drillthrough report connection strings
138.                var drillThroughAction = item.Action as NavigateToReportAction;
139.                if (null != drillThroughAction)
140.                {
141.                    var updatedReportInstance = this.UpdateReportSource(drillThroughAction.ReportSource);
142.                    drillThroughAction.ReportSource = updatedReportInstance;
143.                }
144. 
145.                if (item is SubReport)
146.                {
147.                    var subReport = (SubReport)item;
148.                    subReport.ReportSource = this.UpdateReportSource(subReport.ReportSource);
149.                    continue;
150.                }
151. 
152.                //Covers all data items(Crosstab, Table, List, Graph, Map and Chart)
153.                if (item is DataItem)
154.                {
155.                    var dataItem = (DataItem)item;
156.                    if (dataItem.DataSource is SqlDataSource)
157.                    {
158.                        var sqlDataSource = (SqlDataSource)dataItem.DataSource;
159.                        sqlDataSource.ConnectionString = connectionString;
160.                        continue;
161.                    }
162.                }
163. 
164.            }
165.        }
166.    }
167. 
168.    public partial class Form1 : Form
169.    {
170.        public Form1()
171.        {
172.            InitializeComponent();
173.        }
174. 
175.        private void BtnExportPDF_Click(object sender, EventArgs e)
176.        {
177.            var reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
178. 
179.            // set any deviceInfo settings if necessary
180.            var deviceInfo = new System.Collections.Hashtable();
181. 
182.            // Depending on the report definition choose ONE of the following REPORT SOURCES
183. 
184. 
185.            ////                  -2-
186.            //// ***Declarative (TRDP/TRDX) report definitions***
187.            var reportSource = new Telerik.Reporting.UriReportSource();
188. 
189.            //// reportName is the path to the TRDP/TRDX file
190.            reportSource.Uri = @"C:\Users\OE\Desktop\TelerikReport\Deneme.trdp";
191.            ////                  -2-
192.            ReportConnectionStringManager reportConnection = new ReportConnectionStringManager("Data Source=192.168.6.198:1521/TEST2;User Id=smart;Password=a;");
193.            ReportSource rs = reportConnection.UpdateReportSource(reportSource);
194.             
195. 
196. 
197.            ////                  -3-
198.            //// ***Instance of the report definition***
199.            //var reportSource = new Telerik.Reporting.InstanceReportSource();
200. 
201.            //// Report1 is the class of the report. It should inherit Telerik.Reporting.Report class
202.            //reportSource.ReportDocument = new Report1();
203.            ////                  -3-
204.            object parameterValue = txtBasDep.Text;
205.            rs.Parameters.Add("basdepid", parameterValue);
206.            object parameterValue1 = txtBitDep.Text;
207.            rs.Parameters.Add("bitdepid", parameterValue1);
208.            object parameterValue2 = txtSonDogum.Text;
209.            rs.Parameters.Add("sondogumtar", parameterValue2);
210. 
211.            Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("PDF", rs, deviceInfo);
212. 
213. 
214. 
215.            string filePath = @"C:\Users\OE\Desktop\TelerikReport\Deneme.pdf";
216. 
217.            using (System.IO.FileStream fs = new System.IO.FileStream(filePath, System.IO.FileMode.Create))
218.            {
219.                fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
220.            }
221. 
222.            MessageBox.Show("The report has been exported!", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
223.        }
224.    }
225.}
Silviya
Telerik team
 answered on 18 Sep 2019
1 answer
379 views

Hello.

 

I try to get the last date of the next month in my report.  And it's have to work fine even at the end of the year.  By example, if i print my report in december 2019 i want to display on it Jan, 31 2020.

Any suggestion will be very appreciate.

Have nice day everyone.

 

 

Neli
Telerik team
 answered on 17 Sep 2019
1 answer
198 views

I have a report (trdp) with a zip code field.  some of the data has the zip code saved as 5 digits some have 9 (ie. 12345-4578).  If the data length is 5 I want the report to display 01245 if it's length is > 5 I want to display 01245-7845. 

How would one acomplish this without using a user defined function?

Neli
Telerik team
 answered on 17 Sep 2019
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?