Telerik Forums
Reporting Forum
1 answer
491 views
I want the axis to always start at zero, even if the chart has no zero values. How do I do that?
Katia
Telerik team
 answered on 24 Jul 2017
1 answer
271 views

Hello! I apologize for my poor English first.

I am a beginner on Telerik Report. I have to create a Pie chart that displays a datasource's data. Make my point clear:

I am making a Report build on three lists of objects, one object of every list it's named: Status (it can be: Open, On track, Cancelled etc...).

The chart should displays the average of every "Status" inside the three lists of the Report in percent (for example: Open 100%; Open 50%, Open 75% etc...)

The problem is: I don't know how to bind via code the Chart with the ObjectDataSource, I am using Graph Wizard.

I wrote this code 

 private void graph1_NeedDataSource(object sender, EventArgs e)
        {           
            Telerik.Reporting.Processing.Chart chart = sender as Telerik.Reporting.Processing.Chart;
            chart.DataSource = CbpGlobalInitiativesUsdByCountryFollowUpStructure; //it's the DataSource of the entire Report
        }

The Binding of the graph already has "Property path: DataSource", "Expression: =Field.List1 =Field.List2 =Field.List3"

I saw a tutorial and at this point the chart should already works, instead nothing happens!

Where am I get wrong?

Thank you,

Angelo

 

Katia
Telerik team
 answered on 24 Jul 2017
1 answer
228 views

Hi There,

         I'm trying to displaying Telerik report in MVC 6 , its doesn't throw any error either doesn't display the Report viewer with the report. I have provided the Razor code over here . When I Use fiddler, the webapi is throwing an error Telerik.Reporting.Services.Engine.InvalidReportException, from Telerik.Reporting.Services.Engine.ReportEngine.ResolveReportSource(String report). Please help to resolve the issue. Attached the fillder_log as well.

@{var typeReportSource = new TypeReportSource() { TypeName = typeof(BarcodesReport).AssemblyQualifiedName }; }
@(
    Html.TelerikReporting().ReportViewer()
            .Id("Testreport1")
                .ServiceUrl("http://localhost/api/reports/")
                    .TemplateUrl("http://localhost/ReportViewer/templates/telerikReportViewerTemplate.html")
               .ReportSource(typeReportSource)
                .ViewMode(ViewMode.Interactive)
                .ScaleMode(ScaleMode.Specific)
                .Scale(1.0)
                .PersistSession(false)
                .PrintMode(PrintMode.AutoSelect)
                .Deferred()
                   
)
<select id="theme-switcher"></select>
@section scripts
{
    <!--kendo.all.min.js can be used as well kendo.web.min.js and kendo.mobile.min.js-->
    <script src="@Url.Content("~/ReportViewer/js/telerikReportViewer.kendo-11.1.17.614.min.js")"></script>
    <script src="@Url.Content("~/Scripts/themeSwitcher.js")"></script>
    <script src="@Url.Content("~/ReportViewer/js/telerikReportViewer-11.1.17.614.js")"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            //Theme switcher
            themeSwitcher(
                '#theme-switcher',
                '#common-css',
                '#skin-css');
        });
    </script>
    @(Html.TelerikReporting().DeferredScripts())
}

 

 

Katia
Telerik team
 answered on 24 Jul 2017
1 answer
254 views

Hello,

I have been having a problem trying to generate a report programatically. I can generate columns just fine, but when it comes to trying to generate the rows, the ReportViewer gives me a NullReferenceException: "Object reference not set to an instance of an object." As I iterate through my list, I add a new row to the table body. Then, for every cell that needs to be made, I add a ChildGroup to the main Rowgroup. After I've finished iterating and generating everything, I finally add the parent RowGroup. From what I can tell, the way I add rows is close to the way it's done in the designer files. Here is the code in question:

 

private void table1_ItemDataBinding(object sender, EventArgs e)
{
    HtmlTextBox textboxGroup;
    var christieTable = new ChristieTable(ReportParameters["partNumber"].Value.ToString(),
                                          ReportParameters["lotNumber"].Value.ToString());
    var christieProps = typeof(ChristieTable).GetProperties();
 
    table1.ColumnGroups.Clear();
    table1.RowGroups.Clear();
    table1.Body.Columns.Clear();
    table1.Body.Rows.Clear();
    TableGroup rowsTableGroup = new TableGroup();
    List<ReportItemBase> reportItems = new List<ReportItemBase>();
 
    //start at -1 so we can account for the mold # column but retain the ability to index using i
    for (int columnIndex = -1; columnIndex < christieProps.Length - 1; columnIndex++)
    {
        var propValue = (columnIndex != -1) ? (List<Tuple<double, int>>) christieProps[columnIndex].GetValue(christieTable) : null;
        //make sure our column property is populated
        if (propValue != null && propValue.Count > 0)
        {
            var columnsPerStation = 1;
            var currentDip = propValue[0].Item2;
            foreach (var measurePair in propValue)
            {
                if (measurePair.Item2 != currentDip)
                {
                    columnsPerStation++;
                    currentDip = measurePair.Item2;
                }
            }
 
            var tableGroupColumn = new TableGroup();
            table1.ColumnGroups.Add(tableGroupColumn);
            //if tableGroupColumn isn't given a name, all cells will have the same value as cell 0,0
            tableGroupColumn.Name = columnIndex.ToString();
            table1.Body.Columns.Add(new TableBodyColumn(Unit.Inch(1)));
 
            for (int a = 0; a < columnsPerStation; a++)
            {
                textboxGroup = ReportHelper.GenStandardColumnHeader(christieTable.StationNames[columnIndex] + " - DIP NUMBER " + propValue[0].Item2);
                tableGroupColumn.ReportItem = textboxGroup;
                reportItems.Add(textboxGroup);
            }
 
            var value = (List<Tuple<double, int>>) christieProps[columnIndex].GetValue(christieTable, null);
            table1.Body.Rows.Add(new TableBodyRow(Unit.Inch(0.24998027086257935D)));
            for (int rowIndex = 0; rowIndex < 5; rowIndex++)
            {
                TableGroup newRowSubGroup = new TableGroup();
                newRowSubGroup.Name = "row" + (columnIndex + rowIndex + 1).ToString();
                rowsTableGroup.ChildGroups.Add(newRowSubGroup);
                HtmlTextBox newTextBoxTable = ReportHelper.GenTextBox(value[rowIndex].Item1.ToString());
                table1.Body.SetCellContent(rowIndex, columnIndex + 1, newTextBoxTable);
                reportItems.Add(newTextBoxTable);
            }
        }
        else if (propValue == null)
        {
            var tableGroupColumn = new TableGroup();
            table1.ColumnGroups.Add(tableGroupColumn);
            tableGroupColumn.Name = columnIndex.ToString();
            table1.Body.Columns.Add(new TableBodyColumn(Unit.Inch(1)));
 
            textboxGroup = ReportHelper.GenStandardColumnHeader("MOLD #");
            tableGroupColumn.ReportItem = textboxGroup;
            reportItems.Add(textboxGroup);
 
            HtmlTextBox textBoxTable = ReportHelper.GenTextBox("= RowNumber()");
            table1.Body.SetCellContent(0, columnIndex + 1, textBoxTable);
            reportItems.Add(textBoxTable);
        }
    }
    rowsTableGroup.Name = "rowsGroup";
    rowsTableGroup.Groupings.Add(new Grouping(null));
    table1.RowGroups.Add(rowsTableGroup);
 
    table1.Items.AddRange(reportItems.ToArray());
}

 

The GenStandardColumnHeader and GenTextBox methods simply return pre-formatted textboxes, their first parameter being the value of the textbox. The properties of the object ChristieTable that I am iterating through are DataMembers consisting of a list of pairs. Using the debugger, I found that the report processes fine, but throws the exception when trying to render. Despite the fact that rows get clearly added, I found in the debugger that the row count for the table at render time is 0. Any help would be appreciated, thanks.

Stef
Telerik team
 answered on 21 Jul 2017
5 answers
578 views
I have a crosstab with company branch as the row group and invoice month as the column group. Sorting by branch and total works fine, but I can't figure out how to sort by invoice month. I've added a ConditionalSum class as documented here: http://www.telerik.com/blogs/dynamic-sorting-of-reporting-crosstabs-using-a-custom-aggregate-function, but when I set the sort on the crosstab to use the ConditionalSum function it tells me that an aggregate function should not be used in a sort expression. What object do I set the sort on? Is this still the recommended way to accomplish this?
Stef
Telerik team
 answered on 21 Jul 2017
1 answer
472 views
Created a report and believe I have set all the properties correctly to have the report print Landscape on Legal paper.  However upon printing, the defaults are Portrait on Letter paper.  What do I need to go to get the printing properties to read the report correctly.
Yana
Telerik team
 answered on 20 Jul 2017
2 answers
350 views

In my application I have to generate paper setter for online and offline test. I have done that so far quite easily, now my requirement is to create a dynamic template, so that while I print report it should fill all data inside created template.

 

I am also providing what I have achieved still now and what still need to be done more.. Please any one rescue me from here.

 

There is a stand alone report designer available in Telerik, please anyone guide me to use that. I think that might be suited for my need.

 

Or if anyone provide me a demo that will be highly helpful.

Stef
Telerik team
 answered on 20 Jul 2017
3 answers
257 views

Hello,

I have a report that has two parameters.  When accessing the report parameters from the report CS file, the parameters are in the collection, but the values are blank.  Any help would be much appreciated.

 

Thanks,
Virgil

 

ReportViewer.aspx

1.<form id="form1" runat="server">
2.    <div>
3.        <telerik:ReportViewer ID="ReportViewer1" runat="server">
4.        </telerik:ReportViewer>
5.    </div>
6.</form>

 

ReportViewer.aspx.cs

01.protected void Page_Load(object sender, EventArgs e)
02.{
03.    int tableId = int.Parse(Request["tableId"]);
04.    int reportType = int.Parse(Request["reportType"]);
05. 
06.    string typeName = typeof(BG0001).AssemblyQualifiedName;
07. 
08.    var reportSource = new Telerik.ReportViewer.Html5.WebForms.ReportSource();
09.    reportSource.Identifier = typeName;
10.    reportSource.IdentifierType = Telerik.ReportViewer.Html5.WebForms.IdentifierType.TypeReportSource;
11.    reportSource.Parameters.Add("TableId", tableId);
12.    reportSource.Parameters.Add("ReportType", reportType);
13.     
14.    this.ReportViewer1.ReportSource = reportSource;
15.}

The generated markup
<input id="ReportViewer1_hidden" name="ReportViewer1_hidden" type="hidden" value="{"documentMapVisible":true,"parametersAreaVisible":true,"scale":1,"scaleMode":"SPECIFIC","viewMode":"INTERACTIVE","printMode":"AUTO_SELECT","reportSource":{"report":"TestReports.Reports.BG0001, TestReports.Reports, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","parameters":{"TableId":38,"ReportType":3}},"pageNumber":1}">

 

The code inside the BG0001 report

01.public BG0001()
02.{
03.    //
04.    // Required for telerik Reporting designer support
05.    //
06.    InitializeComponent();
07. 
08.    this.ProcessReportParams();
09. 
10.}
11. 
12.protected void ProcessReportParams()
13.{
14.    this.teamId = int.Parse(this.ReportParameters["TableId"].Value.ToString());
15.    this.reportType = int.Parse(this.ReportParameters["ReportType"].Value.ToString());
16.}

 

Intermediate window test of parameter values

01.?this.ReportParameters["TableId"]
02.{Telerik.Reporting.ReportParameter}
03.    AllowBlank: false
04.    AllowNull: false
05.    AutoRefresh: false
06.    AvailableValues: {(none)}
07.    Mergeable: true
08.    MultiValue: false
09.    Name: "TableId"
10.    Text: ""
11.    Type: Integer
12.    Value: ""
13.    Visible: true

 

 

 

Virgil
Top achievements
Rank 1
 answered on 19 Jul 2017
2 answers
138 views

I am using Nested sub report for this situation.

e.g.
Master Report - MainReport which contains Sub Report - SubReport1 and that Sub Report - SubReport1 also contain Sub Report - SubSubReport11.
SubReport1 has multiple data - e.g. Product 1,Product 2 etc.
SubSubReport11 has multiple data - e.g. Product 1 details, Product 2 details etc.
How can I bind data source for SubSubReport11 to get data for each product?

I have this type of scenario, so I have used Nested sub reports.

A. Main Report

       1. Sub Report 1

              a. Sub Sub Report 1 - It contains multiple data...(e.g. Line 1,Line 2,Line 3 etc.)

       2. Sub Report 2

              a. Sub Sub Report 2 - It contains multiple data...(e.g. Line 1,Line 2,Line 3 etc.)

 

If any other way to get this,please let me know.

Please give me any idea.
Thanks & Regards,
Bhavika

Bhavika
Top achievements
Rank 1
 answered on 19 Jul 2017
0 answers
47 views

hi Team,

 

during run time can we swap rows or realign row order after generating the report.

is It possible to x axis and y axis in chart during run time.

we need to achieve above functionality using telerik reports.

 

 

 

karthick
Top achievements
Rank 1
 asked on 19 Jul 2017
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?