Telerik Forums
Reporting Forum
1 answer
48 views
We just upgraded to the latest release of the Report components and are now receiving an error about No Default item for ResultSet when accessing the set.DataObject("fieldname") like below.  The datasource is a SQLDataSource and all this worked prior to the upgrade.
Private Sub activityTable_NeedDataSource(ByVal sender As Object, ByVal e As System.EventArgs) Handles activityTable.NeedDataSource
    Dim tbl As Telerik.Reporting.Processing.Table = TryCast(sender, Processing.Table)
    Dim sect As Processing.ReportSection = TryCast(Processing.ElementTreeHelper.FindChildByName(tbl.Report, "ReportHeaderSection1", True).FirstOrDefault, Processing.ReportSection)
    Dim data As Object = sect.DataObject
    Dim cutoffdate As Date, managedbypartnerid As Integer
    Dim totalduetextbox As Processing.ProcessingElement = Processing.ElementTreeHelper.GetChildByName(sect, "payStubAmountDueTextBox")
    Dim totaldueaftertextbox As Processing.ProcessingElement = Processing.ElementTreeHelper.GetChildByName(sect, "payStubAmountDueAfterTextBox")
    Dim autopaytextbox As Processing.ProcessingElement = Processing.ElementTreeHelper.GetChildByName(sect, "autopaytext")
    If data IsNot Nothing Then
      cutoffdate = data.Item("UsageCutOffDate")
      managedbypartnerid = data.Item("ManagedByPartnerId")
    End If
IvanY
Telerik team
 answered on 13 May 2013
4 answers
301 views
Hi,
I am using telerik reporting, here i have a  multivalued parameter on the report which is of type Integer,
I want to set value to this parameter from the client side..

Currently i am using the below code and it doesn't work..

         List<int> values= new List<int>();
           values.Add(1);
           values.Add(2);

        args.ParameterValues["Parameter1"] = values;



and also tried this.

     Int[] values= {1,2,4};
     args.ParameterValues["Parameter1"] = values;




Thanks

Rasmus
Top achievements
Rank 1
 answered on 13 May 2013
15 answers
1.3K+ views
Hi There,

I was hoping someone could point me in the right way to display the header of a table on each new page. I've tried adding in groups, but this seems to assume that you have seperate objects (some text boxes for the header and some for the details), which in the case of a table is not what is available.

I've tried setting the 'ColumnHeadersPrintOnEveryPage' property to true, but this doesn't seem to have any affect, am I missing something here?

Cheers,

Doug

IvanY
Telerik team
 answered on 13 May 2013
2 answers
202 views
Hi,

When opening a page that has not yet had it's search criteria filled in and sent off to generate a report I get the "The source of the report definition has not been specified." message showing inside the report viewer section. That is all fine as it's expected behavior.

However, I want to change the text of the error that gets shown - is there a way to do this?

I want to make it say something like "Please fill in search criteria then press the search button."

Regards

Jon
Jon
Top achievements
Rank 1
 answered on 13 May 2013
1 answer
143 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
133 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
156 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
163 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
52 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
817 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
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?