Telerik Forums
Reporting Forum
2 answers
256 views
I have a report that has some chart and tables inside.
Chart is working properly. For Table i have created nested classes and i have assigned a those classes to related table.

Description:
I have MainTable which shows the list of CareAreas.
Inside Main Table i have another table called Detaildetable1 which shows the list of Questions.and Inside the DetailTable1
There is one more table DetailTable2, which shows the Resident's Information.

I have created 3 classes.
public class CareAreaDetail
    {
        private String _care;
        private QCIDetail[] _qci;
        public String CareAreaQCITag
        {
            get
            {
                return _care;
            }
            set
            {
                _care = value;
            }
        }
        public QCIDetail[] qci
        {
            get
            {
                return _qci;
            }
            set
            {
                _qci = value;
            }
        }
    }
    public class QCIDetail
    {
        private String _qcisn;
        private ResidentDetail[] _resindet;
        public String QuestionShortName
        {
            get { return _qcisn; }
            set { _qcisn = value; }
        }

        public ResidentDetail[] resDetail
        {
            get
            {
                return _resindet;
            }
            set
            {
                _resindet = value;
            }
        }
    }
    public class ResidentDetail
    {
        private String _resident, _room;
        private DateTime _adate;
        //public String QuestionShortName { get;set;}
        public String ResidentName
        {
            get
            {
                return _resident;
            }
            set
            {
                _resident = value;
            }
        }
        public String Room
        {
            get
            {
                return _room;
            }
            set
            {
                _room = value;
            }
        }
        public DateTime AssessmentDate
        {
            get
            {
                return _adate;
            }
            set
            {
                _adate = value;
            }
        }
    }

Now on Main Table's NeedDataSource event i have assigned the Array Object of CareAreaDetail Class.
For DetailedTable1's needdatasource property i have assigned QCIDetailed Class object and for DetailTable2, ResidentDetail  class object.

Now where report is generated it shows proper Data in MainTable. bt in DetailTable1 and DetailTable2 it shows the same data for all the rows. i.e. for DetailTable1 it shows the data at index 0 in the QCITable class array in all rows and
for DetailTable2 it shows the data at index 0 in the ResidentDetail class array.

Here is the code.

private void DetailTable2_NeedDataSource_1(object sender, EventArgs e)
        {
            Processing.Table table = (Processing.Table)sender;
            DetailTable2.DataSource = table.DataObject["resDetail"];
        }

        private void DetailTable1_NeedDataSource_1(object sender, EventArgs e)
        {
            Processing.Table table = (Processing.Table)sender;
            DetailTable1.DataSource = table.DataObject["qci"];
        }

        private void MainTable_NeedDataSource_1(object sender, EventArgs e)
        {
            DataTable dt = GetAllResponses();
            DataTable DistinctCareAreaTable = SelectDistinct(dt, "CareArea");
            CareAreaDetail[] cad = new CareAreaDetail[DistinctCareAreaTable.Rows.Count];
            int i = 0;
            foreach (DataRow row in DistinctCareAreaTable.Rows)
            {
                cad[i] = new CareAreaDetail();
                cad[i].CareAreaQCITag = "Care Area: " + row[0].ToString().Trim() + " (" + dt.Select("CareArea='" + row[0].ToString().Trim() + "'")[0]["QuestionTag"].ToString() + ")";
                DataTable dtTemp = dt.Copy();
                dtTemp.Clear();
                DataRow[] TempDataRow = dt.Select("CareArea='" + row[0].ToString() + "'");
                foreach (DataRow dr in TempDataRow)
                    dtTemp.LoadDataRow(dr.ItemArray, false);
                DataTable DistinctQCITable = SelectDistinct(dtTemp, "QuestionShortName");
                QCIDetail[] qd = new QCIDetail[DistinctQCITable.Rows.Count];
                int j = 0;
                foreach (DataRow drQCI in DistinctQCITable.Rows)
                {
                    qd[j] = new QCIDetail();
                    qd[j].QuestionShortName = drQCI[0].ToString();

                    DataRow[] ResidentDataRow = dt.Select("QuestionShortName='" + drQCI[0].ToString() + "'");
                    ResidentDetail[] resDetail = new ResidentDetail[ResidentDataRow.Length];
                    int k = 0;
                    foreach (DataRow drRes in ResidentDataRow)
                    {
                        resDetail[k] = new ResidentDetail();
                        resDetail[k].ResidentName = drRes["Resident"].ToString();
                        resDetail[k].Room = drRes["Room"].ToString();
                        resDetail[k].AssessmentDate = (DateTime)drRes["AssessmentDate"];
                        k++;
                    }

                    qd[j].resDetail = resDetail;
                    j++;
                }
                cad[i].qci = qd;
                i++;
            }

            Processing.Table table = (Processing.Table)sender;
            table.DataSource = cad; // DATA assigned in the datasource is accurate and in proper format.
        }
I have attached Image of that report.
Jay
Top achievements
Rank 1
 answered on 21 Dec 2010
1 answer
237 views
We have several reports in Telerix which support single sided & double sided.Single sided print is working fine & thanks for that feature.
Similarly we are in need of double sided(Duplex)print.Can you please tel me the exact coding which supports it?

Thanks
Aabidha
Steve
Telerik team
 answered on 21 Dec 2010
5 answers
186 views
To begin with, I've read the article on design considersations for the reports and tried to follow its suggestions. 

I've got a pretty simple report with a single parameter defined as long.  When I switch to SQL Server session state I get the error:
Exception information:
    Exception type: SerializationException
    Exception message: Type 'Telerik.Reporting.Service.NameValueDictionary' in Assembly 'Telerik.Reporting.Service, Version=4.1.10.921, Culture=neutral, PublicKeyToken=a9d7983dfcc261be' is not marked as serializable.
   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)
   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
   at System.Web.Util.AltSerialization.WriteValueToStream(Object value, BinaryWriter writer)


The datasource was a built in telerik datasource, but I've switched it to load on the event NeedDataSource event and I'm still getting the same error.  The code behind is below:

        public AddressList()
        {
            /// <summary>
            /// Required for telerik Reporting designer support
            /// </summary>
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

        private void AddressList_NeedDataSource(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.Report report = (Telerik.Reporting.Processing.Report)sender;

            DataTable allData = new DataTable();
            SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionName"].ConnectionString);
            try
            {
                SqlCommand cmd = new SqlCommand("spReportAddressList", connection);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(new SqlParameter() { Value=(Int64) report.Parameters["ParamName"].Value, ParameterName="ParamName" });

                connection.Open();
                SqlDataAdapter adapter = new SqlDataAdapter(cmd);
                adapter.Fill(allData);
                connection.Close();
            }
            catch
            {
                connection.Close();
            }

            report.DataSource = allData;
        }

We have a silverlight application as the hosting application.  The report is super simple too - this is the 1st one we are trying to convert after the session state problem.  We are doing this change beccause we are moving towards a server farm\multiple wp and telerik doesn't seem to work with that either without first moving the session over to some sort of central storage.

Please help as this is causing us serious issues.

Steve
Telerik team
 answered on 21 Dec 2010
4 answers
183 views
Hey,

I am currently in a spot of trouble.  I am attempting to add a picture box to a Telerik Report and bind it's "Value" property to one of the columns I am returning from data.  The data type of the column that is returned is System.Byte[]

I am doing this by setting the value property to be "=Fields.Drawing".

When I click on the Preview OR the Html Preview tab at the top, this image displays with no problem what so ever.  The report is as I expected it to be.

However, once I attempt to view this particular report in a Silverlight application using WCF Service and the Silverlight Telerik Reporting Report Viewer, it does not display the image.  It does not give an error that I can see.  It also does not show a red box or anything to show that it failed.  It just simply does not show a picture. 

Considering that all of the text from that particular row which I have also added to the report (i.e. Description, Order no etc) show up perfectly, I can only assume that something is not happening to display the picture.  I have also put a break point on the event:

private void PictureBox1_ItemDataBound(object sender, EventArgs e)
{
 
}

Once the report hit this (while running from Silverlight) it does has the proper data in the Data part of the picture box.  So considering all of these things, I can not come up with a reason after hours of searching this forum as to why my particular image is not showing up.

Any assistance, projects or guidance in regards to this would be fantastic.  If you believe that it may be something about how I have set up my WCF Service, let me know and I will start posting my code.

Regards,



Shaun Sharples
Fletcher Aluminium

Fletcher Aluminium
Top achievements
Rank 1
 answered on 20 Dec 2010
1 answer
132 views
I created a simple report that has some hard coded text in the header and has 3 fields in the detail area.  When I run the report in my application bound to a list of objects (with exposed properties), I get all items in the list list.  However, each line of the report comes out on a separate page.  My report design looks something like


(Header section)

                                        Activity Report

Project Name                     Task Name                       Cost
----------------------------------------------------------------------------


(Detail section)
[=Fields.ProjectName]         [=Fields.TaskName]          [=Fields.Cost]







As I mentioned, I have set the data source for the report to a List which right now
has 29 elements in it.  I expected multiple lines in the report with only 1 or 2 pages, but I end up with 29
pages!   Can anyone tell me what I did wrong?

It's probably something really basic, but this is the first time I used the tool, so bear with me.

Thanks,

John
Peter
Telerik team
 answered on 20 Dec 2010
1 answer
85 views

 

 

I am using a cubedatasource and trying to format the data labels, but the format doesn't seem to take effect.  I am adding the series in the codebehind:

 

ChartSeries series = new ChartSeries("Avg Hours/Job", ChartSeriesType.Bar);
series.DataYColumn = "JobAvg";
series.DataLabelsColumn = "JobAvg";
series.DefaultLabelValue = "#Y{F}";
cht.Series.Add(series);

I am still getting values with 8 decimal places.  Anyone know why?

Ves
Telerik team
 answered on 20 Dec 2010
2 answers
60 views
I've been tasked with creating 1 ASP.Net page, using Visual Studio 2008 and Telerik Reports Ver. Q1 2008.  On this page I have one dropdown control that lists all the views currently available in the database (SQL Server 2005).  I've created a table in the database that holds the "real" view name, along with a "pretty" name for the clients to choose from.  My goal is to allow the user to select from this dropdown list a view, and then once selected, the results will display below.  I've been told that using a <telerik:RadGrid> would work, but I do not have this as an option in my Visual Studio Toolbox.  I'm quite new to Telerik, but I know the basics.  Any quick help would be greatly appreciated as I've been given until "Friday" to get this functioning (2 days).

Thanks ahead of time!
Terri-Lynn
Vasil
Telerik team
 answered on 20 Dec 2010
3 answers
153 views
Hi,
It would be of great help, if anyone shares the code for generating a report using the MVVM pattern in WPF without the use of the in-built wizard.
The report would be added manually.

Thanks a lot.
Steve
Telerik team
 answered on 20 Dec 2010
3 answers
214 views
I'm using the "Naviage to URL" action in a report.  When the report is rendered as html in the asp.net ReportViewer, when i click on the link, the report opens a new window.  I need it to just navigate away from the report within the same window.  Can this be done?

using Telerik Reporting 2010 Q3
using Asp.Net ReportViewer.
Steve
Telerik team
 answered on 20 Dec 2010
1 answer
285 views
I want to display value of textbox like treeview in table report item. I am using one database field to set the left padding. But it does not work. If I use html preview it shows as expected but not in normal preview / silverlight application.

This is what i am doing:

public static Telerik.Reporting.Drawing.Unit GetLeftPadding(double lvl)
        {
            if (lvl <= 1)
                return Telerik.Reporting.Drawing.Unit.Pixel(0);
            else
                return Telerik.Reporting.Drawing.Unit.Pixel(lvl * 15);
        }

in textbox bindings property I added one new binding with the following:
Property Path :  Style.Padding.Left
Expression:  = GetLeftPadding(CDbl(Fields.Lvl))

What could the reason? Any help would be appreciated.

Thanks
Peter
Telerik team
 answered on 20 Dec 2010
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?