Telerik Forums
Reporting Forum
8 answers
1.1K+ views
I'm trying to incorporate the new InstanceReportSource into an existing program that I've inherited.  I understand the Visual Basic examples given, but I'm stymied how to apply it to a C# program that is using interfaces.  Using the older version of Telerik that came with the program, the code will compile and run (although the designer won't come up).  Upon upgrading to the latest release of Telerik reporting, I've gotten the designer to come up on some of the reports.  However, I've got a few that are flagging errors about the deprecated RecordSource.  Therein is my confusion.  My attempts to incorporate the InstanceReportSource seems to result in more errors and I'm at a loss.  I did submit a trouble ticket when I was first intially using the trial version.  The end result was to "use the Instance Report Source".

I'm currently using Telerik Q2 2012 SP1, Visual Studio C# 10.0.30319.1 and .NET 2010 4.0.30319

In addition to the code listed below, I've also included a screen shot of the error message(s).   Any help or direction you could provide would be greatly appreciated.  Many Thanks!! 

 

namespace Reports 
  
 {
  
 using System; 
  
 using System.ComponentModel; 
  
 using System.Drawing; 
  
 using System.Windows.Forms; 
  
 using Telerik.Reporting; 
  
 using Telerik.Reporting.Drawing; 
  
   
  
/// <summary> 
  
 /// Summary description for Conservation2VacuumReport. 
  
 /// </summary> 
  
 public partial class ConservationPressureReport : Telerik.Reporting.Report, IStandardReport 
  
 {
  
 public ConservationPressureReport() 
  
 {
  
/// <summary> 
  
/// Required for telerik Reporting designer support 
  
/// </summary> 
  
 InitializeComponent();
  
// 
  
 // TODO: Add any constructor code after InitializeComponent call 
  
 // 
  
 }
  
  
  
#region IStandardReport Members 
  
 ProjectReport IStandardReport.ProjectReport 
  
 {
  
get { return this.ProjectReport.ReportSource as ProjectReport; } 
  
 }
  
   
  
TankReport IStandardReport.TankReport 
  
 {
  
get { return this.TankReport.ReportSource as TankReport; } 
  
 }
  
ISO283Report IStandardReport.isoReport 
  
 {
  
get { return isoReport.ReportSource as ISO283Report; } 
  
 }
  
 public bool iso283Visible 
  
 {
  
 get 
{
return isoReport.Visible; 
  
}
  
   
  
set 
  
 {
  
isoReport.Visible = value; 
  
 }
  
}
  
   
  
VacuumReport IStandardReport.vacuumReport 
  
 
  
 get { return this.VacuumReport.ReportSource as VacuumReport; } 
  
 }
  
#endregion
  
}
  
}

 

 

 

Pabricio
Top achievements
Rank 1
 answered on 13 Mar 2018
3 answers
155 views

Hi, I am working on Telerik Reporting version R3 2017. I got the output as expected and it is giving me report very accurately if all data is there. In some cases I am my Table wizards do not have Data in Datasource and as result it is creating an empty patch on report.
Let me explain: Lets say I have 4 table wizards

TableWizard1 - shows Customer with only with First Name
TableWizard2 - shows Customer with only with Last Name
TableWizard3 - shows Customer with only with Address 
TableWizard4 - shows Customer with only with Phone Number

All 4 table wizards getting filled by only one CustomerDetailsDataSource to make it in different tables I applied filters Lets say for TableWizard1, I applied filter if F_Name!= "" or for TableWizard2 I applied filter L-Name!= "". 

Now, my problem is if there is TableWizard1, TableWizard2 & TableWizard4 has some data and TableWizard3 do not have any data still it is showing an empty patch on  ReportViewer, Obviously on PDF also.
 
I had look on NoDataMessage but it seems like it doesnt work in this case. Can you please suggest how can I handle that?
Thank You

Todor
Telerik team
 answered on 12 Mar 2018
1 answer
234 views
We have a number of report that have a company logo on them.  When it is on the screen it looks fine but when printing to PDF or to a printer the logo gets fuzzy.  I have tried a number of different thing to make it clearer.  I have resized it to almost the exact print size yet it still gets fuzzy.  The logo uses a very thin font.
Silviya
Telerik team
 answered on 12 Mar 2018
8 answers
7.0K+ views
I have two date pickers on my report that set two parameters (@BeginDate and @EndDate). In the header of the report and have this textbox:

Date of data: {Parameters.BeginDate.Value} to {Parameters.EndDate.Value}

When the user selects both dates and generate the report, the textbox displays

Date of data: 4/1/2012 12:00:00 AM to 4/2/2012 12:00:00 AM

I do not want the timestamp showing up as the user is only selecting a date. I tried to apply formating to the textbox {0:d} but that didn't work.

Any suggestions?


Punprom
Top achievements
Rank 2
 answered on 09 Mar 2018
0 answers
93 views
Hi all,

I'm creating a report and populating few fields in table. Some columns don't have any record in it and I want that column along with header to be erased or let's say shifted left. 
Here is something that might explain my situation.


Item            VAT Amount             WHT Amount           Total Amount
Table            250                                                          250
Table            1150                                                        1150
Table            50                                                            50


I want this to be like this 


Item            VAT Amount       Total Amount
Table            250                   250
Table            1150                 1150
Table            50                     50


Can anybody help me out with this ?



Muhammad
Top achievements
Rank 1
 asked on 09 Mar 2018
4 answers
1.5K+ views

Hi..
I'm getting a strange error on just one of the rows in my report.    The data looks fine.


"An error has occured while processing TextBox  txtBoxCustomer
The expression contains object 'Exp1' that is not defined in the current"

Any ideas?

thanks again
Manthri
Top achievements
Rank 1
 answered on 08 Mar 2018
3 answers
497 views
Is there an option to have the currency symbol on a textbox (or a column in a table/crosstab item) either fixed or floating.  See attached image.  The screenshot is from Crystal Report.  In fixed format, the currency symbol is left aligned while the number is right aligned, which will give a look like an accounting book.

Fixed: Floating:
$ 1,000,000 $1,000,000
$        1,000        $1,000
$    210,000    $210,000
$             50     $50
------------------- --------------
$ 1,211,050 $1,211,050
------------------- --------------
Silviya
Telerik team
 answered on 08 Mar 2018
5 answers
487 views

I have a report being rendered in an Angular component using the HTML report viewer. I want to display some additional information once the report has finished rendering - so I'm binding to the renderingEnd event of the viewer.

My problem is that I can't access the properties of component from within the callback function. "this" refers to the report viewer itself. Can you please point me in the direction to access the component's properties?

Thanks in advance.

Bob

 

 

Bob
Top achievements
Rank 1
 answered on 07 Mar 2018
1 answer
564 views

I've web application and using AspNetCore 2.0. I'm using Telerik Reporting v12.0.18.125
I'm facing a memory leak issue in my system. After displaying the Report using Report Viewer the Report object is still in the memory heap and refreshing the report one time create more 3 report instances and it is never removed from the memory.
I'm using below CustomReportResolver to Resolve the report using DependencyInjection 

public class CustomReportResolver : IReportResolver
  {
      private readonly IIocResolver iocResolver;
      private readonly IAbpSession abpSession;
 
      public CustomReportResolver(IIocResolver iocResolver,IAbpSession abpSession)
      {
          this.iocResolver = iocResolver;
          this.abpSession = abpSession;
      }
 
      public ReportSource Resolve(string reportId)
      {
          var reportType = Type.GetType(reportId);
 
          if (reportType == null)
              throw new UserFriendlyException($"Could not find a corresponding report for type '{reportId}'.");
 
          var report = (Report) this.iocResolver.Resolve(reportType);
          var customReport = report as ReportBase;
          if (customReport != null)
          {
              customReport.TenntId = abpSession.TenantId;
              customReport.UserId = abpSession.UserId;
              customReport.IocResolver = this.iocResolver;
          }
 
          var reportSource = new InstanceReportSource {ReportDocument = report};
          return reportSource;
      }
  }

and this is the ReportsController

[ApiExplorerSettings(IgnoreApi = true)]
   public class ReportsController : ReportsControllerBase, ITransientDependency
   {
       public ReportsController(IHostingEnvironment environment, IIocResolver iocResolver, IAbpSession abpSession)
       {           
           this.ReportServiceConfiguration =
              new ReportServiceConfiguration
              {
                  HostAppId = "Html5DemoApp",
                  Storage = new FileStorage(),
                  ReportResolver = new CustomReportResolver(iocResolver,abpSession)
              };
       }
   }

I want to find a way to remove the Report Instance from the memory to avoid this memory leak issue.

Thanks,

 

Todor
Telerik team
 answered on 07 Mar 2018
2 answers
282 views

Hi,

I am creating a label in report designer which will include a Code128 barcode. The barcode will include the identifiers 01,13,320 and 21. 

GS1 identifiers: https://www.gs1-128.info/application-identifiers/

I am stuck with building the identifier 320 net-weight in pound (two decimal places --> 3202). Within the database I find values like 7.4563 or 34.2300 or 101.1000, etc. My question is how to round the value, get rid of the separator and to add leading zeros? Values should look like 000746, 003423 and 010110.

The round() functions seems to work with decimal places and I don't find any function to add leading zeros. 

Any help is greatly appreciated! Thanks!

Katia
Telerik team
 answered on 06 Mar 2018
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?