Telerik Forums
Reporting Forum
3 answers
641 views
I'm working on Telerik Report Designer (to be specific, not Visual studio)
I'm facing problem in passing multivalue parameter to proc
In proc, I have the parameter as: @parTest varchar(1000)

select data into #Temp1 from Products where data in (@parTest)

If I select a single value, the report runs good
But, if multiple values are selected, then I see the error in preview as :
'Procedure xyz has too many arguments specified'

how to pass MULTIVALUE parameter to db from telerik REPORT DESIGNER?
and how to use that parameter in proc ?

In some thread I saw:
"How do you pass multi value paramas to sql datasource?  I am trying to pass multi-value params but receive error  as below.  Would you please advise on how to do this or do you have an example/sample for multi-value params report somewhere that I can download? 
Failed to convert parameter value from a Object[] to a String.
------------- InnerException -------------
Object must implement IConvertible."

Reply:
"The DataSource Components don't work out of the box with a MultiValue Report Parameter since the current implementation is based on ADO.NET and does not allow you to pass a collection of values (set, array). Thus, the SqlDataSourceParameter accepts only single values corresponding to the SqlDataSourceParameter.DbType property. Although this is a known limitation of ADO.NET and not a problem of our product, we're currently working on possible solution for it and it would be part of the upcoming Q2 SP1."

fyi, I'm using Q2 - 2012

I also see:
"Currently the new DataSource Components don't work out of the box with a MultiValue Report Parameter. In order to use a multivalue Parameter you will have to create User Function that bulds a String from multivalue Parameter (Object[]) and use that string to set a SqlDataSource SelectCommand in the NeedDataSource event. Check out the attached sample project that illustrates how this scenario can be accomplished."

how can add the function in telerik report DESIGNER?
Peter
Telerik team
 answered on 13 Sep 2012
1 answer
71 views
I want to bind a subset of my data source to chart object on my Telerik report and I cannot figure out how to accomplish this.

public class MyObject
{
    public int ID { get; set; }
    public string Name { get; set;}
    public List<MySubObject> SubList { get; set; }
}
 
public class MySubObject
{
    public int ID { get; set; }
    public decimal Percentage { get; set; }
    public string SurveyGroupName { get; set;}
}

I want to bind my chart object to the SubList property in the MyObject class.



Michael Kniskern
Top achievements
Rank 1
 answered on 13 Sep 2012
1 answer
86 views
Hi I am currently trying to create a report that contains times used on each customer each specific day, currently I am stuck at ordering them by weekday so I get

----------
Monday

Tuesday

Wednesday

Thursday

Friday
'''''''''''''''''''

Basically I have a list of time entries that contains something like
String customername
int customerid
custom class Update
---
custom classs(Relevant members):
DateTime LastUpdate
so there might be more times for one customer each day like this

snippet from list
.....
name=x, timespent=1 update=10.10.10 10:10:10
name x, itmespent=2 update = 10.10.10 11:11:11
.....

apart from this I want a total number at the end of each day (hours spent that day) and a total at the end of the report, total time used on each customer and total time used that week, here's the desired result

___________________
[header]
monday
customer1  2
customer2 2
x:::::::::::::::::3
total time spent day 7
[the monday block for the rest of the days in a week]
Total
Customer1 20
customer 2 10
x:::::::::::::::::10
total time spent 40
'''''''''''''''''''''''''''''''''''''''''''''''''''''
at the current point I created a group that is sorted by each day, from here I am blank
Anders
Top achievements
Rank 1
 answered on 13 Sep 2012
1 answer
150 views
Hi
--------------------------
EDIT:
I am really sorry for the long post, tell me if you want it to a pastebin, the problem here after some debugging is that the structure seems ok after going through properties when opening it in debugging mode, the really big problem for me is that I canot get any kind of output from the report telling me what is wrong and why it's thinking there is no report. like some kind of exception catching
--------------------------
I am using the Q2 2010 SP1 4.1 and telerik radcontrols for winforms Q1 2012 SP1 and I just created a report by using some dynamic coding in the report(which is embeded in a winform), at first I copy pasted and edited a lot from some code made in designtime, however as this resulted in ugly (but working) code I created a class to do it for me however it now shows no report, just a message saying "Object reference not set to an instance of an object."

this is my weekreport.cs class containing the definition class for the report, the uglypopulate method is the one which works, the almostpopulatelikeabaws is the new code I created with the help class

using System.Collections.Generic;
using System.Data;
using BE;
 
namespace TimeRegisterClient
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using Telerik.Reporting;
    using Telerik.Reporting.Drawing;
 
    /// <summary>
    /// Summary description for WeekReport.
    /// </summary>
    public partial class TidsRapport : Telerik.Reporting.Report
    {
        private void setEmptyRowStandard(Telerik.Reporting.TextBox RowBox)
        {
            RowBox.Style.BorderWidth.Default = new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Point);
            RowBox.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(12D, Telerik.Reporting.Drawing.UnitType.Point);
            RowBox.Value = "";
        }
        private void setTotalRowStandard(Telerik.Reporting.TextBox RowBox)
        {
            RowBox.Style.BorderWidth.Default = new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Point);
            RowBox.Style.BorderWidth.Top = new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Point);
            RowBox.Style.BorderStyle.Top = BorderType.Solid;
            RowBox.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(12D, Telerik.Reporting.Drawing.UnitType.Point);
            RowBox.Style.TextAlign = HorizontalAlign.Left;
            RowBox.Style.VerticalAlign = VerticalAlign.Middle;
        }
 
        private void setCustomerRowStandard(Telerik.Reporting.TextBox RowBox)
        {
            RowBox.Style.BorderWidth.Default = new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Point);
            RowBox.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(12D, Telerik.Reporting.Drawing.UnitType.Point);
            RowBox.Style.TextAlign = HorizontalAlign.Left;
            RowBox.Style.VerticalAlign = VerticalAlign.Middle;
        }
        private void setDayHeaderStandard(Telerik.Reporting.TextBox RowBox)
        {
            RowBox.Style.BorderWidth.Default = new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Point);
            RowBox.Style.BorderWidth.Bottom = new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Point); ;
            RowBox.Style.BorderStyle.Bottom = BorderType.Solid;
            RowBox.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(12D, Telerik.Reporting.Drawing.UnitType.Point);
            RowBox.Style.VerticalAlign = VerticalAlign.Middle;
        }
        private void setColumnStandard(Telerik.Reporting.TextBox RowBox,Unit height)
        {
            RowBox.Style.Font.Underline = true;
            RowBox.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(14D, Telerik.Reporting.Drawing.UnitType.Point);
            RowBox.Style.BorderWidth.Default = new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Point);
            RowBox.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
            RowBox.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.4999997615814209D, Telerik.Reporting.Drawing.UnitType.Cm),height);
        }
        public TidsRapport(Dictionary<DayOfWeek, Dictionary<int, UpdCus>> values, UserDetail user, DateTime from, DateTime to)
            : this()
        {
            FromTime = from;
            ToTime = to;
            WriteDate();
            TxtFraBruger.Value += user.Name;
             
            populatealmostlikeabaws(values);
           //uglypopulate(values);
            
            
             
 
        }
        #region new
        private void populatealmostlikeabaws(Dictionary<DayOfWeek, Dictionary<int, UpdCus>> values)
        {
            PointU l =
                new PointU(
                    new Unit(0.299999862909317D, UnitType.Cm),
                    new Unit(4.5999999046325684D, UnitType.Cm));
            SizeU s = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(12.600000381469727D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(2.4000000953674316D, Telerik.Reporting.Drawing.UnitType.Cm));
            ReportTableGenerator tg = new ReportTableGenerator(s, l, new Telerik.Reporting.Drawing.Unit(0.6D, Telerik.Reporting.Drawing.UnitType.Cm));
 
            setColumnStandard(tg.Nextbox, tg.DefaultRowHeight);
            tg.Nextbox.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Left;
            tg.Nextbox.Value = "Dag/Kunde";
            tg.addColumn(new Telerik.Reporting.Drawing.Unit(10.09999942779541D, Telerik.Reporting.Drawing.UnitType.Cm));
 
            setColumnStandard(tg.Nextbox, tg.DefaultRowHeight);
            tg.Nextbox.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center;
            tg.Nextbox.Value = "Tider";
            tg.addColumn(new Telerik.Reporting.Drawing.Unit(2.4999997615814209D, Telerik.Reporting.Drawing.UnitType.Cm));
 
            tg.DefaultRowHeight = new Telerik.Reporting.Drawing.Unit(0.5D, Telerik.Reporting.Drawing.UnitType.Cm);
            Dictionary<int, UpdCus> total = new Dictionary<int, UpdCus>();
            DayOfWeek DayOfWork = FromTime.DayOfWeek;
 
            for (int i = 0; i < (values.Keys.Count + 1); i++)
            {
                Boolean notlast = i < values.Keys.Count;
 
                setDayHeaderStandard(tg.Nextbox);
                tg.Nextbox.Style.TextAlign = HorizontalAlign.Left;
                tg.Nextbox.Style.Padding.Left = new Unit(1.5, UnitType.Cm);
                tg.Nextbox.Style.Font.Bold = true;
 
                if (notlast)
                    tg.Nextbox.Value = DayOfWork.ToString();
                else
                    tg.Nextbox.Value = "Samlet tid";
 
                tg.addRowCell();
 
                setDayHeaderStandard(tg.Nextbox);
                tg.Nextbox.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center;
                tg.addRowCell();
 
                tg.appendRow();
 
                Decimal weekHours = 0;
                #region Customer Times loop
 
                Dictionary<int, UpdCus> temp;
                if (notlast)
                    temp = values[DayOfWork];
                else
                    temp = total;
                foreach (UpdCus c in temp.Values)
                {
                    if (notlast)
                    {
                        if (!total.ContainsKey(c.CustomerId))
                        {
                            total.Add(c.CustomerId, c);
                        }
                        else
                        {
                            total[c.CustomerId].update.TimeSpent += c.update.TimeSpent;
                        }
                    }
 
 
 
                    setCustomerRowStandard(tg.Nextbox);
                    tg.Nextbox.Style.Padding.Left = new Unit(2.5, UnitType.Cm);
                    tg.Nextbox.Value = c.CustomerName;
 
                    tg.addRowCell();
                    setCustomerRowStandard(tg.Nextbox);
                    tg.Nextbox.Value = c.update.TimeSpent.ToString();
 
                    tg.addRowCell();
                    tg.appendRow();
 
                    weekHours += c.update.TimeSpent;
                }
                #endregion
                #region Total Row add
 
 
                setTotalRowStandard(tg.Nextbox);
 
                tg.Nextbox.Style.Padding.Left = new Unit(2.5, UnitType.Cm);
                tg.Nextbox.Value = "total tid registreret " + (notlast ? DayOfWork + "" : "I alt");
                tg.addRowCell();
                setTotalRowStandard(tg.Nextbox);
                tg.Nextbox.Value = weekHours + "";
                tg.addRowCell();
                tg.appendRow();
                #endregion
 
                #region empty row add
                if (notlast)
                {
                    setEmptyRowStandard(tg.Nextbox);
                    tg.addRowCell();
                    setEmptyRowStandard(tg.Nextbox);
                    tg.addRowCell();
                    tg.appendRow();
 
 
                }
                #endregion
 
                DayOfWork++;
            }
            tg.finishTable();
            DetailSection.Items.Add(tg.table);
        }
        #endregion
 
        #region old
        private void uglypopulate(Dictionary<DayOfWeek, Dictionary<int, UpdCus>> values)
        {
 
            Telerik.Reporting.Table DataTable;
            List<Telerik.Reporting.ReportItemBase> tableItems = new List<ReportItemBase>();
            Telerik.Reporting.TextBox FirstDay = new Telerik.Reporting.TextBox();
            Telerik.Reporting.TextBox empty = new Telerik.Reporting.TextBox();
            DataTable = new Telerik.Reporting.Table();
            DetailSection.Items.Add(DataTable);
            Telerik.Reporting.TextBox TextHeader;
            Telerik.Reporting.TextBox HourHeader;
            Telerik.Reporting.TableGroup tableGroup1 = new Telerik.Reporting.TableGroup();
            Telerik.Reporting.TableGroup tableGroup2 = new Telerik.Reporting.TableGroup();
            Telerik.Reporting.TableGroup tableGroup3 = new Telerik.Reporting.TableGroup();
 
 
            TextHeader = new Telerik.Reporting.TextBox();
            HourHeader = new Telerik.Reporting.TextBox();
 
            TextHeader = new Telerik.Reporting.TextBox();
            HourHeader = new Telerik.Reporting.TextBox();
            DataTable.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(new Telerik.Reporting.Drawing.Unit(10.09999942779541D, Telerik.Reporting.Drawing.UnitType.Cm)));
            DataTable.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(new Telerik.Reporting.Drawing.Unit(2.4999997615814209D, Telerik.Reporting.Drawing.UnitType.Cm)));
            DataTable.Body.Rows.Add(new Telerik.Reporting.TableBodyRow(new Telerik.Reporting.Drawing.Unit(0.6D, Telerik.Reporting.Drawing.UnitType.Cm)));
            DataTable.Body.SetCellContent(0, 0, FirstDay);
            DataTable.Body.SetCellContent(0, 1, empty);
            tableGroup1.ReportItem = TextHeader;
            tableGroup2.ReportItem = HourHeader;
            DataTable.ColumnGroups.Add(tableGroup1);
            DataTable.ColumnGroups.Add(tableGroup2);
            tableItems.AddRange(new Telerik.Reporting.ReportItemBase[] {
            FirstDay,
            empty,
            TextHeader,
            HourHeader});
            DataTable.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.299999862909317D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(4.5999999046325684D, Telerik.Reporting.Drawing.UnitType.Cm));
            DataTable.Name = "DataTable";
 
            DataTable.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(12.600000381469727D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(2.4000000953674316D, Telerik.Reporting.Drawing.UnitType.Cm));
 
 
            TextHeader.Name = "TextHeader";
            TextHeader.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(10.09999942779541D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.6D, Telerik.Reporting.Drawing.UnitType.Cm));
            TextHeader.Style.BorderWidth.Default = new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Point);
 
 
            TextHeader.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(14D, Telerik.Reporting.Drawing.UnitType.Point);
            TextHeader.Style.Font.Underline = true;
            TextHeader.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Left;
            TextHeader.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
            TextHeader.Value = "Dag/Kunde";
 
            HourHeader.Name = "HourHeader";
            HourHeader.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.4999997615814209D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.6D, Telerik.Reporting.Drawing.UnitType.Cm));
            HourHeader.Style.BorderWidth.Default = new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Point);
 
            HourHeader.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(14D, Telerik.Reporting.Drawing.UnitType.Point);
            HourHeader.Style.Font.Underline = true;
            HourHeader.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center;
            HourHeader.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
            HourHeader.Value = "Tider";
            Boolean made = true;
            int row = 1;
            Dictionary<int, UpdCus> total = new Dictionary<int, UpdCus>();
            DayOfWeek DayOfWork = FromTime.DayOfWeek;
            for (int i = 0; i < (values.Keys.Count + 1); i++)
            {
                Boolean notlast = i < values.Keys.Count;
                if (made)
                {
                    made = false;
                }
                else
                {
                    DataTable.Body.Rows.Add(new Telerik.Reporting.TableBodyRow(new Telerik.Reporting.Drawing.Unit(0.6D, Telerik.Reporting.Drawing.UnitType.Cm)));
                    FirstDay = new Telerik.Reporting.TextBox();
                    empty = new Telerik.Reporting.TextBox();
                    DataTable.Body.SetCellContent(row, 0, FirstDay);
                    DataTable.Body.SetCellContent(row, 1, empty);
                    row++;
                    tableItems.AddRange(new Telerik.Reporting.ReportItemBase[] {
            FirstDay,
            empty});
 
                }
                TableGroup t = new TableGroup();
                tableGroup3.ChildGroups.Add(t);
                FirstDay.Name = DayOfWork.ToString();
                //FirstDay.Size = new SizeU(new Unit(10.09999942779541D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.6D, Telerik.Reporting.Drawing.UnitType.Cm));
                FirstDay.Style.BorderWidth.Default = new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Point);
                FirstDay.Style.BorderWidth.Bottom = new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Point); ;
                FirstDay.Style.BorderStyle.Bottom = BorderType.Solid;
                FirstDay.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(12D, Telerik.Reporting.Drawing.UnitType.Point);
                FirstDay.Style.TextAlign = HorizontalAlign.Left;
                FirstDay.Style.VerticalAlign = VerticalAlign.Middle;
                FirstDay.Style.Padding.Left = new Unit(1.5, UnitType.Cm);
 
                FirstDay.Style.Font.Bold = true;
                if (notlast)
                    FirstDay.Value = DayOfWork.ToString();
                else
                    FirstDay.Value = "Samlet tid";
 
 
 
 
                // empty.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.4999997615814209D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.6D, Telerik.Reporting.Drawing.UnitType.Cm));
                empty.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center;
                empty.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
                empty.Style.BorderWidth.Default = new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Point);
                empty.Style.BorderWidth.Bottom = new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Point);
                empty.Style.BorderStyle.Bottom = BorderType.Solid;
                empty.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(12D, Telerik.Reporting.Drawing.UnitType.Point);
                Decimal weekHours = 0;
                #region Customer Times loop
 
                Dictionary<int, UpdCus> temp;
                if (notlast)
                    temp = values[DayOfWork];
                else
                    temp = total;
                foreach (UpdCus c in temp.Values)
                {
                    if (notlast)
                    {
                        if (!total.ContainsKey(c.CustomerId))
                        {
                            total.Add(c.CustomerId, c);
                        }
                        else
                        {
                            total[c.CustomerId].update.TimeSpent += c.update.TimeSpent;
                        }
                    }
                    DataTable.Body.Rows.Add(new Telerik.Reporting.TableBodyRow(new Telerik.Reporting.Drawing.Unit(0.5D, Telerik.Reporting.Drawing.UnitType.Cm)));
                    Telerik.Reporting.TextBox Customer = new Telerik.Reporting.TextBox();
                    Telerik.Reporting.TextBox Time = new Telerik.Reporting.TextBox();
                    empty.Name = DayOfWork.ToString() + "e";
                    DataTable.Body.SetCellContent(row, 0, Customer);
                    DataTable.Body.SetCellContent(row, 1, Time);
                    row++;
                    tableItems.AddRange(new Telerik.Reporting.ReportItemBase[] {
            Customer,
            Time});
                    TableGroup t1 = new TableGroup();
                    tableGroup3.ChildGroups.Add(t1);
                    Customer.Name = DayOfWork.ToString() + c.CustomerName;
                    // Customer.Size = new SizeU(new Unit(10.09999942779541D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.5D, Telerik.Reporting.Drawing.UnitType.Cm));
                    Customer.Style.BorderWidth.Default = new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Point);
                    Customer.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(12D, Telerik.Reporting.Drawing.UnitType.Point);
                    Customer.Style.Padding.Left = new Unit(2.5, UnitType.Cm);
                    Customer.Style.TextAlign = HorizontalAlign.Left;
                    Customer.Style.VerticalAlign = VerticalAlign.Middle;
                    Customer.Value = c.CustomerName;
                    //Console.WriteLine(c.CustomerName + ": " + c.update.TimeSpent);
                    //TableGroup n = new TableGroup();
                    // n.Grouping.Add(c.CustomerName);
                    // DataTable.RowGroups.Add(n);
                    Time.Name = DayOfWork.ToString() + "T";
                    Time.Style.BorderWidth.Default = new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Point);
                    //Time.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.4999997615814209D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.5D, Telerik.Reporting.Drawing.UnitType.Cm));
                    Time.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Left;
                    Time.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
                    Time.Value = c.update.TimeSpent.ToString();
                    weekHours += c.update.TimeSpent;
                }
                #endregion
                #region Total Row add
 
                DataTable.Body.Rows.Add(new Telerik.Reporting.TableBodyRow(new Telerik.Reporting.Drawing.Unit(0.5D, Telerik.Reporting.Drawing.UnitType.Cm)));
                Telerik.Reporting.TextBox CustomerTotal = new Telerik.Reporting.TextBox();
                Telerik.Reporting.TextBox TimeTotal = new Telerik.Reporting.TextBox(); empty.Name = DayOfWork.ToString() + "e";
                DataTable.Body.SetCellContent(row, 0, CustomerTotal);
                DataTable.Body.SetCellContent(row, 1, TimeTotal);
                row++;
                tableItems.AddRange(new Telerik.Reporting.ReportItemBase[] {
            CustomerTotal,
            TimeTotal});
                TableGroup t2 = new TableGroup();
                tableGroup3.ChildGroups.Add(t2);
                CustomerTotal.Name = DayOfWork.ToString() + "TotalDescription" + notlast;
                //CustomerTotal.Size = new SizeU(new Unit(10.09999942779541D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.5D, Telerik.Reporting.Drawing.UnitType.Cm));
                CustomerTotal.Style.BorderWidth.Default = new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Point);
                CustomerTotal.Style.BorderWidth.Top = new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Point);
                CustomerTotal.Style.BorderStyle.Top = BorderType.Solid;
 
                CustomerTotal.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(12D, Telerik.Reporting.Drawing.UnitType.Point);
                CustomerTotal.Style.Padding.Left = new Unit(2.5, UnitType.Cm);
                CustomerTotal.Style.TextAlign = HorizontalAlign.Left;
                CustomerTotal.Style.VerticalAlign = VerticalAlign.Middle;
                CustomerTotal.Value = "total tid registreret " + (notlast ? DayOfWork + "" : "I alt");
 
                TimeTotal.Name = DayOfWork.ToString() + "TotalTimeTotal" + notlast;
                //TimeTotal.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.4999997615814209D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.5D, Telerik.Reporting.Drawing.UnitType.Cm));
                TimeTotal.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Left;
                TimeTotal.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
                TimeTotal.Style.BorderWidth.Default = new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Point);
                TimeTotal.Style.BorderWidth.Top = new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Point);
                TimeTotal.Style.BorderStyle.Top = BorderType.Solid;
                TimeTotal.Value = weekHours + "";
                #endregion
 
                #region empty row add
                if (notlast)
                {
                    DataTable.Body.Rows.Add(new Telerik.Reporting.TableBodyRow(new Telerik.Reporting.Drawing.Unit(0.5D, Telerik.Reporting.Drawing.UnitType.Cm)));
                    Telerik.Reporting.TextBox CustomerEmpty = new Telerik.Reporting.TextBox();
                    Telerik.Reporting.TextBox TimeEmpty = new Telerik.Reporting.TextBox(); empty.Name = DayOfWork.ToString() + "e";
                    DataTable.Body.SetCellContent(row, 0, CustomerEmpty);
                    DataTable.Body.SetCellContent(row, 1, TimeEmpty);
                    row++;
                    tableItems.AddRange(new Telerik.Reporting.ReportItemBase[] {
            CustomerEmpty,
            TimeEmpty});
                    TableGroup t3 = new TableGroup();
                    tableGroup3.ChildGroups.Add(t3);
                    CustomerEmpty.Name = DayOfWork.ToString() + "dEmpty";
                    // CustomerEmpty.Size = new SizeU(new Unit(10.09999942779541D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.5D, Telerik.Reporting.Drawing.UnitType.Cm));
                    CustomerEmpty.Style.BorderWidth.Default = new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Point);
 
                    CustomerEmpty.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(12D, Telerik.Reporting.Drawing.UnitType.Point);
                    CustomerEmpty.Style.Padding.Left = new Unit(2.5, UnitType.Cm);
                    CustomerEmpty.Style.TextAlign = HorizontalAlign.Left;
                    CustomerEmpty.Style.VerticalAlign = VerticalAlign.Bottom;
                    CustomerEmpty.Value = "";
 
                    TimeEmpty.Name = DayOfWork.ToString() + "EmptyTime";
                    //TimeEmpty.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2.4999997615814209D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.5D, Telerik.Reporting.Drawing.UnitType.Cm));
                    TimeEmpty.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Left;
                    TimeEmpty.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Bottom;
                    TimeEmpty.Style.BorderWidth.Default = new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Point);
 
                    TimeEmpty.Value = "";
                }
                #endregion
 
                DayOfWork++;
            }
            DataTable.Items.AddRange(tableItems.ToArray());
 
            DataTable.RowGroups.Add(tableGroup3);
            tableGroup3.Grouping.AddRange(new Telerik.Reporting.Data.Grouping[] {
            new Telerik.Reporting.Data.Grouping("")});
            tableGroup3.Name = "DetailGroup";
        }
 
            #endregion
 
        public TidsRapport()
        {
            InitializeComponent();
 
        }
 
        private void WriteDate()
        {
 
 
            TitleTextBox.Value += FromTime.ToShortDateString() + " til " + ToTime;
 
            TitleTextBox.Width += TitleTextBox.Width + new Unit(8.0, UnitType.Cm);
 
        }
 
        protected DateTime FromTime { get; set; }
 
        protected DateTime ToTime { get; set; }
    }
 
}

And this is the helper class

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using Telerik.Reporting;
using Telerik.Reporting.Data;
using Telerik.Reporting.Drawing;
 
namespace TimeRegisterClient
{
    class ReportTableGenerator
    {
        public int CurrentRow { get; private set; }
        public int CurrentColumn { get; private set; }
        public int MaxColumns { get; private set; }
         
        public TextBox Nextbox { get; set; }
        private List<TextBox> nextRow { get; set; }
        private Table GeneratedTable;
        public Table table
        {
            get
            {
                if (isFinished)
                    return GeneratedTable;
                return null;
            }
            private set { GeneratedTable = value; }
        }
        public Boolean isFinished { get; private set; }
        public Boolean ColumnsSet { get; set; }
        private List<ReportItemBase> tableItems { get; set; }
        public Unit DefaultRowHeight { get; set; }
        public ReportTableGenerator(Unit colHeight)
        {
            ColumnsSet = false;
            CurrentColumn = 0;
            CurrentRow = 0;
            MaxColumns = 0;
            DefaultRowHeight = new TextBox().Size.Height;
            RowGroup = new TableGroup();
            tableItems = new List<ReportItemBase>();
            GeneratedTable = new Table();
            //GeneratedTable.Body.Rows.Add(new TableBodyRow(colHeight));
            resetRow();
            resetBoxes();
            GeneratedTable.Name = "GeneratedTable";
        }
        public ReportTableGenerator( SizeU size,PointU location,Unit columnheight):this(columnheight)
       {
           setDimensions(size,location);
       }
         
        public void finishTable()
        {
            GeneratedTable.Items.AddRange(tableItems.ToArray());
            GeneratedTable.RowGroups.Add(RowGroup);
            RowGroup.Grouping.AddRange(new Grouping[]
                                           {
                                            new Grouping("")
                                           });
            RowGroup.Name = "DetailGroup";
            isFinished = true;
        }
 
        private void resetRow()
        {
            nextRow=new List<TextBox>();
        }
 
         
 
        public void resetBoxes()
        {
            Nextbox = new TextBox();
        }
        
        public void setDimensions(SizeU size, PointU location)
        {
            GeneratedTable.Location = location;
            GeneratedTable.Size = size;
        }
        
        public void addRowCell()
        {
            nextRow.Add(Nextbox);
            resetBoxes();
        }
 
         
 
        public void appendRow()
        {
            int dif = nextRow.Count - (MaxColumns+1);
            if (dif > 0)
                throw new Exception("you added " + dif + " more cells to a row than possible");
            if (!ColumnsSet)
            {
                ColumnsSet = true;
                completeColumns();
            }
            GeneratedTable.Body.Rows.Add(new TableBodyRow(DefaultRowHeight));
            TableGroup newGroup = new TableGroup();
            RowGroup.ChildGroups.Add(newGroup);
            foreach (TextBox t in nextRow)
            {
                if (t.Name.Equals(""))
                    t.Name = CurrentRow + "," + CurrentColumn;
                addCell(t);
            }
            resetRow();
        }
        
        private void addCell(TextBox t)
        {
            GeneratedTable.Body.SetCellContent(CurrentRow,CurrentColumn,t);
            iterateCell();
            tableItems.Add(t);
        }
 
        public void addColumn(Unit Width)
        {
            if(ColumnsSet)
                throw new Exception("You cannot add anymore columns at the given time");
            GeneratedTable.Body.Columns.Add(new TableBodyColumn(Width));
            TableGroup cgroup = new TableGroup();
            MaxColumns++;
             
            cgroup.ReportItem = Nextbox;
            GeneratedTable.ColumnGroups.Add(cgroup);
            addCell(Nextbox);
            resetBoxes();
        }
 
        
        private void completeColumns()
        {
            MaxColumns--;
            iterateCell();
        }
        private void iterateCell()
        {
            if (CurrentColumn >= MaxColumns)
            {
                CurrentColumn = 0;
                CurrentRow++;
            }
            else
            {
                CurrentColumn++;
            }
        }
 
        private TableGroup RowGroup { get; set; }
 
         
    }
}

I also attached a picture of how the report looks once generated, I removed the names of the customers though hope you don't mind

any help is appreciated :)

Update:
I tried adding this code block just to test if it was the generator class or the code using it that was the problem, and it's the generatorclass. This is the code I used to show one row with and I still got the problem
PointU l =
                  new PointU(
                      new Unit(0.299999862909317D, UnitType.Cm),
                      new Unit(4.5999999046325684D, UnitType.Cm));
            SizeU s = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(12.600000381469727D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(2.4000000953674316D, Telerik.Reporting.Drawing.UnitType.Cm));
            ReportTableGenerator rg = new ReportTableGenerator(s, l, new Telerik.Reporting.Drawing.Unit(0.6D, Telerik.Reporting.Drawing.UnitType.Cm));
            rg.Nextbox.Value = "ctest1";
            rg.addColumn(new Unit(0.6D, UnitType.Cm));
            rg.Nextbox.Value = "ctest2";
            rg.addColumn(new Unit(0.6D, UnitType.Cm));
            rg.Nextbox.Value = "row1";
            rg.addRowCell();
            rg.Nextbox.Value = "row12";
            rg.appendRow();
            rg.finishTable();
            DetailSection.Items.Add(rg.table);
Anders
Top achievements
Rank 1
 answered on 13 Sep 2012
1 answer
107 views
Hello,

I tried Telerik Reporting Online demo on Ipad, however it seems none of the scroll bar is working on IPAD.
Is it known issue?
Is there any workaround solution for this? thank you
Peter
Telerik team
 answered on 13 Sep 2012
1 answer
117 views
I have a report that consist of multiple reports.  For example.

dim rpt1 s new report1
dim rpt2 as new report2
Dim reportBook as new Telerk.Reporting.ReportBook()
reportBook.Reports.Add(rpt1)
reportBook.Reports.Add(rpt2)

if rtp1 has no detail lines then I want to be able to suppress the entire page so that the first report I added basically just doesn't show.  I wish it was as easy as just not adding the report to the reportbook but I just can't do this being I don't know yet if there are detail lines.

How can I suppress this report so that it don't show and that also the page numbering is correct?

thanks for your help.
Squall
Top achievements
Rank 1
 answered on 13 Sep 2012
1 answer
376 views
Hello,

I'm considering working with Telerik Reporting but I want to make sure that text boxes can overlap images in the report.  For example, i have an image showing dimensions.  I plan on placing text boxes bound to data over the image where the dimensions are shown.  Can Telerik do something like this?

thansk
francis
Chavdar
Telerik team
 answered on 12 Sep 2012
1 answer
233 views
Hi,

I would like to remove Arrow buttons (Left and Right) from Report Viewer Naviagtion tool Bar.
How can I remove those?

Thanks,
Asit
Chavdar
Telerik team
 answered on 12 Sep 2012
2 answers
129 views
Hello,

I have a table pulling data from a stored procedure, but due to the way the database was set up, some of the strings were cut off. I cannot change the structure of the database, so I was wondering if it was possible to add the part of the string cut off in the [=Fields.whatever] part of the cell.

Here's a simplified example of what I mean....

The table was created like this:
CREATE TABLE ThingColor(
id int PRIMARY KEY,
thing varchar(20),
color varchar(5))

And data inserted:
INSERT INTO ThingColor
VALUES (1, 'sky', 'blue'), (2, 'sun', 'yello');

My stored procedure calls 'thing' and 'color', but the "yello" is missing its w. When I get to the Telerik Report table, is there something similar to an if statement function where, if the string = 'yello', then display 'yellow', that I can add to my [=Fields.color] box?
Matthew
Top achievements
Rank 1
 answered on 12 Sep 2012
0 answers
61 views
I have a telerik report service (Telerik.Reporting.Service.ReportService) that is used by silverlight application. I want also use the same service for iPad version of the application.
The way we are going to implement:
Create a proxy service, that will send requests to ReportService. This proxy service will have 2 methods: RenderAndCache, GetPage. I want to get a page with html format and then just return it to iPad client. But the markup that we got from ReportService has a strange links for images.

Example:
<img alt="Chart" src="&amp;StreamID=3nxve03monw" width="718px" height="600px" /></td>

I want to get the following link
[ApplicationRoot]/ReportService.svc/resources/getrenderstream?instanceID=smth&name=3nxve03monw".

I understand that it's possible just to replace it manually. But I'm interested if there is a way of getting such kind of links from the box.

Alex
Top achievements
Rank 1
 asked on 12 Sep 2012
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?