Telerik Forums
Reporting Forum
1 answer
249 views

we want to create a dynamic grid. the first column has to be vertical grouped for certain rows. when we add  the row group it throws this error

here is the code and stack trace

Telerik.Reporting.TableGroup tableGroupPremiumBsisChild = new Telerik.Reporting.TableGroup();

                                                tableGroupPremiumBsisChild.Groupings.Add(new Telerik.Reporting.Grouping(null));
                                                tableGroupPremiumBsisChild.Name = "detailTableGroup";

                                                Telerik.Reporting.TableGroup tableGroupPremiumBsis = new Telerik.Reporting.TableGroup();
                                                tableGroupPremiumBsis.ChildGroups.Add(tableGroupPremiumBsisChild);
                                                tableGroupPremiumBsis.Groupings.Add(new Telerik.Reporting.Grouping("=Fields.[" + recap.Columns[i].ColumnName.ToString() + "]"));
                                                tableGroupPremiumBsis.GroupKeepTogether = true;
                                                tableGroupPremiumBsis.Name = "exposureBasis";

                                                tableGroupPremiumBsis.ReportItem = textBoxTableRValue;
                                                tableGroupPremiumBsis.Sortings.Add(new Telerik.Reporting.Sorting("=Fields.[" + recap.Columns[i].ColumnName.ToString() + "]", Telerik.Reporting.SortDirection.Asc));

                                                //adding this line throws the object reference not set to an instance of the object
                                                recapTable.RowGroups.Add(tableGroupPremiumBsis);

                                                textBoxTableRValue.Angle = 270D;
                                                textBoxTableRValue.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(0.28124985098838806D), Telerik.Reporting.Drawing.Unit.Inch(0.30208322405815125D));
                                                textBoxTableRValue.Style.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(218)))));
                                                textBoxTableRValue.Style.BorderColor.Default = System.Drawing.Color.Gray;
                                                textBoxTableRValue.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid;
                                                textBoxTableRValue.Style.BorderWidth.Default = Telerik.Reporting.Drawing.Unit.Point(0.5D);
                                                textBoxTableRValue.Style.Color = System.Drawing.Color.Black;
                                                textBoxTableRValue.Style.Font.Size = Telerik.Reporting.Drawing.Unit.Point(8D);
                                                textBoxTableRValue.Style.Font.Name = "Calibri";
                                                textBoxTableRValue.Style.LineColor = System.Drawing.Color.Gray;
                                                textBoxTableRValue.Style.LineWidth = Telerik.Reporting.Drawing.Unit.Point(0.5D);
                                                textBoxTableRValue.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center;
                                                textBoxTableRValue.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
                                                textBoxTableRValue.Value = "=Fields.[" + recap.Columns[i].ColumnName.ToString() + "]";
                                                textBoxTableRValue.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
                                                recapTable.Body.SetCellContent(0, i, textBoxTableRValue);

here is the stack trace...any idea what is going wrong? thanks for your help

System.NullReferenceException occurred
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=<Cannot evaluate the exception source>
  StackTrace:
   at Telerik.Reporting.Processing.Table.ForEachCell(Action`1 action)
   at Telerik.Reporting.Processing.Table.MeasureDataItemContent(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.DataItem.MeasureContent(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.AbsolutePositionLayout.MeasureChildItems(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.AbsolutePositionLayout.MeasureContent(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.Panel.MeasureContent(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.AbsolutePositionLayout.MeasureChildItems(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.AbsolutePositionLayout.MeasureContent(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.ReportSectionBase.MeasureContent(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.StackLayout.MeasureContent(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.Group.MeasureContent(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.StackLayout.MeasureContent(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.Report.MeasureContent(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.SubReport.MeasureContent(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.AbsolutePositionLayout.MeasureChildItems(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.AbsolutePositionLayout.MeasureContent(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.ReportSectionBase.MeasureContent(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.StackLayout.MeasureContent(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.Group.MeasureContent(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.StackLayout.MeasureContent(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.Report.MeasureContent(IMeasureContext context, SizeLU availableClientSize)
   at Telerik.Reporting.Processing.LayoutElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.VisualElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Processing.ProcessingElement.MeasureCore(IMeasureContext context, SizeLU availableSize)
   at Telerik.Reporting.Paging.PhysicalPageLayout.PhysicalPageMeasurement.MeasureRoot(LayoutElement root, IMeasureContext measureContext, PageSettings pageSettings)
   at Telerik.Reporting.BaseRendering.RenderingExtensionBase.MeasureRootCore(LayoutElement root, IMeasureContext measureContext, PageSettings pageSettings)
   at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(LayoutElement root, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback, PageSettings pageSettings)
   at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
   at Telerik.Reporting.Processing.ReportProcessor.CountPages(IList`1 reports, IRenderingContext renderingContext, Hashtable deviceInfo, ExtensionInfo extensionInfo)
   at Telerik.Reporting.Processing.ReportProcessor.RenderCore(ExtensionInfo extensionInfo, IList`1 processingReports, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
   at Telerik.Reporting.Processing.ReportProcessor.ProcessAndRender(String format, ReportSource reportSource, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
   at Telerik.Reporting.Processing.ReportProcessor.ProcessAndRenderStateless(String format, ReportSource reportSource, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
   at Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, ReportSource reportSource, Hashtable deviceInfo)
   at Exl.Reporting.Audit.Classes.Render.<GenerateCarrierViewReport>d__4.MoveNext() in C:\ProjectsAS3Dev\Support Classes\Exl.Reporting.Audit\Classes\Render.cs:line 675

Stef
Telerik team
 answered on 16 Jun 2017
1 answer
102 views

I have a graph with 2 line series. For one of them I have set Tool tip(both Text and Title Properties)

The tool-tip does shows when I hover over the marker. But it doesn't hide when the cursor is moved or clicked somewhere else.

It throws the below jquery error.

Uncaught TypeError: anchor[0].className.match is not a function
    at init._animationClose (kendo.all.js:17881:50)
    at Object.complete [as completeCallback] (kendo.all.js:17817:26)

 

we are using Telerik Reporting R1 2017

Yana
Telerik team
 answered on 16 Jun 2017
21 answers
8.2K+ views

How is the best way to use the report .trdp files.

All the best practice says to build reports in a class file, and reference that.

I ask because we currently design in a class, then serialise that to an XML file to deploy.

Our report viewer scans the reports folder for these xml files and provided the reports in a drop down.

We then de serialise the report and run. Would be nice to be able to do this with the native report files, and skip the serialise / de serialise process.

But I can t see a way to use the native files in this manner.

 

Andy

Stef
Telerik team
 answered on 16 Jun 2017
1 answer
78 views

Hi,

Is it possible to have fixed size panels in a stand alone report designer and when the content inside is larger than the panel size, to have sliders for the panel like in the attached pic? 

 

Stef
Telerik team
 answered on 15 Jun 2017
8 answers
900 views

Hello.

There is problem with dynamic creation of table columns in MVC Report. Situation is in the following.

In my Report.cs file I override OnNeedDataSource() method. In it I create System.Data.DataTable, then attach this DataTable to Telerik's table as DataSource.

Code for this methods:

 

/// <summary>
/// Creates DataTable from ReportRecords
/// </summary>
/// <param name="data">List of ReportRecords</param>
/// <returns>DataTable filled with ReportRecord's values</returns>
private System.Data.DataTable CreateDataTable(List<ReportRecord> data)
{
    System.Data.DataColumn currentColumn = new System.Data.DataColumn("Current", typeof(int));
    System.Data.DataColumn lateColumn = new System.Data.DataColumn("Late", typeof(int));
    System.Data.DataColumn foreignColumn = new System.Data.DataColumn("Foreign", typeof(int));
   
    System.Data.DataTable table = new System.Data.DataTable("table");
    table.Columns.AddRange(new System.Data.DataColumn[] { currentColumn, lateColumn, foreignColumn });

    foreach (ReportRecord reportRecord in data)
    {
        System.Data.DataRow row = table.NewRow();

        row["Current"] = reportRecord.Current;
        row["Late"] = reportRecord.Late;
        row["Foreign"] = reportRecord.Foreign;

        table.Rows.Add(row);
    }

    return table;
}

 

/// <summary>
/// Assign DataTable as DataSource of dinamically created table in report
/// </summary>
/// <param name="table">DataTable with data to display</param>
private void AddTableToReport(System.Data.DataTable table)
{
    this.tableMain.DataSource = table;

    //create two HtmlTextBox items (one for header and one for data) which would be added to the items collection of the table
    Telerik.Reporting.TextBox textboxGroup;
    Telerik.Reporting.TextBox textBoxTable;

    //we do not clear the Rows collection, since we have a details row group and need to create columns only
    this.tableMain.ColumnGroups.Clear();
    this.tableMain.Body.Columns.Clear();
    this.tableMain.Body.Rows.Clear();
    int i = 0;
    this.tableMain.ColumnHeadersPrintOnEveryPage = true;
    foreach (System.Data.DataColumn dc in table.Columns)
    {
        Telerik.Reporting.TableGroup tableGroup = new Telerik.Reporting.TableGroup();
        Telerik.Reporting.TableGroup tableGroup2 = new Telerik.Reporting.TableGroup();
        tableGroup.ChildGroups.Add(tableGroup2);
        this.tableMain.ColumnGroups.Add(tableGroup);
        this.tableMain.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Unit.Inch(1)));

        textboxGroup = new Telerik.Reporting.TextBox();
        textboxGroup.Style.BorderColor.Default = Color.Black;
        textboxGroup.Style.BorderStyle.Default = BorderType.Solid;
        textboxGroup.Value = dc.ColumnName;
        textboxGroup.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
        tableGroup.ReportItem = textboxGroup;

        textBoxTable = new Telerik.Reporting.TextBox();
        textBoxTable.Style.BorderColor.Default = Color.Black;
        textBoxTable.Style.BorderStyle.Default = BorderType.Solid;
        textBoxTable.Value = "=Fields." + dc.ColumnName;
        textBoxTable.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
        this.tableMain.Body.SetCellContent(0, i++, textBoxTable);

        this.tableMain.Items.AddRange(new ReportItemBase[] { textBoxTable, textboxGroup });  
    }
}

But, as result, I achieve values from first colum of my DataTable in every column of my Telerik's table:

Current    Late    Foreign
0         0        0
20      20       20
1        1        1
21      21       21
4        4        4

 

But values should be the following:

Current    Late    Foreign
0         0        1
20       1        0
1         0        6
21       0        0
4         1        0

Why this happens and how to solve the situation?

Stef
Telerik team
 answered on 14 Jun 2017
5 answers
635 views
Hi,

I am trying to integrate Telerik reports into my existing MVC web application.
I didn't create new class library for reports, just added a new reports folder to the existing project.
When i add data sources to the reports with sql server authentication mode, the connection strings dont get added to web.config file.
Also in the Data Sources configuration wizard i see past connection strings which are not present in web.config file.

Where file are the connection strings created using wizard saved to?
How to delete the old connection strings?

Also i created a connection string with the same name as that in web.config file. but i get the error shown in attached file when i try to add fields onto report.

Thanks.
Srinath.
Stef
Telerik team
 answered on 14 Jun 2017
7 answers
268 views
Does Telerik have any plans for supporting PDF/A standard, in the Telerik Reporting tools ?

We have based our PDF's on your component, but are now in the situation, where we have to support the PDF/A standard.
Katia
Telerik team
 answered on 14 Jun 2017
3 answers
239 views
There appears to be a bug in the HTML Preview rendering engine.

We have a report that includes a column returning a moderately long string (<120 characters).
The TextBox CanGrow property for that column is set to True.
Whether MultiLine is set to True or False, the TextBox does NOT grow vertically in HTML preview.  It does in the regular Preview.
The detail section is contained within a label group for the column headers.

When I view source, for the TextBox in question, I see class="s6" style="position:absolute;overflow:hidden;left:1px;top:248px;width:326px;height:26px;"
where class .s6 = {font-family:Tahoma;font-size:8pt;color:Black;word-wrap:break-word}

Version = 5.3.11.1116.
When I save the source and open it in Ie9 or Firefox, it appears to render correctly. 
I haven't yet tested the live-rendered report in a browser.
Stef
Telerik team
 answered on 14 Jun 2017
1 answer
280 views

I'm working on a proof of concept using Telerik Reporting. The requirements are that the report be loaded from an XML source and provide that report with data via a DataTable (from the System.Data namespace). The problem is that my data isn't showing up in my report. The generated report has table in it and it has the right number of rows but there is no information in any of the rows. Below is a copy of the code I'm using to generate the report:

XmlReaderSettings settings = new XmlReaderSettings
{
    IgnoreWhitespace = true
};
 
using (StringReader sr = new StringReader(template.Layout)) //template.Layout contains a string which is the report XML
using (XmlReader xmlReader = XmlReader.Create(sr, settings))
{
    ReportXmlSerializer xmlSerializer = new ReportXmlSerializer();
 
    TelerikReport reportInstance = (TelerikReport)xmlSerializer.Deserialize(xmlReader);
    DataSet data = BuildDataSet(template, parameters); //Retreives the data from the database in a DataSet
 
    ObjectDataSource dataSource = new ObjectDataSource
    {
        DataSource = data.Tables[0]
    };
 
    reportInstance.DataSource = dataSource;
 
    return reportInstance;
}

The XML for the report (and the value of template.Layout) can be found here. The generated PDF shows 3 rows which is the same number of rows that the DataTable has. That means the DataTable is being read correctly but the data isn't getting parsed correctly for some reason. If I can get this working it would make Telerik the prime candidate for the final version of the software.

Katia
Telerik team
 answered on 13 Jun 2017
6 answers
314 views
This is my first time to use Telerik reporting and I just upgraded from Visual Web Developer Express to VS 2012.

I have a web application project.

I've created a single report, bound to a sql data source, no parameters. I can preview the report and see all the data.
Report name: trpt01 - which creates a trpt01.cs and trpt01.resx file.

I've added a reportviewer to the page named rptview.

I have a button on the page and it runs the code to display the report "trpt01" in rptview.

I see examples using UriReportSource and InstanceReportSource. This seems very simple but I cannot get it to run.

Telerik.Reporting.UriReportSource ur = new Telerik.Reporting.UriReportSource();
ur.Uri = "trpt01.cs";
rptview.ReportSource = ur;
rptview.RefreshReport();

If I change ur.Uri to a name I know does not exist.. ie: "abc" or "abc.cs" - the reportviewer gives a "Generating Report" message. I've left it running and it continued for several minutes. If I give it the name "trpt01.cs" it runs and returns a "Data at the root level is invalid. Line 1, position 1." error message.

What am I missing? How do I refer to a report that I have in the root of my project?

Thanks.
Stef
Telerik team
 answered on 13 Jun 2017
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?