Telerik Forums
Reporting Forum
3 answers
434 views
Good morning,
I am having an issue with reporting and getting the selected value of a databound combobox. The value only returns the selectedItem.Text of the combobox and I wish to get the selectedValue instead.
Could you let me know what the code would be to achieve this please?

The Lists are defined as:

 
 
    Public Shared Function ReturnTypes() As ForecastTypeCollection 
        Dim pTypeCol As New ForecastTypeCollection 
        For i As Integer = 0 To 2 
            Dim pType As New ForecastType 
            Select Case i 
                Case 0 
                    With pType 
                        .ValueMember = "Both" 
                        .DataMember = "" 
                    End With 
                Case 1 
                    With pType 
                        .ValueMember = "UK" 
                        .DataMember = "UK" 
                    End With 
                Case 2 
                    With pType 
                        .ValueMember = "International" 
                        .DataMember = "EX" 
                    End With 
            End Select 
            pTypeCol.Add(pType) 
        Next 
        Return pTypeCol 
    End Function 
 
    Public Shared Function ReturnPeriods() As PeriodCollection 
        Dim p As New PeriodCollection 
        For i As Integer = 1 To 12 
            Dim pPeriod As New Period 
            With pPeriod 
                .DataMember = i 
                .ValueMember = i 
            End With 
            p.Add(pPeriod) 
        Next 
        Return p 
    End Function 

and then they are assigned to the parameters as below:



    Public Sub New() 
        InitializeComponent() 
 
        Report.ReportParameters()(0).UI.AvailableValues.DataSource = ReturnTypes() 
        Report.ReportParameters()(0).UI.AvailableValues.DataMember = "DataMember" 
        Report.ReportParameters()(0).UI.AvailableValues.ValueMember = "ValueMember" 
 
        Report.ReportParameters()(1).UI.AvailableValues.DataSource = ReturnPeriods() 
        Report.ReportParameters()(1).UI.AvailableValues.DataMember = "DataMember" 
        Report.ReportParameters()(1).UI.AvailableValues.ValueMember = "ValueMember" 
    End Sub 

Then I bind the report as follows:

    Private Sub ForecastNextPeriod_NeedDataSource(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles MyBase.NeedDataSource 
        Try 
            Dim pCalendar As Calendar = ReturnCurrentYearAndPeriod() 
            Dim pType As String = ReportParameters("Type").Value 
            Dim pPeriodCount As Integer = Me.ReportParameters("PeriodCount").Value 
 
            DirectCast(sender, Telerik.Reporting.Processing.Report).DataSource = ReturnForecastReport(pPeriodCount, pCalendar.Period, pCalendar.Year, pType) 
        Catch ex As Exception 
            MsgBox(ex.ToString) 
        End Try 
    End Sub 

pType and pPeriodCount only grab the selected item. I have tried searching the forums and reading documentation but I can not find anything that explains how to get the selected value.
Any help would be appreciated.

cheers,
Jaymie
Steve
Telerik team
 answered on 17 Nov 2010
1 answer
110 views
I   want  to  display   Date   on  x-axis of  my chart.
I my database  My date is in the format of DateTime. The column Name is Date..
I  had written the code as    
chart1.PloatArea.XAxis.DataLabelsColumn="Date";

But  it  is giving  
an error message  saying  that  unable to cast System.DateTime   to System.String
Provide me solution  for that
Steve
Telerik team
 answered on 17 Nov 2010
5 answers
250 views
I have an issue where I have a series of lists or panels that might or might not contain data. If they don't contain data I want them to shrink down to their minimum height.

is this possible?

I attached screenshots I hope help illustrate what I am trying to accomplish.


**Update - Continuing to look at the documentation, it looks like perhaps docking or anchoring would accomplish this... but I am not positive how to go about it. I will continue playing... I welcome any assistance though.
Steve
Telerik team
 answered on 17 Nov 2010
1 answer
184 views
Hi,

Is there any way that I can customize the report while exporting it to PDF? I want to reset the font and spacing between two columns in Multi-Column Report.

Please advise!
-Krunal
Peter
Telerik team
 answered on 17 Nov 2010
1 answer
80 views
Hi,

I downloaded the trial version of the Reporting module. I try to change one of the report examples -  Report Catalog.cs. This example has already one filter condtion set:

=Fields.IsVisible = =True.

I try to add additional filter and this time I want to use "like" operator as shown below:

And =Fields.Description Like ...

After choosing operator "like" and trying to move to Value column I get an error: "System.ArgumentOutOfRangeException: Index was out of range."

How can I add a "like" condition to filter selection?

I use the following OS:
  • XP SP3.
  • Regional and language settings: pl-PL.
  • Telerik Reporting version: Telerik_Reporting_Q3_2010_v4_2_10_1110_trial. 
  • Alicja

    Steve
    Telerik team
     answered on 17 Nov 2010
    2 answers
    182 views
     We need to underline a field when it is the last detail item before the group footer (which shows a subtotal for the values above the line).  I tried doing this by putting a short horizontal line in the group footer, but it appears that there is no way to keep the last detail and the group footer on the same page resulting in the underline often being at the top of the next page.  Is there a way to keep them together?  If there isn't, the other idea I had was to add a conditional format to show the bottom border of the detail field when it is the last detail item.  Is that the best solution?  If so, can you tell me how to determine that a detail item is the last in it's group?
    DarrinB
    Top achievements
    Rank 1
     answered on 17 Nov 2010
    1 answer
    150 views
    When I use the report wizard it generates the report as expected, however when I try to preview the report everything is blank?
    Steve
    Telerik team
     answered on 17 Nov 2010
    1 answer
    1.0K+ views
    I am creating a report by using a .Net List collection as a DataSource. The primary list includes some properties which are themselves a collection (List<string>). Does Telerik reporting support support Collections within collections?

    Following is a simple example which can recreate the issue. When I created a report that binds to List<AddressEntry> as a DataSource, , it lists out the each AddressEntry (Name, Address, PhoneNo) but does not list the multiple Contacts within the address. I have tried item bind to Fields.Contacts and Fields.Contacts.Item, neither of which had success is listing the Contacts.

                List<AddressEntry> entries = new List<AddressEntry>();

    //populate the individual address entries, each address can have multiple contacts.
    ....

        public class AddressEntry
        {
            public string Name {get;set;}
            public string Address {get;set;}
            public List<string> Contacts { get; set; }
            public string PhoneNo { get; set; }
        }

    Thanks for the response,
    Peter
    Telerik team
     answered on 17 Nov 2010
    0 answers
    77 views
    I drag a TextBox named textboxA and a Table that fields some data in my reporting page, I want to set a filter that expression term are generated dynamictly, for example, I input the value in the textboxA then I set the filter property of the table like 
            Fields.XXXX = textboxA.Value or textboxname(of the table).Value = textboxA.Value
    Above methods are illegal or useless, is anyone know how to do like this!?
    John
    Top achievements
    Rank 1
     asked on 17 Nov 2010
    2 answers
    184 views
    Is Telerik looking to implement support for the SSRS reports in the silverlight reporting control in the near future?
    Peter
    Top achievements
    Rank 1
     answered on 16 Nov 2010
    Top users last month
    Ambisoft
    Top achievements
    Rank 2
    Iron
    Pascal
    Top achievements
    Rank 2
    Iron
    Matthew
    Top achievements
    Rank 1
    Sergii
    Top achievements
    Rank 1
    Iron
    Iron
    Andrey
    Top achievements
    Rank 1
    Iron
    Want to show your ninja superpower to fellow developers?
    Want to show your ninja superpower to fellow developers?