cancel
Showing results for 
Search instead for 
Did you mean: 

when I run a report, it comes up blank.

Former Member
0 Kudos

Hi, guys.

I'm using VS 2013, framework 4.0. So, when I run a report, it comes up blank.

My code

  1.                 ReportDocument report = new ReportDocument(); 
  2.                string strConn = ConfigurationManager.ConnectionStrings["ConexaoBanco"].ConnectionString; 
  3.                report.Load(Server.MapPath(@"..\RelAdmitidosDemitidos\RelAdmitidosDemitidos.rpt")); 
  4.                  
  5.                 char[] delimitador = { ';' }; 
  6.                 string[] palavraAux = strConn.Split(delimitador); 
  7.                 string user = palavraAux[2].Substring(8); 
  8.                 string senha = palavraAux[3].Substring(9); 
  9.                 report.SetDatabaseLogon(user, senha); 
  10.                 AdmitidosDemitidos.ToolPanelView = ToolPanelViewType.None; // Oculta o Group Tree 
  11.                 AdmitidosDemitidos.ReportSource = SetandoFiltros(report); 
  12.                 AdmitidosDemitidos.DataBind(); 
  13.                 AdmitidosDemitidos.Dispose(); 

I'm using the latest version of C.R.

Could soebody help me?

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

VS 2013 is good info. Good additional info may be the version of CR and CR Service Pack

Make sure you are on SP 11:

Move your CR code to Page Init.

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

Former Member
0 Kudos

Hey, thks. But the problem remains the same.

former_member183750
Active Contributor
0 Kudos

Move your CR code to Page Init.


PAGE_INIT

The Page_Init event is the first to occur when an ASP.NET page is executed. This is where you should perform any initialization steps that you need to set up or create instances of server controls. You don't want to try to access controls in this event because there is no guarantee that they have been created yet. It is during this event that they are created, and you can control whether your attempt to use these objects will be thwarted by the server processing your request before the object has been created.

Note that the Page_Init event fires only the first time the page is loaded. When you use a web form and post back to this page again, the Page_Init event doesn't fire. But the Page_Load event fires each time the page loads.

PAGE_LOAD

This is the page event where you will be doing most of your work. This event occurs only when all the objects on the page have been created and are

available for use.

- Ludek

Former Member
0 Kudos

I did it, but the problems remains the same. Well, i download cr viewer 2013 (

) but i can't edit my reports. Only when i download cr2011 😕

former_member183750
Active Contributor
0 Kudos

Hmmm - I'm a bit confused now...

The CR Viewer is just that. A viewer. Much like a PDF viewer. No refresh, no connection to a database. What you see id what you get (essentially a view of a saved data report).

So, what we want to do is go back to your original query re. :


I'm using VS 2013, framework 4.0.

and:


I'm using the latest version of C.R.

That assumed you were using "SAP Crystal Reports, Developer Version for Visual Studio .NET" (v. 13.x). And that you were using Service Pack 10(?). So, now I need you to confim the following:

Version of the crpe32.dll in C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86

Version of the CR assemblies referenced in your project.

Additionally, I assumed you were not providing the full code in your original post, but if you are, then the invocation of the viewer is missing:

CrystalReportViewer1.ReportSource = <the report object> // e.g.; report

Here is basic code I'd like you to try:

        Dim crReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument

        crReportDocument.Load("<path to a report>t")

        CrystalReportViewer1.ReportSource = crReportDocument

The above will force the report to prompt for a db logon and parameters - if any.

You may also want to see the following:

Crystal Reports for Visual Studio 2005 Walkthro... | SCN

(the above applies to all versions of CR and .NET)

Samples

Developer Help:

SAP Crystal Reports .NET SDK Developer Guide

SAP Crystal Reports .NET API Guide

- Ludek

Former Member
0 Kudos

Weird =/

Version of the crpe32 is: 13.0.10.1385

I'm using this code and Service Pack 10.

The version of Crystal.Reports.Design / ReportSource / Engine / Web  is 13.0.2000.0

I'm gonna see these links.

Thank you so much.

Answers (0)