Telerik Forums
Reporting Forum
6 answers
1.2K+ views
The report I'm building is using a CustomReportResolver and has System, ReportName and Footer parameters that I am adding to the report at runtime.  Whenever the user selects new criteria for the report (handled separately) and then refreshes the ReportViewer in the MVC page (razor), I then rebuild the report from scratch - re-adding the parameters with respective values, along side my custom data object source.  The problem is with displaying the footer text parameter that contains a big long string describing the criteria that the user has selected.  However, even though I can see, using breakpoints, that the report being built contains the updated footer text, when the report refreshes (html5 / web/api) the footer parameter still contains the text from the first time it was built.  Why are the parameters being cached even though its a brand new Telerik.Report object? and how can I stop this so it will show the latest text that I've added?


Stef
Telerik team
 answered on 03 Oct 2014
1 answer
128 views
Here's my current scenario. I have 100+ records, grouped by one of their column values. Each detail record has a "Days Elapsed" integer value. I am trying to determine the value of Days Elapsed at the 90th percentile for each group. I can find what record I need, ie a group has 77 records, the record at the 90th percentile is the 69th. So what I want is to display the Days Elapsed value for the 69th record within that group.

Is there any way to do this?
Hinata
Top achievements
Rank 1
 answered on 03 Oct 2014
1 answer
1.5K+ views
I am using a trial version of Telerik Reporting and I can't get past a connection string issue. I'm using the HTML5 Report Viewer and running it locally.

I have created a simple report in VS2012 with a SqlDataSource that uses the default connectionstring:

Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString

In my app.config I have the connection defined:
<br><connectionStrings><br>    <add name="Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString"<br>            connectionString="Data Source=(local)\SQLEXPRESS;Initial Catalog=myDB;User Id=xxxx;Password=xxxx"<br>            providerName="System.Data.SqlClient" /><br></connectionStrings>

I can preview the report in Visual Studio, but when I view it through the report viewer I get the error:

Format of the initialization string does not conform to specification starting at index 0

Telerik Reporting is very new to me and I seem to be going round in
circles trying to find the solution. Can anyone shed any light on this?
Mark
Top achievements
Rank 1
 answered on 03 Oct 2014
1 answer
237 views
Hi all,

Is there an easy way to add a trendline (trend line) to a Telerik Scatter Chart? This is something management is doing in Excel, and they want to see it on the Telerik reports too. See attached. 

Right now I'm going down the path of calculating my own line from the data to add to the chart. Is this the easiest way?

Thank you
Nasko
Telerik team
 answered on 03 Oct 2014
5 answers
308 views
Hi,

  I want add textbox in header group in runtime, what wrong in my code?
private void gp_instrutor_header_ItemDataBinding(object sender, EventArgs e) 
        { 
            Telerik.Reporting.Processing.GroupSection groupb = (Telerik.Reporting.Processing.GroupSection)sender; 
 
            try 
            { 
                if (!dsSourceReport.Equals(null)) 
                { 
                     gp_instrutor_header.Items.AddRange(Report_Functions.clsReportFunctions.AdicionaTextBoxDinamico(dsSourceReport, "INSTRUTOR""DS_GRUPO_QUESTAO""VL_MEDIA"double.Parse("3,2"), double.Parse("0,4"), double.Parse("9,5"), double.Parse("0,85"), double.Parse("0,2"), double.Parse("0,1"))); 
                } 
            } 
            catch { } 
        } 


My Function that generate the textbox colection

public static ReportItemBase[] AdicionaTextBoxDinamico(DataSet dsReportSource, string _strPrefixo, string _strTermoDescricao, string _strTermoValor, double _dblTamX, double _dblTamY, double _dblPosInicialX, double _dblPosInicialY, double _dblEspassamentoHorizontal, double _dblEspassamentoVertical) 
        { 
            try 
            { 
                #region Determinar a quantidade de colunas dinâmicas 
 
                int _intNumeroColunas = 0; 
 
                foreach (DataColumn coluna in dsReportSource.Tables[0].Columns) 
                { 
                    if (coluna.ColumnName.StartsWith(_strPrefixo)) 
                    { 
                        _intNumeroColunas++; 
                    } 
                } 
 
                _intNumeroColunas = _intNumeroColunas / 2; 
                #endregion 
                #region Monta Objetos(TextBox) que serão inseridos no relatório 
 
                TextBox txtDynamicColumnDescription; 
                TextBox txtDynamicColumnValue; 
                List lstControls = new List(); 
 
 
                for (int i = 1; i <= _intNumeroColunas; i++) 
                { 
                    if (!_strTermoDescricao.Equals("")) 
                    { 
                        #region Controle de Descrição (titulo do valor) 
 
                        txtDynamicColumnDescription = new TextBox(); 
                        txtDynamicColumnDescription.Name = _strPrefixo + "_" + _strTermoDescricao + "_" + i.ToString(); //ex.: curso_questao_1 
                        txtDynamicColumnDescription.Value = "=Fields." + _strPrefixo + "_" + _strTermoDescricao + "_" + i.ToString(); 
                        txtDynamicColumnDescription.Size = new SizeU(new Unit(_dblTamX, UnitType.Cm), new Unit(_dblTamY, UnitType.Cm)); 
                        txtDynamicColumnDescription.Style.Color = System.Drawing.Color.Black; 
                        txtDynamicColumnDescription.Style.Font.Bold = true
                        txtDynamicColumnDescription.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(7, ((Telerik.Reporting.Drawing.UnitType)(Telerik.Reporting.Drawing.UnitType.Point))); 
                        txtDynamicColumnDescription.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center; 
                        txtDynamicColumnDescription.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle; 
 
                        if (i == 1) 
                        { 
                            txtDynamicColumnDescription.Location = new PointU(new Unit(_dblPosInicialX, UnitType.Cm), new Unit(_dblPosInicialY, UnitType.Cm)); 
                        } 
                        else 
                        { 
                            double _dblX, _dblY; 
 
                            ///Posição Inicial + espaçamento horizontal + tamanho do controle 
                            _dblX = ((_dblPosInicialX + _dblEspassamentoHorizontal) + (_dblTamX * (double.Parse(i.ToString()) - 1))); 
 
                            ///Mantém-se fixo, não variavél 
                            _dblY = _dblPosInicialY; 
 
                            txtDynamicColumnDescription.Location = new PointU(new Unit(_dblX, UnitType.Cm), new Unit(_dblY, UnitType.Cm)); 
                        } 
                        #endregion 
                        #region Adiciona Controles de Descrição no Array 
 
                        lstControls.Items.Add(txtDynamicColumnDescription); 
                        #endregion 
                    } 
 
                    if (!_strTermoValor.Equals("")) 
                    { 
                        #region Controle de Valores (Valores) 
 
                        txtDynamicColumnValue = new TextBox(); 
                        txtDynamicColumnValue.Name = _strPrefixo + "_" + _strTermoValor + "_" + i.ToString(); //ex.: curso_questao_1 
                        txtDynamicColumnValue.Value = "=Fields." + _strPrefixo + "_" + _strTermoValor + "_" + i.ToString(); 
 
                         
                        txtDynamicColumnValue.Size = new SizeU(new Unit(_dblTamX, UnitType.Cm), new Unit(_dblTamY, UnitType.Cm)); 
                        txtDynamicColumnValue.Style.Color = System.Drawing.Color.Blue; 
                        txtDynamicColumnValue.Style.Font.Bold = true
 
                        txtDynamicColumnValue.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(7, ((Telerik.Reporting.Drawing.UnitType)(Telerik.Reporting.Drawing.UnitType.Point))); 
                        txtDynamicColumnValue.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center; 
                        txtDynamicColumnValue.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle; 
 
                        if (i == 1) 
                        { 
                            double _dblY; 
 
                            ///Posição Inicial + espaçamento vertical + tamanho do controle 
                            _dblY = (_dblPosInicialY + _dblEspassamentoVertical + _dblTamY); 
 
                            txtDynamicColumnValue.Location = new PointU(new Unit(_dblPosInicialX, UnitType.Cm), new Unit(_dblY, UnitType.Cm)); 
                        } 
                        else 
                        { 
                            double _dblX, _dblY; 
 
                            ///Posição Inicial + espaçamento horizontal + tamanho do controle 
                            _dblX = ((_dblPosInicialX + _dblEspassamentoHorizontal) + (_dblTamX * (double.Parse(i.ToString()) - 1))); 
 
                            ///Posição Inicial + espaçamento vertical + tamanho do controle 
                            _dblY = (_dblPosInicialY + _dblEspassamentoVertical + _dblTamY); 
 
                            txtDynamicColumnValue.Location = new PointU(new Unit(_dblX, UnitType.Cm), new Unit(_dblY, UnitType.Cm)); 
                        } 
                        #endregion 
                        #region Adiciona Controles de Valor no Array 
 
                        lstControls.Items.Add(txtDynamicColumnValue); 
                        #endregion 
                    } 
                } 
                #endregion 
                #region Array com todos os controles 
                    ReportItemBase[] reportControls = new ReportItemBase[lstControls.Items.Count]; 
                    for (int i = 0; i < lstControls.Items.Count; i++) 
                    { 
                        reportControls[i] = lstControls.Items[i]; 
                    } 
                #endregion 
 
                return reportControls; 
 
            } 
            catch (Exception error) 
            { 
                ///Lança a exeção gerada pelo método e retorna nulo; 
                throw new Exception(error.Message.ToString()); 
                return null
            } 
        } 


The problem is that on runtime its don´t render the controls.How can I do it?

If I use this

Telerik.Reporting.Processing.GroupSection groupb = (Telerik.Reporting.Processing.GroupSection)sender; 
groupb.Items.Add(item); 


What data type my function need return, or how can I make a foreach loop whit an Telerik.Reporting.ReportItemBase array.

Thanks






Aleksey
Top achievements
Rank 1
 answered on 02 Oct 2014
1 answer
121 views
Hi, 

When the right set of data points present themselves, the smooth curve line will go outside the boundaries of the graph. (see attached image)

Any best practices to help prevent this?

Thank you

Brick
Stef
Telerik team
 answered on 02 Oct 2014
1 answer
148 views
I am working on a new Web application that uses a
ReportViewer. I am familiar with doing this with previous versions. However,
when I attempted to customize the Skin for the ReportViewer I noticed that the
images for the tool bar where missing. I copied them as well as the
reportviewer.css to the appropriate folder[s] and the page could not find the
images. I ended up having to separate the most of images into the same
directory that the ReportViewer was located in. For example root/Controls/Skins/Custom,
while the reportviewer.css and Background.gif remained in root/Skins/Custom. Also
I noticed the PrintPreview.gif did not exist because I had copied the Skins
folder from an older version. I looked everywhere for a current version of the
Q2 2014 Skins folder and could not find anything. Moreover there is no
documentation for custom skinning the new Web Forms version of the
ReportViewer.

Another problem! When I
ref the SkinPath with SkinsPath=”~/Skins” the resulting improper references are
written to the header of the Web page:

<link rel="stylesheet" type="text/css" href="//Skins/Custom/ReportViewer.css" />
<link rel="stylesheet" type="text/css" href="/Telerik.ReportViewer.axd?optype=Resource&version=8.1.14.804&name=Resources.ParametersArea.css" />
<link rel="stylesheet" type="text/css" href="/Telerik.ReportViewer.axd?optype=Resource&version=8.1.14.804&name=Resources.ReportViewerInternal.css" />
 

This is not correct
=> “//Skins/Custom….” I don't think 804&name=Resources...... is correct either.
Could someone point me to the location to find the current skins directory for Q2 2014 and maby tell me what is going on with this?

Stef
Telerik team
 answered on 02 Oct 2014
1 answer
665 views
the following link provides a basic idea of how to set up but I've had limited success translating the Visual studio Example into a telerik standalone report designer example. 
http://www.telerik.com/help/reporting/designing-reports-master-detail.html 

It seems like there are basically 3 reports involved. Master,Detail, and SubReport. I'm confused how the master report comes into play. It Seems to me that the I really should only need the Detail and SubReport. The instructions to building the master report just say to create a query. but the other two are more linked together. I've tried linking the reports using the files and adding edit parameters but nothing seems to be passed back and forth. I've attached images with my basic set up for queries. if I break the link between these reports and test without passing the parameter they both work fine.

I originally had the filter on my detail report set like in the example but when I set the filter I no longer get a list of data.

My goal is to have a list of items with some precalculated values that I can that drill into each item of the list as desired. drilling down I can then take the values passed in and filter down to a more detailed view. Unfortunately, I'm having a hard time setting up passing the report parameters from the detail to the sub report.

Any Help would be greatly appreciated!




Stef
Telerik team
 answered on 02 Oct 2014
1 answer
284 views
Hi,
I was wondering if it was possible to only scale a report horizontally to where it will fill the entire width of the container, so it will basically behave like a table with columns that have a percentage width and not a fixed one. I am trying to avoid any height changes for any of the controls on the report as well as the font size.

Currently I am generating the reports programatically using the html5 interactive mode, is there perhaps a different mode I should be using to achieve the above requirements?

Secondly, while using RenderReport like so: 
var report = new T { DataSource = data };
var instanceReportSource = new InstanceReportSource { ReportDocument = report };
System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
deviceInfo["ContentOnly"] = true;
Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();

reportProcessor.RenderReport(
"HTML5Interactive", instanceReportSource, deviceInfo, this.CreateStream, out documentName);

the second stream, which is the css stream, appears to close before this call returns, which means that it can no longer be used. As a workaround, I am keeping track of the temp files used for each stream and parsing those in order to get the contents. Is there perhaps a setting I am missing?

Thanks,
Stef
Telerik team
 answered on 02 Oct 2014
5 answers
455 views
Is there a way to cause a data field to display the string "None" when the field has no value?  Otherwise the field should display its appropriate value.  

I was trying to use a combination of the IIF() and ISNULL() functions like this for the field's Value property

= IIf(IsNull(Fields.AccountCode),"None", Fields.AccountCode)

but I was getting errors that said:

An error has occurred while processing TextBox 'textBox17':
Type mismatch in function arguments. Cannot find an overload of the function IsNull() that accepts arguments of type (String).


Thank you.  Any help would be most appreciated.  I am still very new to coding.
Sadie
Top achievements
Rank 1
 answered on 01 Oct 2014
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?