Crystal Report does not appear on ASP.net web page that is created using VS 2013

I am developing a website using ASP.NET and I want to display the report in my web form. I use a crystal report as my reporting tool. I am using visual studio 2013 as my IDE. This is what I tried. (My version of SAP is 13.0.9).

private void loadReport() { ReportDocument rpt = new ReportDocument(); rpt.Load("D:\\Report_Test.rpt"); rpt.VerifyDatabase(); CrystalReportViewer1.ReportSource = rpt; } 

The above code works fine with visual studio 2010, but not in 2013. When I load the page, it is empty. Do not throw any mistakes. therefore, how to view a Crystal report using Visual Studio 2013?

+5
source share
1 answer

The first thing to check is whether client client files are available for viewing reports, I suspect your problem (you may find that it silently throws a javascript error!). In IIS, he had to create a virtual directory, if IIS Express, then you will need to move the files that the viewer needs manually, the following should work:

Create a folder called crystalreportviewers13 in the root application, copy the contents of the folder C: \ Program Files (x86) \ SAP BusinessObjects \ Crystal Reports for .NET Framework 4.0 \ Common \ Crystal Reports 2011 \ crystalreportviewers to this (the source path seems to depend from different cars).

Add this to your web.config configuration

 <configSections> <sectionGroup name="businessObjects"> <sectionGroup name="crystalReports"> <section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, Custom=null" /> <section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler" /> </sectionGroup> </sectionGroup> 

Then add this to the configuration section of your web.config

 <businessObjects> <crystalReports> <rptBuildProvider> <add embedRptInResource="true" /> </rptBuildProvider> <crystalReportViewer> <add key="ResourceUri" value="/crystalreportviewers13" /> </crystalReportViewer> </crystalReports> </businessObjects> 

And it should work.

First I downloaded the latest version of http://scn.sap.com/docs/DOC-7824

If it still does not appear, check that your web.config points to the correct version. If you still have problems, check the document type in your HTML declaration as I remember that it does not work properly with HTML5.

Edit:

In earlier versions of the crystal, this folder that I mentioned above is automatically copied to c: \ inetpub \ wwwroot \ aspnet_client \ system_web \ 4_0_30319 - if you copy the entire aspnet_client to the root of your application that solved the problem - in a later version Crystal I believe that if you do not have IIS running during installation, it still does not create this folder.

+8
source

Source: https://habr.com/ru/post/1206234/


All Articles