Telerik Forums
Reporting Forum
20 answers
1.1K+ views
I'm using the ReportViewer control in the context of an MVC app, and have it setup as per an example that was provided on these forums, just like below.

This all works just great, until I deploy the application to production. When I access the application through its deployed URL, I get a yellow screen of death (although, it works if I log on to the web server locally). On the web server, the following log entry has been produced:
Event code: 3005 
Event message: An unhandled exception has occurred. 
Event time: 24/09/2012 17:53:02 
Event time (UTC): 24/09/2012 17:53:02 
Event ID: 1b93729293e4496bb55489a6a5febb04 
Event sequence: 333 
Event occurrence: 1 
Event detail code: 0 
 
Application information: 
    Application domain: /LM/W3SVC/1/ROOT/JobSystem.Mvc.csproj_deploy-1-129929735681023175 
    Trust level: Full 
    Application Virtual Path: /JobSystem.Mvc.csproj_deploy 
    Application Path: C:\inetpub\wwwroot\JobSystem.Mvc.csproj_deploy\ 
    Machine name: AMAZONA-NN5G6SK 
 
Process information: 
    Process ID: 3876 
    Process name: w3wp.exe 
    Account name: IIS APPPOOL\DefaultAppPool 
 
Exception information: 
    Exception type: NullReferenceException 
    Exception message: Object reference not set to an instance of an object.
   at Telerik.ReportViewer.WebForms.ViewerState.get_CurrentPage() in c:\temp\reporting\@RBuild-28250\Reporting_Build\Net20\Telerik.ReportViewer.WebForms\ViewerState.cs:line 123
   at Telerik.ReportViewer.WebForms.ReportPageOperation.RenderReport(String format, IList`1 processingReports, Hashtable deviceInfo, Hashtable renderingContext) in c:\temp\reporting\@RBuild-28250\Reporting_Build\Net20\Telerik.ReportViewer.WebForms\ReportPageOperation.cs:line 69
   at Telerik.ReportViewer.WebForms.ReportRenderOperation.PerformOperationOverride() in c:\temp\reporting\@RBuild-28250\Reporting_Build\Net20\Telerik.ReportViewer.WebForms\ReportRenderOperation.cs:line 79
   at Telerik.ReportViewer.WebForms.BasicHandler.ProcessRequest(HttpContext context) in c:\temp\reporting\@RBuild-28250\Reporting_Build\Net20\Telerik.ReportViewer.WebForms\HttpHandler.cs:line 191
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 
 
Request information: 
    Request URL: http://development.intertekjobsys.com/JobSystem.Mvc.csproj_deploy/Telerik.ReportViewer.axd?instanceID=52255353489a40518fb367501fb9e5b7&optype=Report&PageIndex=0&RenderID=2722cd64754447ab82f6da5f52745be7&RenderingFormat=HTMLInteractive 
    Request path: /JobSystem.Mvc.csproj_deploy/Telerik.ReportViewer.axd 
    User host address: 10.248.22.26 
    User: admin@intertek.com 
    Is authenticated: True 
    Authentication Type: Forms 
    Thread account name: IIS APPPOOL\DefaultAppPool 
 
Thread information: 
    Thread ID: 10 
    Thread account name: IIS APPPOOL\DefaultAppPool 
    Is impersonating: False 
    Stack trace:    at Telerik.ReportViewer.WebForms.ViewerState.get_CurrentPage() in c:\temp\reporting\@RBuild-28250\Reporting_Build\Net20\Telerik.ReportViewer.WebForms\ViewerState.cs:line 123
   at Telerik.ReportViewer.WebForms.ReportPageOperation.RenderReport(String format, IList`1 processingReports, Hashtable deviceInfo, Hashtable renderingContext) in c:\temp\reporting\@RBuild-28250\Reporting_Build\Net20\Telerik.ReportViewer.WebForms\ReportPageOperation.cs:line 69
   at Telerik.ReportViewer.WebForms.ReportRenderOperation.PerformOperationOverride() in c:\temp\reporting\@RBuild-28250\Reporting_Build\Net20\Telerik.ReportViewer.WebForms\ReportRenderOperation.cs:line 79
   at Telerik.ReportViewer.WebForms.BasicHandler.ProcessRequest(HttpContext context) in c:\temp\reporting\@RBuild-28250\Reporting_Build\Net20\Telerik.ReportViewer.WebForms\HttpHandler.cs:line 191
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
 
Any ideas at all? This is virtually the last thing that I need to get working before I can put the app into production.

<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Guid>" %>
<%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=6.1.12.820, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
    Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
<%@ Register Assembly="Telerik.Reporting, Version=6.1.12.820, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
    Namespace="Telerik.Reporting" TagPrefix="telerik" %>
<%@ Import Namespace="System.Web.Mvc" %>
<%@ Import Namespace="JobSystem.BusinessLogic.Services" %>
<%@ Import Namespace="JobSystem.Reporting.Data.NHibernate" %>
 
<!DOCTYPE html>
<html>
<head runat="server">
    <title>Consignment Note</title>
</head>
<body>
    <form id="main" method="post" action="">
        <telerik:ReportViewer ID="ReportViewer1" Width="100%" Height="800px" runat="server">
        </telerik:ReportViewer>
    </form>
    <script runat="server">
        public override void VerifyRenderingInServerForm(Control control)
        {
            //To avoid the server form (<form runat="server">) requirement
            //base.VerifyRenderingInServerForm(control);
        }
 
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            var dataSource = new Telerik.Reporting.ObjectDataSource();
            dataSource.DataSource = typeof(NHibernateConsignmentReportDataProvider);
            dataSource.DataMember = "GetConsignmentReportData";
            dataSource.Parameters.Add(new Telerik.Reporting.ObjectDataSourceParameter("consignmentId", typeof(Guid), Model));
            var companyDetailsService = DependencyResolver.Current.GetService<CompanyDetailsService>();
            var report = new JobSystem.Reporting.ReportDefinitions.TelerikConsignmentReport();
            var company = companyDetailsService.GetCompany();
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(company.DefaultCultureCode);
            var logo = companyDetailsService.GetCompanyLogo();
            var pageWidth = report.Width.Value;
            report.MainLogo.Value = logo;
            report.DataSource = dataSource;
 
            var instanceReportSource = new Telerik.Reporting.InstanceReportSource();
            instanceReportSource.ReportDocument = report;
            ReportViewer1.ReportSource = instanceReportSource;
        }
    </script>
</body>
</html>

The web.config like so:
<system.web>
<httpHandlers>
            <add type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=6.1.12.820, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" path="Telerik.ReportViewer.axd" verb="*" validate="true" />
        </httpHandlers>
<system.web>
<system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <modules runAllManagedModulesForAllRequests="true" />
        <handlers>
            <add name="Telerik.ReportViewer.axd_*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=6.1.12.820, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" path="Telerik.ReportViewer.axd" verb="*" preCondition="integratedMode" />
        </handlers>
    </system.webServer>
Stef
Telerik team
 answered on 20 May 2016
2 answers
367 views

I am really fighting objects on my report in that when I preview them, the fields move on me.

Background: I have a 17 individual SQL queries unioned together (dont ask, it is how I have to do it do to a limitation imposed by our software not Telerik).

a. I have a table on the report that is filtered to return 5 records only. (table A)

b. beneath the table, I have a text field

c. Beneath the text field is list control with a field in it (filtered to pull just one record only) (list B)

d. to the right of Table A, I have another table that is filtered to return 10 records only (table C)

 

The result when previewing the report is that table A displays properly its 5 records. Table C displays properly with its 10 records. Label (point b above) displays just below table A as I designed it.

Now here is the issue. List B is below the label but it moved way down the page to start just below the end of the rows in Table C

 

Basically I have a bunch of tables, text fields as labels/titles all over this report and as I add items to the report, they seem to attaching themselves to other objects on the reports.

Is there a way to see what they are attached to and/or tell it to stop doing that and just go where I put the field.

I have read the document online a few times and I just can't figure this out. Any help would be great.

Brian
Top achievements
Rank 1
 answered on 19 May 2016
2 answers
1.4K+ views

Hi,

I am trying to load a trdp file into memory to read what parameters a Report has to create a filter page to fill up the parameters. I also need to set the connection string and provider name dynamically. I can do it using the code on the follow link:

http://www.telerik.com/support/kb/reporting/details/changing-the-connection-string-dynamically-according-to-runtime-data

But, it works for trdx (legancy) file. Using a UriReportSource, the code bellow does not work for trdp file to take a Report object and read information on the report.

Report DeserializeReport(UriReportSource uriReportSource)
    {
        var settings = new System.Xml.XmlReaderSettings();
        settings.IgnoreWhitespace = true;
        using (var xmlReader = System.Xml.XmlReader.Create(uriReportSource.Uri, settings))
        {
            var xmlSerializer = new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();
            var report = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
            return report;
        }
    }

This code with trdx (which is a xml) works fine, but my question is about the binary trdp.

How can I convert a uriReportSource (or given a path for a trdp file how to take it) into a Telerik.Reporting.Report object?

I need to to read the structure of the report and make changes (replace connectionstirng, read expected parameters, etc..).

Thank you.

Fernando
Top achievements
Rank 1
 answered on 19 May 2016
1 answer
271 views

I am using Telerik HTML5 Report Viewer Template where there are options to export PDF,CSV etc. Getting an out of memory exception while exporting to PDF because report has lot of images.

 I am setting DataMember attribute to a method name to fetch report data. DataMember method is called in many instances like when report is being loaded or exported or when previewed.

Is there a mechanism by which I can get the information about what triggered the DataMember method.

For e.g. if Export to PDF is clicked how can I know that Export to PDF has triggered the DataMember method.

I also need suggestion on following stuff.

If I create a custom export to PDF button by modifying Telerik HTML5 Report Viewer Template

1. How can I hook my server side API to that button?

2. How can I pass the report parameters to that API?

 

 

 

Stef
Telerik team
 answered on 19 May 2016
5 answers
122 views
Hi everyone,

i have a report with a page header. But on the first page of the report, the page header should be hidden. So i switched the property "PrintOnFirstPage" for the PageHeader Section to FALSE.

Now on the first page the PageHeader is emtpy (all child elements have been hidden), but the PageHeader itself is still visible. Why? From my point of view it should be completely hidden too. Or has anyone another point of view? ;)

Regards,
Michael
Stef
Telerik team
 answered on 19 May 2016
12 answers
231 views
Hi,

I have a report created using Telerik reporting tool. It displays fine and exports fine as pdf.
But when i export it to rtf (Rich text File) the generated report have fields eaten off or the field details are not displayed completely.

PFA a screen shot of the same

Please help

--Shalini
Kundan
Top achievements
Rank 1
 answered on 19 May 2016
5 answers
2.2K+ views
Hello,

I recently made the mistake of upgrading telerik reports on my desktop PC from 6.2.12.1017 to 6.2.13.110.
My intention was that new projects utilising telerik reports would use the latest build. I do however still need to support older builds that have been deployed to existing customers.
I'm finding that when I attempt to edit an older version of my report whose project references the 6.2.12 build of telerik the report designer no longer works? I get the following error: 
Value cannot be null. Parameter name: instance 

I must be able to support older builds of my software as not all my customers upgrade at the same time so I therefore need to downgrade telerik reports on my system from 6.2.13.110 to 6.2.12.1017 which I hope will fix my issue.
Can somebody point me in the right direction where I can download this specific build so I can reinstall it and begin designing my reports again.

Thanks in advance
Stef
Telerik team
 answered on 18 May 2016
4 answers
83 views

Is Telerik Reporting built on top of an xml foundation?

For example, with rdlc, rdlc files are just xml files.

Are the files which underpin Telerik Reporting xml files, or something different?

 

Thanks

Stef
Telerik team
 answered on 17 May 2016
1 answer
47 views

Is there anyway to print a list of just the columns from that page on a crosstab report?

My report column heading is just a code an I would like to give more detail about that code at the bottom of each page but would only want to explain the codes that have printed on that page. 

For example if I a 2 page report on page 1 the columns that print are ABC, DEF, GHI I would like to print a list after the rows that would look like

ABC - Explanation

DEF- Explanation

GHI - Explanation

I'm not sure if this is possible but I hope my explanation makes some sense.

Thanks

 

Katia
Telerik team
 answered on 16 May 2016
1 answer
248 views
Hello guys, I am trying to configure Telerik Reporting for Html5 in my asp.net mvc 5 application (.Net Framework 4.5). I have another application using asp.net mvc 4 (.net 4.0) that works fine but in mvc 5 and .net 4.5 it fails. I have referenced in my asp.net mvc application the assemblies "Telerik.Reporting" and "Telerik.Reporting.Services.WebApi" (set Copy Local = true) of R2 2016 version of Telerik Reporting. I have configured the handlers in the web.config file too.

In the WebApiConfig.cs file that configure the routes for the web api, I have added the line to configure the routes for telerik reporting api.
public static void Register(HttpConfiguration config)
{
  // Web API routes
  config.MapHttpAttributeRoutes();
 
  config.Routes.MapHttpRoute(
    name: "DefaultApi",
    routeTemplate: "api/{controller}/{id}",
    defaults: new { id = RouteParameter.Optional }
  );
 
  // configure routes for telerik reporting
  Telerik.Reporting.Services.WebApi.ReportsControllerConfiguration.RegisterRoutes(config);
}


The problem is, if I add this line that configure the routes for telerik reporting, I get an error

Could not load file or assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'...

If I remove the line, the application runs fine, but when I try to execute a page with a report, I get another error on the report viewer like this:

Error registering the viewer with the service.
No HTTP resource was found that matches the request URI 'http://localhost:54925/Api/Reports/clients'.


Am I missing something? Is it a problem with the version of .net framework? How can I get it working for asp.net mvc 5 and .net framework 4.5?

Thank you.

Stef
Telerik team
 answered on 14 May 2016
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?