Telerik Forums
Reporting Forum
1 answer
127 views
Hi

I no similar questions have been asked but the answer has always been to use client side.

I have an intranet application and need to print from the webserver because at one button click i need to loop through and print many reports.

By ajusting security, system impersonation or whatever is it posible to print on the webserver.

Many Thanks

Al
Al
Top achievements
Rank 1
Iron
 answered on 27 May 2010
1 answer
161 views
Dear all,
I am preparing a report that calculates all kinds of things from an objectSource which gets its input from a database view.
The customer wants to only see certain total values which I have grouped. I do need all detail rows because of the selections that have to be made through report parameters, in order to show the right information.

Unfortunately, the customer also wants to be able to sort the report (being the totals) in a few ways. On a detail-level I know how to implement sorting using a dropdown list (I found that on the blog), but so far I have not been able to find a way to sort the report totals.

On http://www.telerik.com/help/reporting/p_telerik_reporting_group_sorting.html I found that there must be a way to do this, but the info on the page:

Gets a SortingCollection that defines the sort column(s), and their type and order for the Group
Collapse imageSyntax
C#
public SortingCollection Sorting { get; }

is not much help to me.

The report shows movie-titles, revenue and number of seats (yes, this is about a movie theatre), and I need to be able to sort those (title ascending, revenue or number of seats descending).

Is there a knowledgeable soul who can tell me how to do this?

Thank you!

Paul
Paul Kater
Top achievements
Rank 1
 answered on 27 May 2010
1 answer
111 views
Are there any plans to add a web based designer in the future?  Something that would allow end users to edit / create reports via a browser.
Steve
Telerik team
 answered on 27 May 2010
3 answers
206 views
Hi, I try to do the same thing you do on one of your Telerik video. I am using silverlight 4 with RIA service.

I use the Business Application templace and add a ReportLibrary in the solution.
In this ReportLibrary I add a simple report named BasicReport.cs

Each time the RaportViewer try to load the rapport i got this error:
Could not load file or assembly 'ReportLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Here my test page:
<navigation:Page   
  x:Class="GestionMembre.About"   
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
  xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" 
  xmlns:RepportViewer="clr-namespace:Telerik.ReportViewer.Silverlight;assembly=Telerik.ReportViewer.Silverlight" 
  mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"    
  Style="{StaticResource PageStyle}" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">  
 
    <Grid x:Name="LayoutRoot">  
        <RepportViewer:ReportViewer x:Name="xReportViewer" ReportServiceUri="../ReportService.svc" Report="ReportLibrary.BasicReport, ReportLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">  
        </RepportViewer:ReportViewer> 
          
    </Grid> 
 
</navigation:Page> 


I test with Reflector to be sure of my assembly name...

Any suggestion?
john baker
Top achievements
Rank 1
 answered on 26 May 2010
1 answer
276 views
I have a a data object that makes a call to a domain context within the web application to retrieve data. The data object loops through this data to build a list that is used by the report. The report appears to execute properly with no errors and the data is displayed properly when the report is run. The problem that I am having is in the report design tool. If I include the code that actually performs the call to the domain context, the "Data Explorer" does not display the field names from the data object. If I comment out the code that calls the domain context, the field names are displayed properly.  I have moved the domain context code out to an external file (outside of the data object) but with the same results.

            //return DomainContext.GetStatusData(null, timeToUse);      <== Data Explorer says "No Data Source"
            return null;                                                                              <== Data Explorer displays data fields

I can set it to "null" when I create the report and set it back to the proper call when I run the report, but it is a pain to do that for all reports that we intend to build. Do you have any recommendations?

Thanks,
Aaron
Steve
Telerik team
 answered on 26 May 2010
2 answers
290 views
Hello,

I'm trying to produce a Line chart that will show me the evolution of the amount of issues for each category over time.
I'm not being able to acomplish it.

I'm looping through a List of categories and for each category I'm creating a ChartSeries where I'm adding ChartSeriesItems containing as YValue their count.

As a side note, for each category I'm fetching its associated Issues and then I'm groupping them by the month and year part of its creation date.

The final output is exactly what I need but...When I run the chart, the dates are showing up on the Y axis (hey what?!!) although I'm explicitly assigning the count of Issues to the YValue of each ChartSeriesItem!

Here's my code (the important part of it) :

I have an IEnumerable that creates my ChartSeries (each category will be a serie):

        private IEnumerable<ChartSeries> CategoryEvolutionSeries(Telerik.Reporting.Chart chart)  
        {  
 
             
            var cats = issues.GroupBy(x => x.CategoryName);  
            List<string> Categorias = new List<string>();  
 
            foreach (var cat in cats)  
            {  
                Categorias.Add(cat.Key);  
            }  
 
 
            foreach (string cat in Categorias)  
            {  
                var IssuesPerCat = issues.Where(x => x.CategoryName == cat);  
                var group = IssuesPerCat.GroupBy(x => x.DateCreated.ToString("yyyy/MM"));  
 
                ChartSeries series = new ChartSeries();  
                series.Appearance.PointMark.Dimensions.Width = 5;  
                series.Appearance.PointMark.Dimensions.Height = 5;  
                series.Appearance.PointMark.FillStyle.MainColor = Color.Black;  
                series.Appearance.PointMark.Visible = true;  
 
                group = group.OrderBy(x => x.Key);  
 
                series.Appearance.LabelAppearance.Visible = false;  
                series.Appearance.ShowLabels = true;  
                series.Name = cat;  
                series.Type = ChartSeriesType.Line;  
 
                foreach (var issue in group)  
                {  
                    ChartSeriesItem item = new ChartSeriesItem();  
                    item.YValue = issue.Count();  
                    series.Items.Add(item);  
                }  
 
                yield return series;  
 
 
            }  
 
        } 

Then, I assign the series to my chart on the NeedDataSource Event:

                defChart.Series.Clear();  
 
                foreach (ChartSeries item in evolseries)  
                {  
                    defChart.Series.Add(item);  
                } 

Since I can't send you the project files (they're part of a big big solution with lots of dependencies) I'm attaching a screenshot of the resulting Chart.

Please help, what am I doing wrong here??
Ves
Telerik team
 answered on 26 May 2010
1 answer
180 views
Hello,

I have tried every single example found to set my XAxis values but none of them seems to work for me.
I'm populating a Line chart manually with a List of objects and it works just fine. I am also setting the XAxis ValueFormat to ShortDate and whatever I do, this includes clearing the collection of ChartAxisItems and adding with my own, I only get dates in the range of 1899/01/01...1900/01/01 etc etc even when I'm explicitly adding items with dates like "2010-01-01...2010-06-01" in OADate format.
I tried to set the Min and Max values of my XAxis to 01/01/2010 to 01/07/2010 but it doesn't produce any effect.


Here's some code because I know you'll ask:

NeedDataSource Event:
 chart1.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Reporting.Charting.Styles.ChartValueFormat.ShortDate;  
              
            List<Issue> issues = new List<Issue>();  
            issues.Add(new Issue() { CategoryName = "Teste1"DueDate = DateTime.Parse("01-01-2010")});  
            issues.Add(new Issue() { CategoryName = "Teste1"DueDate = DateTime.Parse("01-01-2010") });  
            issues.Add(new Issue() { CategoryName = "Teste1"DueDate = DateTime.Parse("01-01-2010") });  
            issues.Add(new Issue() { CategoryName = "Teste1"DueDate = DateTime.Parse("01-02-2010") });  
            issues.Add(new Issue() { CategoryName = "Teste1"DueDate = DateTime.Parse("01-02-2010") });  
            issues.Add(new Issue() { CategoryName = "Teste1"DueDate = DateTime.Parse("01-03-2010") });  
            issues.Add(new Issue() { CategoryName = "Teste1"DueDate = DateTime.Parse("01-04-2010") });  
            issues.Add(new Issue() { CategoryName = "Teste1"DueDate = DateTime.Parse("01-04-2010") });  
            issues.Add(new Issue() { CategoryName = "Teste1"DueDate = DateTime.Parse("01-04-2010") });  
            issues.Add(new Issue() { CategoryName = "Teste1"DueDate = DateTime.Parse("01-04-2010") });  
            issues.Add(new Issue() { CategoryName = "Teste1"DueDate = DateTime.Parse("01-04-2010") });  
            issues.Add(new Issue() { CategoryName = "Teste1"DueDate = DateTime.Parse("01-05-2010") });  
            issues.Add(new Issue() { CategoryName = "Teste1"DueDate = DateTime.Parse("01-05-2010") });  
            issues.Add(new Issue() { CategoryName = "Teste1"DueDate = DateTime.Parse("01-05-2010") });  
            issues.Add(new Issue() { CategoryName = "Teste1"DueDate = DateTime.Parse("01-06-2010") });  
            issues.Add(new Issue() { CategoryName = "Teste1"DueDate = DateTime.Parse("01-06-2010") });  
            issues.Add(new Issue() { CategoryName = "Teste1"DueDate = DateTime.Parse("01-06-2010") });  
 
 
            var cats = issues.GroupBy(x => x.CategoryName);  
 
            List<string> Categorias = new List<string>();  
            chart1.Series.Clear();  
 
            chart1.PlotArea.XAxis.MinValue = DateTime.Parse("01-01-2010").ToOADate();  
            chart1.PlotArea.XAxis.MaxValue = DateTime.Parse("01-07-2010").ToOADate();  
            foreach (var cat in cats)  
            {  
                Categorias.Add(cat.Key);  
            }  
 
 
            foreach (string categoria in Categorias)  
            {  
                var issuesissuesPerCat = issues.Where(x => x.CategoryName == categoria);  
                var groupedIssues = issuesPerCat.GroupBy(x => x.DueDate.ToString("dd/MM/yyyy"));  
 
                ChartSeries series = new ChartSeries();  
                series.Type = ChartSeriesType.Line;  
 
 
                foreach (var issue in groupedIssues)  
                {  
                    ChartSeriesItem csitem = new ChartSeriesItem();  
                    csitem.YValue = issue.Count();  
                    series.Items.Add(csitem);  
                    chart1.PlotArea.XAxis.AddItem(issue.Key);  
                     
                }  
 
 
                chart1.Series.Add(series);  
            } 

and in the attached file is the result of this code...

P.S.: For the record, I'm using the latest version of Q1 2010 (Version=4.0.10.423)

 

Antonio Simoes
Top achievements
Rank 1
 answered on 26 May 2010
1 answer
236 views
Hello,

I'm new here and testing the report tool.

I am trying to create a template (report) for our orders to suppliers.
I like to pass my Order object as datasource what works fine. So i can put info in the report about my supplier (name,address,...)
about my company (name, phone,....). Those two are subobjects of Order (Supplier and Company). So i can access fields from those subobjects of Order.

Now the problem starts with my OrderLines when Order is my datasource i can't use my object orderline that is in the collection OrderLines (this OrderLinesCollection is an object of Order). The expression would look like this =Fields.OrderSupplierLineCollection.Item.Product.Family. Seems i can't reach item in a collection?
Error i get after using the tablewizard : 
An error has occured while processing TextBox 'textBox19':
Common Language Runtime detected an invalid program.
I tryed to do this with a tablewizard and a subreport. (did not find an example that covers this)

So we want a total dynamic orderreport. Company,supplier,lines is all dynamic.
In the header we put the contactinfo of our company and the supplier. In the detail of the report we would like to see our orderlines.
This all with just one Order object that contains all the info.

Is this possible? Where am i going wrong?
Kind Regards,

Koen L
Top achievements
Rank 1
 answered on 26 May 2010
3 answers
242 views
Hi,

How can i have multiple series in chart? How can i create it programmatically? See attached images of my requirement. I don't find any sample on the web. Pls help me on how to proceed for this.

Thanks in advance.
Steve
Telerik team
 answered on 26 May 2010
5 answers
111 views

I have several reports that are built dynamically that stopped working after we upgraded to the Q3 2009 release, using version 3.2.9.1211. I tried setting the ReportViewer's EnableViewState property to false and that had no impact on the problem. When the report is generated a 1-page blank report appears.

 

I took one of the Telerik sample provided on this forum and put it in a small, much simpler project. I receive the exact sample behavior. Here is the code that I am using:

 

using

 

System;

 

 

 

using

 

System.Web;

 

 

 

using

 

System.Web.UI;

 

 

 

using

 

System.Web.UI.WebControls;

 

 

 

using

 

System.Data;

 

 

 

using

 

System.Configuration;

 

 

 

using

 

System.Web.Security;

 

 

 

using

 

System.Web.UI.WebControls.WebParts;

 

 

 

using

 

System.Web.UI.HtmlControls;

 

 

 

using

 

Telerik.Web.UI;

 

 

 

using

 

Telerik.Reporting;

 

 

 

using

 

Telerik.Reporting.Drawing;

 

 

 

public

 

partial class Default : System.Web.UI.Page

 

{

 

protected void Page_Load(object sender, EventArgs e)

 

{

Telerik.Reporting.

Report rpt = new Telerik.Reporting.Report();

 

 

DataSet ds = new DataSet();

 

ds.Tables.Add();

 

DataTable table = ds.Tables[0];

 

 

int columnCount = 3;

 

 

int rowCount = 1000;

 

 

//Add columns

 

 

 

 

 

for (int column = 0; column <= columnCount - 1; column++)

 

{

table.Columns.Add(

"Column" + (column + 1).ToString(), typeof(string));

 

}

 

//Add rows

 

 

 

 

 

for (int row = 0; row <= (rowCount - 1); row++)

 

{

 

string[] rowVals = (string[])Array.CreateInstance(typeof(string), columnCount);

 

 

DataRowCollection rowCollection = table.Rows;

 

 

for (int column = 0; column <= columnCount - 1; column++)

 

{

rowVals[column] =

"value_" + (column + 1).ToString() + "_" + (row + 1).ToString();

 

}

table.Rows.Add(rowVals);

}

rptViewer.Report = GenerateReportDefinition(

ref ds);

 

rptViewer.RefreshReport();

}

 

private Telerik.Reporting.TextBox CreateTxtHeader(string FieldName, int i)

 

{

Telerik.Reporting.

TextBox txtHead = new Telerik.Reporting.TextBox();

 

txtHead.Value = FieldName;

 

return txtHead;

 

}

 

private Telerik.Reporting.TextBox CreateTxtDetail(string FieldName, int i)

 

{

Telerik.Reporting.

TextBox txtHead = new Telerik.Reporting.TextBox();

 

txtHead.Value =

"=[" + FieldName + "]";

 

 

return txtHead;

 

}

Telerik.Reporting.

Report GenerateReportDefinition(ref System.Data.DataSet dataSource)

 

{

Telerik.Reporting.

Report report1 = new Telerik.Reporting.Report();

 

report1.DataSource = dataSource;

 

int count = dataSource.Tables[0].Columns.Count - 1;

 

Telerik.Reporting.Drawing.

Unit x = Telerik.Reporting.Drawing.Unit.Inch(0);

 

Telerik.Reporting.Drawing.

Unit y = Telerik.Reporting.Drawing.Unit.Inch(0);

 

 

SizeU size = new SizeU(Telerik.Reporting.Drawing.Unit.Cm(2), Telerik.Reporting.Drawing.Unit.Inch(0.3));

 

Telerik.Reporting.

ReportItemBase[] headColumnList = new Telerik.Reporting.ReportItem[count];

 

Telerik.Reporting.

ReportItemBase[] detailColumnList = new Telerik.Reporting.ReportItem[count];

 

 

for (int column = 0; column < count; column++)

 

{

 

string columnName = dataSource.Tables[0].Columns[column].ColumnName;

 

Telerik.Reporting.

TextBox header = this.CreateTxtHeader(columnName, column);

 

header.Location =

new Telerik.Reporting.Drawing.PointU(x, y);

 

header.Size = size;

headColumnList[column] = header;

Telerik.Reporting.

TextBox textBox = this.CreateTxtDetail(columnName, column);

 

textBox.Location =

new Telerik.Reporting.Drawing.PointU(x, y);

 

textBox.Size = size;

detailColumnList[column] = textBox;

x += Telerik.Reporting.Drawing.

Unit.Inch(1);

 

}

Telerik.Reporting.

ReportHeaderSection reportHeaderSection1 = new Telerik.Reporting.ReportHeaderSection();

 

reportHeaderSection1.Height =

new Telerik.Reporting.Drawing.Unit(0.3, Telerik.Reporting.Drawing.UnitType.Inch);

 

 

//reportHeaderSection1.Style.BackgroundColor = Color.LightGray;

 

 

 

 

reportHeaderSection1.Items.AddRange(headColumnList);

Telerik.Reporting.

DetailSection detailSection1 = new Telerik.Reporting.DetailSection();

 

detailSection1.Height =

new Telerik.Reporting.Drawing.Unit(0.3, Telerik.Reporting.Drawing.UnitType.Inch);

 

detailSection1.Items.AddRange(detailColumnList);

report1.Items.Add(reportHeaderSection1);

report1.Items.Add(detailSection1);

 

return report1;

 

}

}

Valerie
Top achievements
Rank 1
 answered on 26 May 2010
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?