Telerik Forums
Reporting Forum
9 answers
1.1K+ views
Hi,

I need help hiding a tablerow object conditionally from code behind.

I researched on the forums and knowledge base and could not find the answer.

I also looked at the article - http://www.telerik.com/help/reporting/faq-accessing-items.html
but it does not show how to get the tablerow object.

Following is my code.


private void detail_ItemDataBinding(object sender, EventArgs e)
{
    // Get the detail section object from sender
    Telerik.Reporting.Processing.DetailSection section = (Telerik.Reporting.Processing.DetailSection)sender;
    // From the section object get the current DataRow
    Telerik.Reporting.Processing.IDataObject dataObject = (Telerik.Reporting.Processing.IDataObject)section.DataObject;
    object rowdata = (object)section.DataObject.RawData;
    if ((dataObject["EEODStatement"] == null) || (dataObject["EEODStatement"].ToString().Length == 0))
    {
        Telerik.Reporting.Processing.Table table1 = (Telerik.Reporting.Processing.Table)section.ChildElements.Find("table1", true)[0];
        // Here I want to access a particular tablerow object and hide it
    }
}
Muhammad
Top achievements
Rank 1
 answered on 23 Feb 2018
1 answer
876 views
Hi, how can i create a report  programmatically  using TRDX template. In particular, I am interested in putting my custom collection in DataSource.
Silviya
Telerik team
 answered on 22 Feb 2018
0 answers
80 views

Hello,

I am facing an error when I try to open a report which is located in .vb from my MVC View Reportviewer is this a compatibility issue can it be resolved please help! 

 

 

Error creating report instance (Report = HMB2BReport.rptAirlineListPrint, HMB2BReport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null).
An error has occurred.
Invalid report type

muhammed
Top achievements
Rank 1
 asked on 22 Feb 2018
1 answer
705 views

Hello,

I'm having an issue displaying data on the report I have.

I am using ReportDesigner tool to create report file which I want to be rendered however, when If I add text =Fields.WeekStartDate or =Fields.Lines im not getting anything.

 

This what I have:

Report is rendered by using ReportResolverBase class method: ReportSource ResolveReport()

protected override ReportSource ResolveReport(string reportId)
{
    return reportHelper.GetReportSource(reportId);
public ReportSource GetReportSource(string reportId)
{
    var reportSource = new InstanceReportSource();
    reportSource.ReportDocument = Telerik.Reporting.Report Report;
    report.DataSource = new ObjectDataSource(model, null); // model structure below
}
 
var model = new List<Foo>();
class Foo {
    public string WeekStartDate { get; set; }
    public string Year { get; set; }
    public string WeekOfTheYear { get; set; }
    public IEnumerable<Bar> Lines { get; set; }
}
class Bar {   
    public string DueDate { get; set; }
    public string EQCode { get; set; }
    public string EQDescription { get; set; }
    public string WSDescription{ get; set; }
}

 

My ultimate goal is to display Foo items on separate pages something like that:

DetailSection:

WeekStartDate ........................................ Year ....................... WeekOfTheYear............................

DueDate EQCode EQDescription WSDescription

DueDate EQCode EQDescription WSDescription

DueDate EQCode EQDescription WSDescription

DueDate EQCode EQDescription WSDescription (for each Line)

is there a way to achive that?

 

Thanks in advance!

Todor
Telerik team
 answered on 21 Feb 2018
2 answers
198 views

Hi,this is my first time using Telerik Reporting and having some problems....

I added to my Solution a "Telerik Reporting Library R1 2018"

Then added a EDMX file with a couple of tables. Then add a Report "Report1.cs"

Using the Report Designer on Visual Studio:

1.- Add a Entitity DataSource (using the EDMX added before).

2.- Using a table wizard to see the rows of a Table.

When i Press "Preview" tab it shows this error:

Each table row and column maintains a minimum size, resulting in a minimum table
size of {Width=10px, Height=10px}.

And if I try to render it (using c#) to PDF the pdf shows this error too:

An error has occurred while processing Table 'table2':
An error has occurred while resolving 'entityDataSource1' data source: An error occurred while invoking data
retrieval method.
------------- InnerException -------------
No connection string named 'SAOO_ProductionEntities' could be found in the application config file.

But my application Config has the line with the 

<add name="SAOO_ProductionEntities" ..../>

So, wich is the problem? Telerik Reporting have been installed with the MSI package.

Thanks.

 

Jaime
Top achievements
Rank 1
 answered on 21 Feb 2018
0 answers
127 views

Hello, I'm using: Telerik Report Designer (Versión 8.2.14.2017). My issue:

I need to display every record to start on a new page, for example, if Item "1" needs 1.5 pages to be dispalyed, then the next Item "2" must start in page 3 (not in page 2) and so on...

I have a Group Header Section and also a Group Footer Section and they are working as espected.

I have tried a lot of combinations on PageBreak and Keep Together properties and is not working.

Regards, thanks for your help.

David

David
Top achievements
Rank 1
 asked on 19 Feb 2018
0 answers
180 views

There is a way to customize the report with LINQ?

I did this but I made it work

public class ReportController : Controller
    {
        // GET: Report
        public ActionResult Index()
        {
            Uri uri = HttpContext.Request.Url;
            var changeReport = new ReportController().Identification(1, uri);
            return View(new ReportModel() { TheReport = changeReport});
        }

@(Html.TelerikReporting().ReportViewer()
            .Id("reportViewer1")
            .ServiceUrl(Url.Content("~/api/reports"))
            .TemplateUrl(Url.Content("~/Content/ReportViewer/templates/telerikReportViewerTemplate.html"))
            .ReportSource(Model.TheReport)
            .ViewMode(ViewMode.Interactive)
            .ScaleMode(ScaleMode.Specific)
            .Scale(1.0)
            .PersistSession(false)
            .PrintMode(PrintMode.AutoSelect)
            .EnableAccessibility(false)
            .Deferred()
    )

//This is what I do

DBContext db = new DBContext();

            var data = db.Patient.FirstOrDefault();
            var name = data.FirstName + " " + data.LastName;

var txtName= ((Telerik.Reporting.TextBox)report.Items.Find("txtName", true)[0]);
                txtName.Value = !string.IsNullOrEmpty(name) ? name.Trim() : empty;

// in asp.net webforms I did it this way and it worked

var instanceReportSource = new Telerik.Reporting.InstanceReportSource {ReportDocument = report};
                ReportViewer.ReportSource = instanceReportSource;
                ReportViewer.RefreshReport();

Does anyone know how to do this in asp.net mvc?

 

 

Luis Ismael
Top achievements
Rank 1
 asked on 19 Feb 2018
0 answers
129 views

Hello, someone has some idea how to customize reporting

I do the following

 @(Html.TelerikReporting().ReportViewer()
            .Id("reportViewer1")
            .ServiceUrl(Url.Content("~/api/reports"))
            .TemplateUrl(Url.Content("~/Content/ReportViewer/templates/telerikReportViewerTemplate.html"))
            .ReportSource(Model.TheReport)
            .ViewMode(ViewMode.Interactive)
            .ScaleMode(ScaleMode.Specific)
            .Scale(1.0)
            .PersistSession(false)
            .PrintMode(PrintMode.AutoSelect)
            .EnableAccessibility(false)
            .Deferred()
    )

public class ReportController : Controller
    {
        // GET: Report
        public ActionResult Index()
        {
            Uri uri = HttpContext.Request.Url;
            var changeReport = new ReportController().Identification(1, uri);
            return View(new ReportModel() { TheReport = changeReport});
        }
             // Controls

    
            var txtName = ((Telerik.Reporting.TextBox)report.Items.Find("txtName ", true)[0]);
            txtName.Value = !string.IsNullOrEmpty(name) ? name.Trim() : empty;

Luis Ismael
Top achievements
Rank 1
 asked on 19 Feb 2018
0 answers
51 views
I am using two tables in detail section and the output I want is to appear one at  a time. The output I am having is attached below although what I want is to look like something like this.

Allowance                                 Leave
Bonus                                       Annual Leave     2
Increment                                 Casual Leave     4
Muhammad
Top achievements
Rank 1
 asked on 19 Feb 2018
1 answer
166 views

I'm using: Telerik Reporting Q1 2015 v9.0.15.422

I have some data that is duration information (TimeSpan to be specific). I want to show duration in h:mm:ss  so that we can sum up durations in spreadsheet. However, I'm only able to show duration in hh:mm:ss format which can't be summed up in spreadsheet.  Is there any way to show TimeSpan in h:mm:ss format?

Nasko
Telerik team
 answered on 19 Feb 2018
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?