Telerik Forums
Reporting Forum
3 answers
133 views
Hi,

I am working to convert all Crystal Reports to Telerik Reports. And I see that the Telerik Chart Builder Wizard does not allow to narrow down only selected fields to display on the chart like Crystal Reports (see the attached snapshot). I am new to customize Telerik Report charts and need help to create a pie chart (like the attached image). How can I select only needed fields from a big data source and use aggregate SUM function to display a pie chart with field names shown in the legend.

Thank you for your support.
Khoa
Elian
Telerik team
 answered on 08 Feb 2013
1 answer
91 views
Hello,

We are using Silverlight Report Viewer, how can we set the DataView as the datasource?

Steve
Telerik team
 answered on 08 Feb 2013
6 answers
210 views

(objectDataSource While Getting data From WCF)

Hi All,,

From your demos I fall in love with your products *_*,, So thank you a lot ....

I'm kind off new to Telerik Reporting Tool..

I have a WPF Application Built In MVVM (Model-View-View Model) and it Gets the data inside the Model from a WCF..
It works as a charm..

Now I want to replace the reporting feature in the application with the one your product is providing...

so I've started by creating a ReportsLibrary Project..
Then I've Created the DataSource as an objectDatatSource (So It Reads the data from the following method in the Model Class)

public static List<ALERT> Load()
        {
            List<ALERT> myList = new List<ALERT>();
  
            AlertServices.AlertServiceClient AlertClient = new AlertServices.AlertServiceClient();
            AlertClient.ClientCredentials.UserName.UserName = "usrName";
            AlertClient.ClientCredentials.UserName.Password = "password";
  
            ALERT[] dtAlerts = AlertClient.getAllAlerts();
  
            foreach (ALERT alrt in dtAlerts )
                {
                    myList.Add(alrt);
                }
  
            AlertClient.Close();
            return myList;
        }

Everything went smoothly with the report design which I have called AllAlerts..

when i tried to review the report before adding it to the WPF application I have got this Error Message...
(An Image Is Attached)

An error has occurred while processing Report 'AllAlerts':
Exception has been thrown by the target of an invocation.
------------- InnerException -------------
Could not find default endpoint element that references contract 'AlertServices.IAlertService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
   
Telerik Reporting v5.0 trial version. Copyright Telerik © 2002-2011.
To remove this message, please obtain a commercial version from www.telerik.com  

Noting That I have Added The Project In The Same Solution That All It is Projects Are working soo fine..

And The Following (app.config) Configuration File is located in the ReportsLibrary Project..

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <wsHttpBinding>
                <binding name="wsHttpAlrEndpoint" closeTimeout="00:01:00" openTimeout="00:01:00"
                    receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
                    transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="524288" maxReceivedMessageSize="1024000"
                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                    allowCookies="false">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="Message">
                        <transport clientCredentialType="Windows" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" negotiateServiceCredential="true"
                            algorithmSuite="Default" />
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://muaath.local/TRDWCFSurv/TRDWCFSurvServices.AlertService.svc"
                binding="wsHttpBinding" bindingConfiguration="wsHttpAlrEndpoint"
                contract="AlertServices.IAlertService" name="wsHttpAlrEndpoint">
                <identity>
                    <certificate encodedValue="AwAAAAEAAAAUAAAAxtusZ48yxeG84lIeb9af1Wg7ib8gAAAAAQAAAMwBAAAwggHIMIIBNaADAgECAhDGybGTRx4Fg0xdc1+CAK0SMAkGBSsOAwIdBQAwETEPMA0GA1UEAxMGSWRDZXJ0MCAXDTEwMDMyNDEyMDI1MloYDzQwMDgxMTI0MTIwMjUyWjARMQ8wDQYDVQQDEwZJZENlcnQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKl6oADCxSKQ+isZMfBzjafbEDPmE9Hn6yStKCoXjGlskH5Yqmwp7q4hrLbPmJT7iE4NEtmtJ9MCmXxJuGJuT8mgVadzAHNFnlHCG0DhdZJrg4tSe+vOo0yYVq96zMH6I8QCLyALBS15bdWcG0QpOa5mm6ZeO9hp23cYwJhgeHiPAgMBAAGjJzAlMBMGA1UdJQQMMAoGCCsGAQUFBwMBMA4GA1UdDwQHAwUAsAAAADAJBgUrDgMCHQUAA4GBAEGNLlMfqLpAx8fg35D/NVZIbE2psK2M7BgiTOd/KFgYTbiWT/I7zfPlcQ1DFQ59NtuVbODVsTCZQdmmNr6iZIEnEBsdfsdfjsdfjklsdf78sdjfkjsdklf8Y4XXNQMpIcjcTK+dpM6KcnK4ocmLhXzLbgKcR5YUWmsdxSdt" />
                </identity>
            </endpoint>
        </client>
    </system.serviceModel>
</configuration>

I hope That I will find the solution here.. *_*

By The Way I've Tried To View The Rreport from The WPF ReportViewer but I've Got Errors Adding The Viewer Control To The WPF View.. (So Lets Find a Solution for the First Problem First Then I Will Give You More Details About The Second One) *_*

My Best Regards..
danparker276
Top achievements
Rank 2
 answered on 07 Feb 2013
1 answer
71 views
I am binding my main report to an instance of an object that looks like this:

public class foo {
    public Bar Header { get;set; }
    public List<Baz> ListOfStuff { get;set;}
}

I have a sub-report that will display .ListOfStuff, but I'm at a loss on how to bind the sub-report so it has access this data from the main report.

At a high-level, this is how my main report is binding to the original source:

                var report = new TestReport();
                var ods = new Telerik.Reporting.ObjectDataSource();
                ods.DataSource = instanceOfFoo;
                report.DataSource = ods;
               
                instanceReportSource.ReportDocument = report;
                ReportViewer.ReportSource = instanceReportSource;

My sub-report doesn't have a DataSource set, so I've tried using NeedDataSource, but I'm not sure what exactly I need to do to bind to the parent data.

I'm sure I'm missing something really simple, but at this point, I'm stuck.
Michael Eaton
Top achievements
Rank 1
 answered on 07 Feb 2013
6 answers
372 views
Hello,
in a report I have a table which has a rotated layout: headers at the left and data in columns.
How can I center the table horizontally in the page?
Patrick
Steve
Telerik team
 answered on 07 Feb 2013
2 answers
200 views
I use the below custom function to convert the numeric value in my Risk column to its text equivalent.

= ReturnRiskLeveltext(Fields.RiskLevel)
public static string ReturnRiskLeveltext(int rId)
{
    using (DataEntities ctx = new DataEntities())
    {
        var RiskLevel = ctx.RiskLevels.Where(x => x.RiskLevelID == rId).SingleOrDefault();
        return RiskLevel.Level;
    }
}

However, in the footer row I wish to display an Average Risk Level
= Avg(Fields.RiskLevel)

Would be correct because it returns a 2. however, I wish to again display the Text equivalent.
= ReturnRiskLeveltext(Avg(Fields.RiskLevel))

Throws an error 'An error has occurred while processing TextBox 'textBox11': The expression contains undefined function call ReturnRiskLeveltext().'

Ideas?

Tim
Top achievements
Rank 1
 answered on 07 Feb 2013
6 answers
372 views
How can I enter a GUID in the parameter values editor? I've tried
{F1F613B9-1D64-40E9-B437-A837F0B1BC6D}
'F1F613B9-1D64-40E9-B437-A837F0B1BC6D'
"F1F613B9-1D64-40E9-B437-A837F0B1BC6D"
'{F1F613B9-1D64-40E9-B437-A837F0B1BC6D}'
"{F1F613B9-1D64-40E9-B437-A837F0B1BC6D}"
Paul
Top achievements
Rank 1
 answered on 07 Feb 2013
3 answers
2.2K+ views
I am using Telerik Reporting version 6.1.12.820, Runtime version:  v2.0.50727

I use ReportViewer to render the reports. If I export  to CSV files when the report is empty, I noticed there are BOM characters "" at the beginning of the file.

How can I remove it?

I searched the forum and found some post in Telerick Radgrid

http://www.telerik.com/community/forums/aspnet-ajax/grid/exporting-without-bom.aspx#1474434


But for ReportViewer, there is no such event handler.

Can you help?

Thanks
Steve
Telerik team
 answered on 07 Feb 2013
1 answer
516 views
Overview: I am using Reporting Q1 2012 and Visual Studio 2010. I have built a very simple aspx page which contains the Q1 2012 Report Viewer control. In the code behind, I am binding the ReportViewer.Report to a deserialized instance of a .trdx file that was created using the Q1 2012 Report Designer. I have SQL Server Express 2008 R2 as the data source for the SQLDataSource defined in the report.

Problem: When I view the report (.trdx) in the Report Preview of the Report Designer, the expected data populates correctly.  When I run the web application and attempts to view the report using the ReportViewer control a blank page is displayed after the "Generating Report.." message disappears.  Print Preview mode of the ReportViewer yields the same results.  Printing and exporting to any format generates a single blank page. 

Details:
  • I have followed the official documentation for deserializing the report file and binding it to the viewer. 
  • The report has no parameters and is a simple "Select * From [Table]" select command.
  • The [Table] has only three columns.
  • The SQLDataSource connection string is NOT being stored in a configuration setting.
  • I have stepped through the code line by line to verify that the deserialized Report object connection strings are pointing at the correct server and database with appropriate access.

Code:
viewer.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="viewer.aspx.cs" Inherits="Panda.Web.App.Reports.Repository.Viewer" %>
 
<%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=6.0.12.215, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
    Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
    <link type="text/css" rel="stylesheet" href="~/Styles/reset.css" />
 
    <style type="text/css">
        html#html, body#body, form#form1, div#content
        {
            height: 100%;
        }  
    </style>
</head>
 
<body id="body">
 
    <form id="form1" runat="server">
    <div id="content">
 
        <telerik:reportviewer Id="ReportViewer1" runat="server" Width="100%"
            Height="790px" ShowDocumentMapButton="False" ShowHistoryButtons="False"
            ShowPrintPreviewButton="False" Skin="WebBlue" ViewMode="PrintPreview"
            ZoomPercent="50"></telerik:reportviewer>
 
    </div>
    </form>
 
</body>
</html>

viewer.aspx.cs
var reportDefinitionFile = Server.MapPath("~/app/reports/repository/rpt/" + _reportPath);
using (System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create(reportDefinitionFile))
{
    System.Xml.Serialization.XmlSerializer xmlSerializer = new System.Xml.Serialization.XmlSerializer(typeof(Telerik.Reporting.Report));
 
    Telerik.Reporting.Report reportDocument = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
     
    var conn = WebConfigurationManager.ConnectionStrings["Panda.Data.ConnectionString"];
    if (conn == null)
    {
        conn = WebConfigurationManager.ConnectionStrings["Panda.Data." + Environment.MachineName + ".ConnectionString"];
    }
 
    var connString = conn.ConnectionString;
 
    // Set Report datasource connections for report, parameters and all other objects
    var sds = (Telerik.Reporting.SqlDataSource)reportDocument.DataSource;
    sds.ConnectionString = connString;
 
    // parameters
    foreach (var obj in reportDocument.ReportParameters)
    {
        if (obj.AvailableValues.DataSource != null)
        {
            var ds = (Telerik.Reporting.SqlDataSource)obj.AvailableValues.DataSource;
            ds.ConnectionString = connString;
        }
    }
 
    ////// other report objects
    //SetConnectionStrings(reportDocument.Items, connString);
        
    ReportViewer1.Report = reportDocument;
    ReportViewer1.DataBind();
    ReportViewer1.RefreshReport();
}

Settings.trdx
<?xml version="1.0" encoding="utf-8"?>
<Report Width="10.45833333in" DocumentName="Panda Settings|List of global properties" Name="Settings">
  <DataSources>
    <SqlDataSource ConnectionString="Server=***\***;Database=***;uid=***;pwd=****;" SelectCommand="Select * from PandaSetting" Name="Panda" />
  </DataSources>
  <PageSettings PaperKind="Letter" Landscape="True">
    <Margins Left="0.25in" Right="0.25in" Top="0.25in" Bottom="0.25in" />
  </PageSettings>
  <DataSourceRef>Panda</DataSourceRef>
  <StyleSheet>
    <StyleRule>
      <Style BackgroundColor="" Color="28, 58, 112">
        <Font Name="Tahoma" Size="18pt" Style="Regular" />
      </Style>
      <Selectors>
        <StyleSelector>
          <Type>ReportItemBase</Type>
          <StyleName>Title</StyleName>
        </StyleSelector>
      </Selectors>
    </StyleRule>
    <StyleRule>
      <Style BackgroundColor="28, 58, 112" Color="White" VerticalAlign="Middle">
        <Font Name="Tahoma" Size="11pt" Style="Bold" />
      </Style>
      <Selectors>
        <StyleSelector>
          <Type>ReportItemBase</Type>
          <StyleName>Caption</StyleName>
        </StyleSelector>
      </Selectors>
    </StyleRule>
    <StyleRule>
      <Style Color="Black" VerticalAlign="Middle">
        <Font Name="Tahoma" Size="10pt" Style="Regular" />
      </Style>
      <Selectors>
        <StyleSelector>
          <Type>ReportItemBase</Type>
          <StyleName>Data</StyleName>
        </StyleSelector>
      </Selectors>
    </StyleRule>
    <StyleRule>
      <Style Color="Black" VerticalAlign="Middle">
        <Font Name="Tahoma" Size="8pt" Style="Regular" />
      </Style>
      <Selectors>
        <StyleSelector>
          <Type>ReportItemBase</Type>
          <StyleName>PageInfo</StyleName>
        </StyleSelector>
      </Selectors>
    </StyleRule>
  </StyleSheet>
  <Groups>
    <Group Name="labelsGroup">
      <GroupHeader>
        <GroupHeaderSection PrintOnEveryPage="True" Height="0.28125in" Name="labelsGroupHeader">
          <Items>
            <TextBox Value="name" CanGrow="True" Left="0.02083333in" Top="0.02083333in" Width="5.19791667in" Height="0.20000001in" Name="nameCaptionTextBox" StyleName="Caption" />
            <TextBox Value="description" Angle="0" CanGrow="True" Left="5.23958333in" Top="0.02083333in" Width="4.46041679in" Height="0.20000001in" Name="descriptionCaptionTextBox" StyleName="Caption" />
          </Items>
        </GroupHeaderSection>
      </GroupHeader>
      <GroupFooter>
        <GroupFooterSection Height="0.28125in" Name="labelsGroupFooter">
          <Style Visible="False" />
        </GroupFooterSection>
      </GroupFooter>
    </Group>
  </Groups>
  <Items>
    <PageHeaderSection Height="0.28125in" Name="pageHeader">
      <Style>
        <BorderStyle Default="Solid" />
      </Style>
    </PageHeaderSection>
    <PageFooterSection Height="0.28125in" Name="pageFooter">
      <Items>
        <TextBox Value="=NOW()" Left="0.02083333in" Top="0.02083333in" Width="5.19791667in" Height="0.20000001in" Name="currentTimeTextBox" StyleName="PageInfo" />
        <TextBox Value="=PageNumber" Left="5.23958333in" Top="0.02083333in" Width="5.19791667in" Height="0.20000001in" Name="pageInfoTextBox" StyleName="PageInfo">
          <Style TextAlign="Right" />
        </TextBox>
      </Items>
    </PageFooterSection>
    <ReportHeaderSection Height="0.80823493in" Name="reportHeader">
      <Items>
        <TextBox Value="Panda Settings" Left="0in" Top="0in" Width="10.45833333in" Height="0.7874016in" Name="titleTextBox" StyleName="Title" />
      </Items>
    </ReportHeaderSection>
    <ReportFooterSection Height="0.28125in" Name="reportFooter" />
    <DetailSection Height="0.28125in" Name="detail">
      <Items>
        <TextBox Value="=Fields.name" CanGrow="True" Left="0.02083333in" Top="0.02083333in" Width="5.19791667in" Height="0.20000001in" Name="nameDataTextBox" StyleName="Data" />
        <TextBox Value="=Fields.description" Angle="0" CanGrow="True" Left="5.23958333in" Top="0.02083333in" Width="4.46041679in" Height="0.20000001in" Name="descriptionDataTextBox" StyleName="Data" />
      </Items>
    </DetailSection>
  </Items>
</Report>

Where am I going wrong?



Stef
Telerik team
 answered on 07 Feb 2013
1 answer
91 views
I have a website that includes a report with multiple subreports.  I have to add the functionality that the user can choose which subreports they can/cannot see.  For example, the user may choose to only include reports 1,3 & 5, but not 2 & 4, or any of the rest.  I will probably use some sort of list control to allow the user to select the subreports that they want included.

I have a reportviewer defined in my HTML:

<telerik:ReportViewer ID="ReportViewer1" runat="server" Height="500px" Width="100%">
                    <typereportsource typename="ETRrpts.IndividualSummary, ETRrpts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"></typereportsource>
                </telerik:ReportViewer>

So what is the optimal way for me to identify, show and/or hide the subreports based on the user's selection?

Thank you!
Hadib Ahmabi
Top achievements
Rank 1
 answered on 07 Feb 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?