Telerik Forums
Reporting Forum
1 answer
213 views
Hello there, 
I have this data structure:
{Id, Phases, Ring}
My content is
Id goes from 1:16
Phases is a random string
for each Id there are four Rings so Ring goes from 1:4
so the data I have is 
{1, "xx", 1}, {1, "xy", 2}, {1, "**", 3},{1, "fd", 4}, 
{2, "dk", 1}, {2, "%", 2}, {2, "T*", 3},{2, "sd", 4}, 
...
{15, "kk", 1}, {15, "ll", 2}, {15, "**", 3},{15, "ff", 4}, 
{16, "yy", 1}, {16, "uu", 2}, {16, "U*", 3},{16, "pp", 4}, 

I want to show this data in a report with the following layout (ignoring the edges and font types of course)
Id = 1
Ring    1    2   3  4
Phase xx   xy  **  fd

id=2
Ring    1    2   3   4
Phase dk  %  T*  sd

...

id=15
Ring    1    2   3   4
Phase kk  ll    **  &&

id=16
Ring    1    2   3    4
Phase yy  uu  U*  pp

What I did is created thee lists list1 (parent), list2 (child), list 3(child)
list2 and list3 are within list1 (in design mode as shown in rptexplorer.jpg)
"id=" (textBox1) and "Fields.Id"(textBox3) belong to panel2 (within list1)
"Ring" (textBox4)  and "Phases" (textBox6) are labels that belong to list2
Fields.Ring (textBox7) and Fields.Phase (textBox8) are data fields that belong to list3

I also have groupings
on list1 I have a Row Group equals to  "=Fields.Id"

on list2 I don't have any Groups 

on list3 I have a Row Group equals to "=(Fields.Ring-1)/4" and a Column group equals to "(Fields.Ring-1)%4"

when I run the report I only have the first sequence of data (though the layout is fine) like this:

Id = 1
Ring    1    2   3  4
Phase xx   xy  **  fd

id=2
Ring    1    2   3   4
Phase xx   xy  **  fd


...

id=15
Ring    1    2   3   4
Phase xx   xy  **  fd


id=16
Ring    1    2   3    4
Phase xx   xy  **  fd


What am I doing wrong? do I have something missing? please help!!!
Hadib Ahmabi
Top achievements
Rank 1
 answered on 13 May 2013
2 answers
157 views
Hello,

I need to change the Report  attribute in this code (with C#).  It's because I need to change the source of the report during runtime.

<telerik:ReportViewer ID="ReportViewerFiche"
    runat="server" BorderStyle="Solid" BorderWidth="1"       
    Report="Rapports.Fiches.FicheAA.MyReport, Rapports, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" 
    Width="100%" 
    Height="500px" ViewMode="PrintPreview"
>
</telerik:ReportViewer>


Thank you for your help.
Louis
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 11 May 2013
4 answers
181 views
I have a report that handles its datasource internally.  The layout requires three sub-reports and rather than have it fire three database calls for every item on the report I've written a stored procedure which returns four data tables (primary report data, and three tables for the sub-reports).  As each of the customers is displayed, I used the GroupHeader ItemDataBinding event to filter the sub-report tables and dynamically set those datasource values to the filtered data.

This worked great in 2012 Q1, but after updating to Q3 the GroupHeader ItemDataBinding event no longer fires.  As a result, my sub-reports are completely blank.

What do I need to do to resolve this issue?  Below is my code:

public string ConnectionString { get; set; }
 
private void Rpt_CustomerAccountsReport_NeedDataSource(object sender, EventArgs e)
{
    try
    {
        if (Report.ReportParameters["MarketListID"].Value == null
            && Report.ReportParameters["BranchID"].Value == null
            && Report.ReportParameters["CustomerGroupID"].Value == null
            && Report.ReportParameters["CustomerID"].Value == null)
        {
            ErrorMsg("Error!  This report cannot be run without parameters.  Please select a Branch, Marketing list or Customer group.");
        }
        else
        {
            SqlData data = new SqlData(ConnectionString);
            // Shared getdataset function
            dsMain = data.GetDataSet("spRpt_CustomerAccountsReport", CommandType.StoredProcedure,
                                     "@EmployeeUserID", Report.ReportParameters["EmployeeUserID"].Value,
                                     "@MarketListID", Report.ReportParameters["MarketListID"].Value,
                                     "@CustomerID", Report.ReportParameters["CustomerID"].Value,
                                     "@BranchID", Report.ReportParameters["BranchID"].Value,
                                     "@CustomerGroupID", Report.ReportParameters["CustomerGroupID"].Value,
                                     "@EmployeeID", Report.ReportParameters["EmployeeID"].Value);
 
            // ** Moving the max record limit to the stored procedure so we can change / make it user configurable without a re-compile
            if (dsMain.Tables[0].Rows.Count > 40000)
            {
                ErrorMsg("Over 40,000 results were returned.  The report cannot render.  Please select more specific criteria.");
            }
            else
            {
                Report.DataSource = dsMain.Tables[0];
            }
 
        } // They provided parameters
    }
    catch (Exception ex)
    {
        ErrorMsg(ex.Message);
    }
}
 
private void GroupHeaderArea1_ItemDataBinding(object sender, EventArgs e)
{
    try
    {
        // Get the section
        Telerik.Reporting.Processing.GroupSection section = (sender as Telerik.Reporting.Processing.GroupSection);
 
        if (section != null)
        {
            // Get the customer ID for this section
            object id = section.DataObject["CustomerID"];
 
            if (id != null)
            {
                int CustID = (int)id;
 
                // Filter out sub-report data
                DataRow[] drContacts = dsMain.Tables[1].Select("CustomerID=" + CustID.ToString());
                DataRow[] drCrossSell = dsMain.Tables[2].Select("CustomerID=" + CustID.ToString());
                DataRow[] drAccounts = dsMain.Tables[3].Select("CustomerID=" + CustID.ToString());
 
                Rpt_CustomerAccountsReportAccountSummary rptAcct = new Rpt_CustomerAccountsReportAccountSummary();
                Rpt_CustomerAccountsReportContacts rptContact = new Rpt_CustomerAccountsReportContacts();
                Rpt_CustomerAccountsReportCrossSell rptCrossSell = new Rpt_CustomerAccountsReportCrossSell();
 
                rptAcct.DataSource = drAccounts;
                rptContact.DataSource = drContacts;
                rptCrossSell.DataSource = drCrossSell;
 
                srContacts.ReportSource = rptContact;
                srCrossSell.ReportSource = rptCrossSell;
                srAccountSummary.ReportSource = rptAcct;

            }
        }
    }
    catch (Exception ex)
    {
        ErrorMsg(ex.Message);
    }
}
Nick
Top achievements
Rank 1
 answered on 10 May 2013
1 answer
201 views
Is it possible to have a headless application render reports locally (no server) and print directly? I need something to watch for events and then print.

Thanks
Peter
Telerik team
 answered on 10 May 2013
1 answer
78 views
Dear all,

I just want to ask a question about telerik reporting q1 2013. I'm going to render a Pie Chart using new feature Graph -> Pie Chart
the question is how can i change the Start Angle (usually existed in old version) of the pie chart in the new version?

Thanks very much.
Elian
Telerik team
 answered on 10 May 2013
1 answer
882 views
Hi,
I am using Telerik.Reporting.dll (version 5.1.11.928) and Telerik.ReportViewer.WinForms.dll (version 5.1.11.928) in Q2 Reporting 2011.

I have a column which calculates difference in minutes and I want to show them meaningful in my Telerik report.
Here is my column: sum(cast(datediff(second, IEC.CREATE_DATE, IEC.STATUS_DATE) as float) / 60) TotalSentMinutes

Here is some example values for this column: 
TotalSentMinutes
----------------------
2,15
0
1,36666666666667
92,1166666666667
902,383333333333 ... etc.

So, I want to show these values meaningfully by using Formatting in Textbox's value field. I wrote a method to show them formatted.

private string FormatMinutes(string number2)
        {
            if (number2 == "0")
                return "";

            int number = int.Parse(number2);
            string day = string.Empty;
            string hour = string.Empty;
            string minutes = string.Empty;
            string formatted = string.Empty;

            if (number >= 1440)
                day = (number / 1440).ToString();
            if (((number % 1440) / 60) > 0)
                hour = ((number % 1440) / 60).ToString();
            if ((number % 60) > 0)
                minutes = (number % 60).ToString();
            if (day != string.Empty)
                formatted += day + " day, ";
            if (hour != string.Empty)
                formatted += hour + " hour, ";
            if (minutes != string.Empty)
                formatted += minutes + " minutes";

            return formatted;
        }

I called this method in Textbox's value field like this: = IIf(Fields.SentCount = 0, 0, FormatMinutes(Fields.TotalSentMinutes))

However, I am getting error while formatting. Is it a syntax problem? Method calling problem? or should I substr values to get rid of commas in double values? How can I solve this problem?
Any suggestions?
Best,
Cihad
Stef
Telerik team
 answered on 10 May 2013
1 answer
195 views
I have run into an issue getting the group header to display the way I need it to.  Here is my scenario:  In my subreport, I have a detail section, which is where the repeating records display.  I have a group header that I need to display under 2 different circumstances - (1) if a certain field value in my detail section changes and (2) at the top of all subsequent pages while the detail records are printing. 

I have #1 working - Where I bind the data to my view model, I check to see if the field value changed from the last record.  I then send in a true or false flag to the constructor of the subreport and set headerSection1.Visible = true.  Problem is, this seems to override the GroupHeaderSection1's PrintOnEveryPage property that I have set to true. We really need that group header to display at the top of each page, as well as each time a specific field value changes.
Elian
Telerik team
 answered on 10 May 2013
2 answers
346 views
I am a Tererik Report User, I have a appliaction with Fix Linespace  multiLine Text  Layout  in  My  Report for Print , I try to use textbox Or HtmlText,But I found No Way I Can do it; Please Give me  some  guidance, How i can realize. If  possible ,please give me a example,thanks!
wen
Top achievements
Rank 1
 answered on 10 May 2013
1 answer
241 views
Is it possible to do this?  What is the easiest way to do this?
Peter
Telerik team
 answered on 09 May 2013
3 answers
718 views
I am building a report with quite a few tables in it. Based on the data used to populate the report, I need to be able to show or hide the header row of the tables at runtime. How can this be achieved?
Elian
Telerik team
 answered on 09 May 2013
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?