Telerik Forums
Reporting Forum
2 answers
462 views
I've found an issue where if you have a textbox using an expression

 Sum(IIF(Fields.typeCode="DG",Fields.TotalAmount,0))  will round your result up or down regardless of the Format of the control,  when I change it to ....Sum(IIF(Fields.typeCode="DG",Fields.TotalAmount,0.00)) the results are NOT rounded.

To recreate this you must ensure the the first record in your result set causes the IIF condition evaluates to the false-part first meaning it will sum the 0.  I'm assume the report engine processes the "0" and automatically defaults the number of decimals to match the format of 0....if the engine encounters 0.00 it auto formats to use 2 decimal places. You will not see this behavior if the IIF evaluates the true-part first with existing decimal data.  Using Telerik Reporting ver 6.0.12.215

Thanks,

Kerry 
derek
Top achievements
Rank 1
 answered on 28 Dec 2012
2 answers
270 views
I tried searching, but my Google-Fu appears to not be functioning today.

What I want to do is Conditionally Format the field to Bold if it matches the value from the prior row.
So I have Field.A, Field.B, etc and I plan to bold the whole row if Field.A (in this row) equals Field.A (from the prior row).
I know how to apply the conditional format across the row (ie, to each field), and I know StringCompare(String1, String2), but I don't know how to grab the prior row's field.
Whether there's a function to do it, or I need to store the value in a variable so I can compare before updating to the current row, yadda yadda it's all good, but I need tips on how to do that.
I would imagine this has been done before.
FYI: The user can't control sorting, so I don't have to worry about that aspect.
IvanY
Telerik team
 answered on 28 Dec 2012
1 answer
53 views
Hi 

I am using telerik reporting Q1(6.0..215).I have filtered for report and nearly 20 fields .when i filter for some particular condition the report results are moving to the 3 pages.First page shows blank.Page settings.Landscape=true, Margin 15 Px in all sides paper size is A4.

I have noticed one thing here is when report returns min results its shows correct.but when report exceeds for some limit its moving to third page.

Any idea in this?

Regards,
Dhandapani. 
IvanY
Telerik team
 answered on 28 Dec 2012
3 answers
344 views
Hi
I am creating subreports in Telerik Reporting Designer(.trdx) but i need that every subreport are show in different sheet, can be to the moment of export to some format
Somebody can help me?
Elian
Telerik team
 answered on 28 Dec 2012
1 answer
69 views
  Hi ,
i am using web config based authentication and autharization
Although i give permission in web config the report does not display as a attached image
i give permissin to report( report.cs) and .aspx file which containes reportviewer

http://f1212.hizliresim.com/14/t/h8dpq.png
Hadib Ahmabi
Top achievements
Rank 1
 answered on 28 Dec 2012
1 answer
125 views
Hi,

I'm having a problem when loading the report viewer control in to a Web Form, a drag the control and nothing happens, if a try to insert the code directly in the form an error of a TAG PREFIX appears, what it can be wrong or what a need to configure to solve this issue, i already  add the following references:

* Telerik.reporting
* Telerik.ReportViwer.WebForms
* Telerik.ReportViwer.WinForms

I posted a similar issue about 2 weeks ago and it simply disappear, it think maybe i need to post this under another topic?, but a didn't get any email, i don't know what happens with the other thread i posted.


Anyone can help me, thanks in advance.
Armando
Top achievements
Rank 1
 answered on 27 Dec 2012
2 answers
424 views
I'm attempting to adjust the column width programatically and from other forum posts I've read that there is allot involved.

I can Hide Column content on ItemDataBound, but I cannot collapse the width.
Using JustCompile and the debugger I believe I'm setting all the proper widths, but I cannot get it to collapse.

below is my code.
Can you provide any insight on the events between ItemDataBound and rendering and if there is an event between where I can adjust these values.  
public static void RemoveColumns(this Telerik.Reporting.Table tableDef, params int[] columns)
{
    /*
    var colGroups = Flatten(tableDef.ColumnGroups).ToList();
 
    foreach (int column in columns)
    {
        // colGroups[column].Visible = false; // Object not found Error in binding
        colGroups[column].Filters.Clear();
        colGroups[column].Filters.Add(new Telerik.Reporting.Filter("=1", Telerik.Reporting.FilterOperator.Equal, "=0")); // Object not found Error in binding
    }
 
    return;
    */
 
    var tableBody = tableDef.Body;
    var tableCells = tableBody.Where(x => x.ReportItem != null).ToList();
    var zero = Telerik.Reporting.Drawing.Unit.Inch(0);
 
 
    foreach (int colIndex in columns.OrderByDescending(x => x))
    {
        tableBody.Columns[colIndex].Width = zero;
 
        // shrink all cell.reportItem(s)
        foreach (var cell in tableCells.Where(x => x.ColumnIndex == colIndex))
        {
            // cell.ReportItem.Visible = false; throws error during Binding
            cell.ReportItem.Width = zero;
                     
            if (cell.ReportItem is Telerik.Reporting.TextItemBase)
                ((Telerik.Reporting.TextItemBase)cell.ReportItem).CanGrow = false;
        }
    }
}
 
         
/// <summary>
/// ItemDataBound, Remove columns by settings its content Visibility
/// </summary>
/// <param name="table"></param>
/// <param name="columns"></param>
public static void RemoveColumns(this Telerik.Reporting.Processing.Table table, params int[] columns)
{
    RemoveColumns((Telerik.Reporting.Table)table.ItemDefinition, columns);
    var zero = Telerik.Reporting.Drawing.Unit.Inch(0);
 
             
    foreach (var textbox in table.TableCells(x => columns.Contains(x.ColumnIndex)).OfType<Telerik.Reporting.Processing.TextBox>())
    {
        // textbox.Visible = false; // Doesn't collapse column
        textbox.Width = zero;
        textbox.Value = string.Empty;
 
        TextboxCanGrowProperty.SetValue(textbox, false, null);
    }
 
    foreach (var column in table.Columns.Where(x => columns.Contains(x.Index)))
    {
        TableColumnWidthProperty.SetValue(column, 0D, null);
    }
 
}
 
 
private static IEnumerable<Telerik.Reporting.Processing.ITableCell> TableCells(this Telerik.Reporting.Processing.Table table, Func<Telerik.Reporting.Processing.ITableCell, bool> predicate = null)
{
    Telerik.Reporting.Processing.ITableCell cell;
    int colCount = table.Columns.Count;
    int rowCount = table.Rows.Count;
 
    for (int rowIndex = 0; rowIndex < rowCount; rowIndex++)
    {
        for (int colIndex = 0; colIndex < colCount; colIndex = colIndex + cell.ColumnSpan)
        {
            cell = table.GetCell(rowIndex, colIndex);
 
            if (predicate == null || predicate(cell))
                yield return cell;
        }
    }
}
 
public static IEnumerable<Telerik.Reporting.TableGroup> Flatten(this IEnumerable<Telerik.Reporting.TableGroup> collection)
{
    foreach (var group in collection)
    {
        yield return group;
 
        foreach (var subGroup in Flatten(group.ChildGroups))
            yield return subGroup;
    }
}
 
private static PropertyInfo _tablecolumnWidthProperty = null;
public static PropertyInfo TableColumnWidthProperty
{
    get
    {
        if (_tablecolumnWidthProperty == null)
            _tablecolumnWidthProperty = typeof(Telerik.Reporting.Processing.TableColumn).GetProperty("Width", BindingFlags.Instance | BindingFlags.NonPublic);
 
        return _tablecolumnWidthProperty;
    }
}
 
private static PropertyInfo _textboxCanGrowProperty = null;
public static PropertyInfo TextboxCanGrowProperty
{
    get
    {
        if (_textboxCanGrowProperty == null)
            _textboxCanGrowProperty = typeof(Telerik.Reporting.Processing.TextItemBase).GetProperty("CanGrow", BindingFlags.Instance | BindingFlags.NonPublic);
 
        return _textboxCanGrowProperty;
    }
}


Thanks
Steve
Steven
Top achievements
Rank 1
 answered on 27 Dec 2012
5 answers
751 views
I have a crosstab report which shows stats for permits submitted over a 6 year period. I have them broken down by several different parameters. I have the latest year column set to be shaded a dark grey and the 2nd, 4th, and 6th years shaded a light grey. I sort them into the years based on a date permit was approved. My problem is that if here is no permits that match one of the categories it doesn't shade that box. It doesn't make the report look good with breaks in the shading. I have it filling 0's for the null cells by checking for nulls but it still doesn't shade the cells.

Any help would be greatly appreciated.
IvanY
Telerik team
 answered on 27 Dec 2012
3 answers
321 views
Hello,

We are running on an older version of the Reporting  2011 Q2 but need to user the native header features.

I have set the device information header variables (they work fine for grid lines) to true for UseNativePageHeader but the report is rendered with the header at the top of the page basically ignoring the variable.

Is there anything I am missing?
Petio Petkov
Telerik team
 answered on 27 Dec 2012
3 answers
1.0K+ views
Hi Telerik Team,

I have a table in one of my reports and I now want to change the background color of specific rows, depending of data which is contained in the row.

How can I achieve that?

Thanks in advance.
IvanY
Telerik team
 answered on 27 Dec 2012
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?