Telerik Forums
Reporting Forum
5 answers
303 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
115 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
143 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
647 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
272 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
444 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
2 answers
147 views
Like the attachment , is it possible to show table rows like this depends on the space right to the table.
ZHOU
Top achievements
Rank 2
 answered on 30 Sep 2014
3 answers
320 views
How to make Telerik report Parameter/Filter searching none case sensative?
If I set field TOPIC as Paramter as well as Filter, I try to find "school", get search result, I try to search 'School' returns nothing.

The "Like" filter operatior doesn't seem to work also. If I serach "schoo" I get nothing, unless I try "school".

Did I miss anything?  My dataset case sensative is set false as defaut setting.
Stef
Telerik team
 answered on 30 Sep 2014
1 answer
106 views
I need to know how to create a map manually with a dataset.  I need to create a pin for the supplier of one color and then a different color pin for the customers.  I also need to be able and create a radius of 50 miles to the supplier.  The users will select different customers so I need to be able to dynamically center the map based on the customer coordinates.
If you can please supply an example of how I could do this.

Thanks -Tim
Ivan Hristov
Telerik team
 answered on 30 Sep 2014
3 answers
511 views
I'm using a multivalue parameter and its currently giving me a little grief for a single case. Null

my query is:

select * from table where column1 in (?)

which ends up looking like
select * from table where column1 in ('a','b','c')

this is a problem with null included because it evaluates to unknown and can't continue.

with the following query this works but I'm not sure of how to set up the parameters to make this work.


select * from table where column1 in ('a','b','c') or tag is null

Can you help me understand how I can set up or format my multivalue parameter to deal with this?

Ben
Top achievements
Rank 1
 answered on 30 Sep 2014
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?