Telerik Forums
Reporting Forum
3 answers
433 views

In my report group section at the bottom of my report, totals are calculated.  Some calculations are dividing based on the Sum() of fields shown in the detail section.

 

If the textbox is defined with value at design time as follows: 

=IIF(Sum(Fields.NumberOfReceipts1) = 0,
   0,
   Sum(Fields.Sales1) / IIF(Sum(Fields.NumberOfReceipts1) = 0, 1, Sum(Fields.NumberOfReceipts1))
)

This works fine and there is no error.  However, because of the number of total boxes in the report - I ended up getting a Stack Overflow message just on entering the component.Initilializer() (First { bracket).  So decided to create these boxes at runtime:

textBox.Value = "=IIf(Sum(Fields.NumberOfReceipts1) = 0, 1, Sum(Fields.NumberOfReceipts1))";

But this now causes the following error:

"An error has occurred while processing TextBox 'rtNoSales12': An error has occurred while executing function IIf(). Check InnerException for further information. ------------- InnerException ------------- Exception has been thrown by the target of an invocation. ------------- InnerException ------------- Index (zero based) must be greater than or equal to zero and less than the size of the argument list."

How can I avoid the Divide by 0 error by defining report textbox values at runtime?

Stef
Telerik team
 answered on 24 Dec 2015
1 answer
445 views

According to the telerik reporting documentation,  Subscript, Superscript (<sub>,<sup>) HTML tags are supported in the HTMLTextBox control. However I cannot seem to get them to render correctly when I export to PDF or WORD. I couldn't find anything in the documentation saying it wouldn't render for those formats. I am trying to debug my code but am stumped at the moment and just wanted an official word on whether this is even supported.

 

 

Katia
Telerik team
 answered on 23 Dec 2015
1 answer
718 views

Hello,

I need to Create Table which displays nested List.

Kindly find attached image to see required design.

 

Thank you.

Katia
Telerik team
 answered on 23 Dec 2015
19 answers
588 views
Hello,

I am looking ahead for options in telerik reporting tool that can help me digitally sign a PDF generated from the telerik report.

Please give me your suggestions for means to achieve this.

Thanks,

Amit
Olivier
Top achievements
Rank 2
 answered on 22 Dec 2015
2 answers
108 views

 

I want desing trdx to image:

 

Stef
Telerik team
 answered on 22 Dec 2015
1 answer
286 views

Hi,

I am trying to show the teleik report with objectdatasource available only at runtime. 

Following is the code which I used. 

                             object jsonobj = getJsonObject();

                            SearchbyCondition oSearch = new SearchbyCondition();
                            List<SearchbyCondition> oListCond = oSearch.getSearchbyConditionReportFields(jsonobj);

                            // Creating and configuring the ObjectDataSource component:
                            Telerik.Reporting.ObjectDataSource objectDataSource = new Telerik.Reporting.ObjectDataSource();
                            objectDataSource.DataSource = oListCond;// GetData returns a DataTable

                            // Creating a new report
                            Telerik.Reporting.Report report = new Telerik.Reporting.Report();
                            
                            // Assigning the ObjectDataSource component to the DataSource property of the report.
                            report.DataSource = objectDataSource;


                            System.Xml.XmlReaderSettings settings = new System.Xml.XmlReaderSettings();
                            settings.IgnoreWhitespace = true;
                            string localPath = Request.ApplicationPath + "Report/" + ReportName;
                            localPath = Server.MapPath(localPath);
                            XmlReader xmlReader = XmlReader.Create(localPath, settings);
                            Telerik.Reporting.XmlSerialization.ReportXmlSerializer xmlSerializer = new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();
                            report = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);

                            // Use the InstanceReportSource to pass the report to the viewer for displaying
                            Telerik.Reporting.InstanceReportSource reportSource = new Telerik.Reporting.InstanceReportSource();
                            reportSource.ReportDocument = report;

                            // Assigning the report to the report viewer.
                            ReportViewer1.ReportSource = reportSource;

                            // Calling the RefreshReport method in case this is a WinForms application.
                            ReportViewer1.RefreshReport();

I can see the report but without any data.

I tried using value="[Fields.BOPropertyName]" 

value="Fields.BOPropertyName" as well in trdx file

 In trdx file how can I give Objectdatasource TAG as while design it is not available.

as mentioned at http://www.telerik.com/help/reporting/connecting-to-data-working-with-data-at-design-time.html

"Data source available only at runtime" passage.

 

Katia
Telerik team
 answered on 22 Dec 2015
9 answers
1.8K+ views
I've used the designer with SQL and that works fine but I need to use a business object as a data source. I see under the Data tab the Object Data Source but Available data source types is empty (not surprisingly). How can I tell the designer where to find my objects?

Thanks,
Don Rule
http://tranlslationalsoftware.com

OK, I think that I have found a section of the config file but still not able to see 

<Telerik.Reporting>
<AssemblyReferences>
<add name="C:\PortalApp\ReportLibrary\bin\Debug\ReportLibrary.dll" version="1.0.0.0" />
      <add name="C:\PortalApp\ReportLibrary\bin\Debug\CdssModels.dll" version="1.0.0.0" />
      <add name="C:\PortalApp\ReportLibrary\bin\Debug\Utilities.dll" version="1.0.0.0" />
</AssemblyReferences>
</Telerik.Reporting>
Stef
Telerik team
 answered on 21 Dec 2015
1 answer
363 views

If I have a table on a report that I want to be filled with lets say 10 rows but if the data source goes over that amount I want to move the remainder of the data to another control on a different page. Is that possible? The idea is somewhat like and overflow but to a different location.

Thank You

Stef
Telerik team
 answered on 21 Dec 2015
1 answer
192 views
Is there any sample on how to use Report viewer with Angularjs and Webapi project?and also how to bind Report viewer with POCO object returned by webapi project?
Stef
Telerik team
 answered on 21 Dec 2015
3 answers
600 views

I'm trying to create a compilation of several instances of the same report using a ReportBook. 

 The issue I'm having is that although I'm instantiating separate instances of the report and setting the date parameter for each, all the reports are returning data for the same date, rather than for their individual parameter dates.

 

My code:

ReportBook reportBook = new ReportBook();
 
reportBook.Reports.Add(new TestReport());
reportBook.Reports.Add(new TestReport());
 
reportBook.Reports[0].ReportParameters["date"].Value = new DateTime(2015, 10, 1);
reportBook.Reports[1].ReportParameters["date"].Value = new DateTime(2015, 10, 2);
 
 
var instanceReportSource = new InstanceReportSource();
instanceReportSource.ReportDocument = reportBook;
reportViewer.ReportSource = instanceReportSource;
 
reportViewer.RefreshReport();

I'm working in C#; the report is included in the Visual Studio project as an object (not a seperate .trdx), with an ObjectDataSource using an externally referenced Entity Framework repository; the DataMember is a method of the EF repository that is essentially 'GetThingsForDate(DateTime date)'.

 

Any insight much appreciated!

Tristan
Top achievements
Rank 1
 answered on 21 Dec 2015
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?