This is a migrated thread and some comments may be shown as answers.

[Web App] Parser Error viewing report

3 Answers 184 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Davide Coletto
Top achievements
Rank 1
Davide Coletto asked on 06 Feb 2008, 06:34 PM
In my web-application I've created a page with the ReportViewer.
I want to display directly the PDF file without view the report.
In the Page_Load event I've written:

Report1 report = new Report1(cnString, idProduct);
ReportViewer1.Report = report;
//Export to PDF (method from the Telerik Reporting help)
ExportToPDF("Product_" + idProduct, report);

In the local machine it works and I obtain the PDF file, but on the server I get an error.I've copied the following dll on the bin folder on the server:
  • Telerik.Reporting.dll
  • Telerik.Reporting.Processing.dll
  • Telerik.Reporting.Interfaces.dll
  • Telerik.ReportViewer.WebForms.dll
When I try to view the page I obtain the following error:

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Cannot create an object of type 'Telerik.Reporting.Report' from its string representation 'ReportScheda.Report1, ReportScheda, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' for the 'Report' property.

3 Answers, 1 is accepted

Sort by
0
Chavdar
Telerik team
answered on 06 Feb 2008, 06:40 PM
Hello Davide,

Check the declaration of the ReportViewer control in the aspx page which you are trying to display and delete the Report property if it is set there. This is not necessary as you are creating and assigning a report in the code behind.

Hope this helps.

Kind regards,
Chavdar
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Davide Coletto
Top achievements
Rank 1
answered on 07 Feb 2008, 05:57 PM
I've tried to unassign the property Report in the ReportViewer but I obtain the PDF file on the local machine, while on the server I visualize a page with the report blank.
So I put the ExportToPDF method in the search page (without a control ReportViewer).  I've added these namespaces:
//My report's namespace
using ReportScheda;
using Telerik.Reporting;
using Telerik.Reporting.ImageRendering;
using Telerik.Reporting.Processing;
using Telerik.WebControls;


private void ExportToPDF(string reportName, Telerik.Reporting.Report reportToExport)
{  
    ...  
    this.Page.Response.End();
}

but I have the same problem on the server machine: I don't obtain the PDF file. In the log file I read this error:

07-02-2008 18:45:12.640 [5] ERROR - btnReportScheda_Click: Esportazione report scheda in formato PDF.
System.TypeInitializationException: L'inizializzatore di tipo di 'Telerik.Reporting.PropertyStore' ha generato un'eccezione. ---> System.Security.SecurityException: Richiesta di autorizzazione di tipo 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' non soddisfatta.
   in System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
   in System.Security.CodeAccessPermission.Demand()
   in System.Drawing.Graphics.FromHwnd(IntPtr hwnd)
   in Telerik.Reporting.Drawing.Unit.get_DotsPerInch()
   in Telerik.Reporting.Drawing.Unit.ConvertToUnits(Double pixels, UnitType type)
   in Telerik.Reporting.Drawing.Unit..ctor(Double pixels)
   in Telerik.Reporting.PropertyStore..cctor()
Azione non riuscita:
Demand
Tipo della prima autorizzazione non riuscita:
System.Security.Permissions.SecurityPermission
Area dell'assembly con errori:
MyComputer
   --- Fine dell'analisi dello stack dell'eccezione interna ---
   in Telerik.Reporting.Report..ctor()
   in ReportScheda.Report1..ctor(String connString, String idScheda)

Can you help me?
Thanks.
Best regards.
0
Chavdar
Telerik team
answered on 08 Feb 2008, 05:23 PM
Hi Davide,

The specified exception indicates lack of security permissions. Please, check whether the web application works in Full trust security level and if not, try to run it again in full trust.

Kind regards,
Chavdar
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Davide Coletto
Top achievements
Rank 1
Answers by
Chavdar
Telerik team
Davide Coletto
Top achievements
Rank 1
Share this question
or