Telerik Forums
Reporting Forum
7 answers
1.4K+ views

I have designed a Telerik report, when printing the report from report viewer, its taking some unique id on the print queue.

How do I document name when printing in Telerik Report viewer.
I found this link when googling,

 http://docs.telerik.com/reporting/m-telerik-reporting-processing-reportprocessor-printreport
but i dont know when it will be called ? where to use this?

GodHank
Top achievements
Rank 1
 answered on 13 Aug 2020
1 answer
246 views

Hello,
We are using Telerik Reporting version R2 2020.
In our app to show report we use HTML5 Report Viewer and Web Report designer. Our project based on .Net Core 3.1. Currently, the report viewer is working fine but we have a problem with a web designer. I tested report web designer with a web page using the Chrome browser and it is not working fine. It shows some error messages when loading some report items. For example in my sample project I'm trying to open barcode report with report web designer. After a few seconds It shows some error messages saying "Could not generate the preview of 'barcode N'" (N - barcode number).  

You can see this from the attached picture file. I could not attache my sample project because it allows only picture file.

Here my Startup file.

    public class Startup
    {
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddCors(o => o.AddPolicy("AllowOrigin", builder =>
            {
                builder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod();
            }));

            //This is for showing picture
            services.Configure<IISServerOptions>(options =>
            {
                options.AllowSynchronousIO = true;
            });

            services.AddRazorPages()
                .AddNewtonsoftJson();

            //Designer
            // Configure dependencies for ReportServiceConfiguration.
            services.TryAddSingleton<ConfigurationService>(sp => new ConfigurationService(sp.GetService<IWebHostEnvironment>()));
            services.TryAddScoped<IReportSourceResolver>(sp =>
                new TypeReportSourceResolver().AddFallbackResolver(new UriReportSourceResolver(
                    Path.Combine(sp.GetRequiredService<ConfigurationService>().Environment.WebRootPath, "Reports"))));
            services.TryAddScoped<IReportServiceConfiguration>(sp =>
                new ReportServiceConfiguration
                {
                    ReportingEngineConfiguration = sp.GetRequiredService<ConfigurationService>().Configuration,
                    HostAppId = "Html5DemoAppCore",
                    Storage = new FileStorage(),
                    ReportSourceResolver = sp.GetRequiredService<IReportSourceResolver>()
                });

            // Configure dependencies for ReportDesignerServiceConfiguration.  
            services.TryAddScoped<IDefinitionStorage>(sp => new FileDefinitionStorage(Path.Combine(sp.GetRequiredService<ConfigurationService>().Environment.WebRootPath, "Reports")));
            services.TryAddScoped<IReportDesignerServiceConfiguration>(sp => new ReportDesignerServiceConfiguration { DefinitionStorage = sp.GetRequiredService<IDefinitionStorage>() });
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            app
             .UseRouting()
             .UseCors("AllowOrigin")
             .UseDefaultFiles()
             .UseStaticFiles()
             .UseEndpoints(config =>
             {
                 config.MapControllers();
             });
        }
    }

    public class ConfigurationService
    {
        public ConfigurationService(IWebHostEnvironment environment)
        {
            this.Environment = environment;
            var configFileName = System.IO.Path.Combine(environment.ContentRootPath, "appsettings.json");
            var config = new ConfigurationBuilder()
                            .AddJsonFile(configFileName, true)
                            .Build();
            this.Configuration = config;
        }
        public IConfiguration Configuration { get; private set; }
        public IWebHostEnvironment Environment { get; private set; }
    }

Can someone help me to solve this problem?
Thank you,



Nasko
Telerik team
 answered on 12 Aug 2020
13 answers
562 views
We have a multilingual report that generates report in English and Mandarin (Chinese).

Initial generation of the reports works well. The reporting control displays the reports in both languages in html format. When we attempt to export into pdf following error occurs

[NotSupportedException: Font Arial Unicode MS 12 Bold is not supported.]
   Telerik.Reporting.Pdf.Fonts.TrueType.FontReader.GetFontData(Font font, Boolean& isTTC) +466
.....


Additionally though the export to rtf;excel works excellent in either of the languange. We are using resx files for multilingual capabilities.

Any help would be greatly appreciated. Struggling with this issue for a certain time now.
Nilesh
Top achievements
Rank 1
 answered on 11 Aug 2020
4 answers
872 views

Hi, 

I'm currently evaluating Telerik Reporting to see if it fits our requirements.

I'm trying to use the "Export a report to a single document to render a report"  to render a very simple report with a single "Hello World" textbox. I used the sample code in the link below.

 

https://docs.telerik.com/reporting/programmatic-exporting-report

I downloaded Telerik.Reporting from nuget.org with version: 13.2.19.1030

I however is experiencing an error once I get to the code:

Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("PDF", reportSource, deviceInfo);

 

Error: 

Telerik.Reporting.Xml.UnsupportedVersionException: 'Cannot read a document with the specified schema: http://schemas.telerik.com/reporting/2020/2.0.
You might be using an older version of the product.'

How should I get around this ? 

We're trying to get to a decision soon so can you please help us asap.

Thank You

 

 

 

 

 

 

 

Yana
Telerik team
 answered on 11 Aug 2020
9 answers
1.6K+ views
I have a report viewer on my asp.net page and its ReportSource.TypeName is set to the .vb file of my report.  My .vb report has a parameter and I need to pass in a value to it.  The report viewer has its own parameters but these seem to be different than the report's parameters as compiled in the .vb code.  How do I pass a value to the report?  

I have looked through the Telerik documentation and I do not see how to do this.  
AQEEL KHAN
Top achievements
Rank 1
Veteran
 answered on 11 Aug 2020
4 answers
5.7K+ views

Hi,

I have a created a .NET Core application and I have added the Telerik reporting controller as detailed in: http://www.telerik.com/blogs/telerik-reporting-and-aspnet-core

It runs fine when I am using external tdrp reports. 

However I am keen to create a report library and use CLR type names.

Unfortunately I am getting the follow error when trying to view the report:

"Unable to get report parameters.
undefinedReport 'Aliaxis.ReportLibrary.Report1%2C%20Aliaxis.ReportLibrary' cannot be resolved."

 

My viewer report source is set as below :-

                    //ReportSource - report description
                    reportSource: { 
                        // The report can be set to a report file name
                        // or CLR type name (report class definition).
                        //report: "test.trdp",
                        report: "Aliaxis.ReportLibrary.Report1, Aliaxis.ReportLibrary",
 
                        // Parameters name value dictionary
                        parameters: {}
                    }

 

Report 1 is a blank report with a textbox in the center. Its namespace/class name is :-

 

namespace Aliaxis.ReportLibrary
{
    partial class Report1

 

Any advice on why I can't get the report to display and am getting this error?

Kind Regards,

Tom

 

AQEEL KHAN
Top achievements
Rank 1
Veteran
 answered on 10 Aug 2020
4 answers
241 views

Here is the description of my problem. It occurs when using Spring.NET dependency injection:

- Create a new Asp.NET project in C# with Visual Studio 2010 SP1.
- Add a reference to Spring.Core (version 0.0.0.40704)
- Add a new Telerik report called Report1.cs (cancel the wizard).
- Add a new Telerik report called Report2.cs (cancel the wizard).
- Compile the solution.
- Add a new class in your project named Class1.
- Add a new class in your project named Class2.
- Add a new interface named IClass2 and make Class2 implement it.
- In Class1 add the following code:

public int GetValue(Class2 myObject)
{
    return 1;
}

In the code behind of the Global.asax file add the following field and the following method:

private static IApplicationContext _applicationContext;
public static T GetInstance<T>(String objectName)
{
    return (T)_applicationContext.GetObject(objectName);
}

- Update the method Application_Start so that it looks like the following:

void Application_Start(object sender, EventArgs e)
{
    // Code that runs on application startup
    _applicationContext = ContextRegistry.GetContext();
}

- Add the required Spring namespaces in the class (Spring.Context and Spring.Context.Support).
- The configuration of Spring.NET doesn't matter here as we will see later. Actually you don't even need to configure Spring.NET
- In Report1, in the detail section add a sub-report. Set its ReportSource property to point to Report2.
- In Report2, add an ObjectDataSource.
- Set the DataSource property of the ObjectDataSource to Class1.
- Set the DataMember property of the ObjectDataSource to GetValue.
- Keep the parameter value empty.
- In the code-behind of Report2, update the constructor so that it looks like this:

public Report2()
{
    //
    // Required for telerik Reporting designer support
    //
    InitializeComponent();
    //
    // TODO: Add any constructor code after InitializeComponent call
    //
    if (!DesignMode)
    {
        IClass2 myObject = Global.GetInstance<IClass2>("Class2");
        objectDataSource1.Parameters["myObject"].Value = myObject;
    }
}

- If it is open, close the Report1 designer. Compile. Reopen the designer. You get the following errors:

- "Object reference not set to an instance of an object."
- "The variable 'report21' is either undeclared or was never assigned."

If you check the designer-generated code of Report1 you will notice that the variable report21 is correctly declared AND assigned.

Now, go back to Global.asax code-behind and update the GetInstance method so that it looks like this;

public static T GetInstance<T>(String objectName)
{
    return (T)(object)new Class2();
}

- If it is open, close the Report1 designer. Compile. Reopen the designer. It's working fine.

My understanding is that the property DesignMode does not work as expected when it is used from within a SubReport. The code in GetInstance should never be called from within the designer. The fact that I have an error when using Spring.NET (probably due to the fact that my config doesn't handle design-time mode correctly but it's another issue) means that this piece of code is actually called at design time. If I open Report2 directly, it is showing as expected.

My issue is the following: I cannot open a report that contains a subreport which constructor is used to handle parameter of type object which are retrieved through dependency injection with Spring.NET

Am I doing something wrong? Is there any fix or workaround for this issue?

Thanks a lot for your help
Katia
Telerik team
 answered on 10 Aug 2020
4 answers
332 views

Hi,

I have an issue with the row height, if table has dynamic column's width.There is the following table structure: parent table has 4 columns, the last one contains child table with images. This column can be hidden (it depends on report parameter value). In case if this column is hidden other columns' width must be changed. But there is an issue with the rows that can be written in more than 1 line in complete table - they take the same height in case if last column is hidden and text is paced in one line. Please see attached screenshot. How to remove this empty place? Also you can find report sample attached (please remove .jpg from filename). Thank you.

Neli
Telerik team
 answered on 07 Aug 2020
2 answers
166 views

Hello,

I build a Report with the standalone ReportDesigner.

The report is connected with a Ms Access database with Microsoft.ACE.OLEDB.12.0 .The datasource is "embedded".

When i launch the preview in the designer it works fine.

 

Now I want to view the report in my WpfCore app (compile in x86 mode).

I have a error :

Unable to establish a connection to the database. Please verify that your connection string is valid. In case you use a named connection string from the
application configuration file, make sure the name is correct and the connection string settings are present in the configuration file of your application.
------------- InnerException -------------
Keyword not supported: 'provider'.

 

I try differents things :

- add an appsetting.

- Changing the connection string dynamically (with the sample code in the KB, which work fine with a SqlServer connection)...

- change driver by Jet4.0 driver...

And it doesn't work...  How can I make it works ??

I know that ms access is not the best database engine but i can't change it...

Guittier
Top achievements
Rank 1
 answered on 07 Aug 2020
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?