Telerik Forums
Reporting Forum
1 answer
347 views
Hi,

I would like to use an expression like that in a report :
=IIF(Fields.ItemType <> "Value", Format("{0:P1}", Fields.Value1), Format("{0:## ### ###,}",Fields.Value1))

This expression is in the property 'value' of a textbox. The textbox is inside a 'Table'

Inside the report, I have a message which is : "an error occured while"

'ItemType' is a property of an object which is bound. It's also an enumeration which can contains 'None, Value or Pourcent'

So, if my object's properties contain pourcents, I would like to format my values in a certain way and if my object's properties contain values, I would like to format my values in another way.

Is it possible to do it when an enumeration is evaluate ?
What is wrong inside my expression ?

Thanks for your help.

Regards.

Fred
Cantenot Frederic
Top achievements
Rank 1
 answered on 24 Feb 2011
1 answer
137 views
I have a report parameter that is built off of a Role Table.  The Primary key of this table is RoleId(int).  The display value is RoleDisplay(varchar(50)).  It also contains ApplicationId which is a FK back to an Application table.
Example data would be as follows:
RoleId ApplicationId RoleDisplay
1 1 Administrator
2 2 Administrator
3 1 Viewer
4 1 Salesperson

This parameter is sourced from a Dataset that contains the Role Table.  The DisplayMember is set as RoleDisplay and the ValueMember is set as RoleId.  It is set as a MultiValue = True.

So, when I run the page this is on it loads all those roles into the parameter.  So, it displays:
Administrator
Administrator
Viewer
Salesperson

I then select all the roles.

In my code I am looping through the report parameter values and creating a string to send to a Stored Procedure.  When I loop through the values for the ReportParameter it returns 2,2,3,4.  It should return 1,2,3,4.  It is like it is really keying off of the display value.

I went in and changed the data in my table to:
RoleId ApplicationId RoleDisplay
1 1 Administrator
2 2 Administrator 2
3 1 Viewer
4 1 Salesperson

My code then returned the following role id's when all roles are selected.  1,2,3,4.

I am running Telerik Reporting Q3 2010 SP1 (4.2.10.1221)

I searched the forums and could not find this issue.

Thanks.

Private Function BuildParamList(ByVal paramType As String) As String
        Dim list As String = ""
        Dim count As Integer = 0
        For Each val As Integer In CType(Me.ReportParameters(paramType).Value(), Array)
            If count = 0 Then
                list = val.ToString
            Else
                list = list + "," + val.ToString()
            End If
            count = count + 1
        Next
 
        Return list
    End Function
 
    Private Sub AppDetailByRole_NeedDataSource(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.NeedDataSource
        'retrieve the data into the dataset
        Try
            Me.UsP_AppDetailByRoleContextTableAdapter1.Fill(Me.DataSet21.USP_AppDetailByRoleContext, _
                                                            BuildParamList("Application"), _
                                                            BuildParamList("Environment"), _
                                                            BuildParamList("Role"))
            TryCast(sender, Telerik.Reporting.Processing.Report).DataSource = Me.DataSet21.USP_AppDetailByRoleContext
        Catch ex As System.Exception
            'An error has occurred while filling the data set. Please check the exception for more information.
            System.Diagnostics.Debug.WriteLine(ex.Message)
        End Try
    End Sub



Peter
Telerik team
 answered on 24 Feb 2011
5 answers
111 views
Is it possible that a future release will contain the possibility to save a report-design to file?

We want to be able to load a report-design in runtime.
Steve
Telerik team
 answered on 24 Feb 2011
5 answers
187 views
Hi,


I have added the telerik report viwer to a custom web conrol so we can add a custom filter panel above the report viewer. everything seems to be working ok (reports run and report viewer renders) but when running a report it no longer displats the Generating report animation. any idea how i can fix this?

Thanks
Steve
Telerik team
 answered on 24 Feb 2011
1 answer
89 views
After upgrading to Reporting Q3 2010 and getting my reports working on development box, I've run into the "ReportViewer is undefined" error after publishing my web site to our test server.  I followed the instructions for putting the Telerik Reporting dll's into the web site bin folder, and these are being propagated out to the server.

In development, do I need to change the references in the web site to the /bin/...dll files rather than having the references to the dll's in the Telerik ProgramFiles area?

Dan
Dan
Top achievements
Rank 2
 answered on 23 Feb 2011
1 answer
313 views
I have a vertical bar chart where I am filling the chart series from the code-behind, and the x-axis values are dates.
I need to draw a line across the chart that represents a "target" value.
I have read the documentation for using the ChartMarkedZone for this purpose, so I tried this code but it does not work.
Telerik.Reporting.Processing.Chart chart = (Telerik.Reporting.Processing.Chart)sender;
Telerik.Reporting.Chart chartDef = (Telerik.Reporting.Chart)chart.ItemDefinition;
Telerik.Reporting.Charting.ChartSeries series = new Telerik.Reporting.Charting.ChartSeries();
 while (dtThisDate <= dtEndDate)
  {
                seriesItem = new Telerik.Reporting.Charting.ChartSeriesItem();
                seriesItem.YValue = (long)barvalue;
                seriesItem.Label.TextBlock.Appearance.TextProperties.Color = Color.Black;
                series.AddItem(seriesItem);
                chartDef.PlotArea.XAxis.Items.Add(new ChartAxisItem(dtThisDate.Month.ToString() + "/" + dtThisDate.Day.ToString() + "/" + dtThisDate.Year.ToString()));
}
if (targetParm != "" && targetParm != "0")
                {
                    Telerik.Reporting.Charting.ChartMarkedZone mzone = new ChartMarkedZone();
                    mzone.ValueStartY = Convert.ToInt32(targetParm);
                    mzone.ValueEndY = Convert.ToInt32(targetParm);
                    mzone.ValueStartX = chartDef.PlotArea.XAxis.MinValue;
                    mzone.ValueEndX = chartDef.PlotArea.XAxis.MaxValue;
                    mzone.Appearance.Border.Color = Color.Red;
                    mzone.Appearance.Border.Width = 3;
                    chartDef.PlotArea.Add(mzone);
                }

The problem is that setting mzone.ValueStartX = chartDef.PlotArea.XAxis.MinValue
does not work.  But what do I set the ValueStartX and ValueEndX values to when my x-axis points are dates?

Thanks for any help.  Dan
Giuseppe
Telerik team
 answered on 23 Feb 2011
1 answer
119 views
Hi,

I am having some issues with printing from the WPF reportviewer.

1.  In most cases only the middle third of the page is being printed.  My page is set to A4 landscape, with 1.5 cm borders all around, and the top third and bottom third of each page are simply not printed - the middle of the table is though.

2.  When clicking print, I am unable to select a page range in the print options, it is greyed out.  I have tried this on several machines with several different printers so am pretty sure it is not an issue with local configuration.

Any help is much appreciated.

Thanks
Rob
Peter
Telerik team
 answered on 23 Feb 2011
2 answers
194 views
Hi,

I have spent few hours trying to find a solution to retrieve the current data (DataRowView) from the ItemDataBinding event. This event is bound to a Table control that sits in the subreport. When I step into the code during debug process, I noticed that the DataObject and RawData returns null value. Does anyone know how to access the DataRowView object in this event?
What I done is to dynamically assign a predefined SqlDataSource in the constructor and hook the ItemDataBinding event to the Table. The code looks like below:

public SubReport(string connectionString, string Id){
    SqlDataSource1.Parameters[0].Value = Id;
    SqlDataSource1.ConnectionString = connectionString;

    TableReport.DataSource = SqlDataSource1;
    TableReport.ItemDataBinding += new EventHandler(TableReport_ItemDataBinding);
}

private

 

void TableReport_ItemDataBinding(object sender, EventArgs e)

 

{

    Telerik.Reporting.Processing.

ReportItemBase item = (Telerik.Reporting.Processing.ReportItemBase)sender;

 

 

 

    string daysAnalysis = item.DataObject["intDaysAnalysis"].ToString(); ----> This line throws exception where item.DataObject is null

 

}


Does anyone have idea how can I work around this issue?

Thanks in advance
Kyle


Massimiliano Bassili
Top achievements
Rank 1
 answered on 23 Feb 2011
1 answer
152 views
Hi guys,

I created a DNN module to hold a Telerik Reporting control that queries a cube (via an MDX query) using the following process:
1. I created a class library to hold the Telerik Reporting control, setting up the MDX query, 'fields' & 'columns'.  All well and good;
2. In my DNN project, I added a reference to this class library;
3. I created a Web User control in DesktopModules to hold the DNN module;
4. To this, I added a Telerik ReportViewer control, and set the report property to reference the class library.
5. After logging in as Host on the DNN site, I create a new module from a control, specifying the appropriate directory/file/filename.

If I create a test ASPX page (i.e. not DNN) and drop this Web user control into it, it works fine.  However, once I add this module to a page in DNN, I get the following error:
An error has occurred while processing Report '':
A connection cannot be made. Ensure that the server is running.
------------- InnerException -------------
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
------------- InnerException -------------
An existing connection was forcibly closed by the remote host

I've posted this on this forum as well as the DNN forum, as I wasn't sure which was more relevant.

Cheers,
Norman

Adam
Top achievements
Rank 1
 answered on 22 Feb 2011
1 answer
176 views
Hi

i have created the report in the run time but i have not able to create the group and sum
so i want to know How to create the report in run time with group and sum.

if possible please provide some sample code
it will highly appriciated

Thanks in advance


Mahendra
Peter
Telerik team
 answered on 22 Feb 2011
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?