cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot get rid of the error in the formula

Former Member
0 Kudos

Hello,

I'm using CR 2008 with Visual Studio 2008.

I have a strange problem here. I have a formatting formula that started giving me some errors, and I cannot get rid of it. Even if I remove this formula completely and delete all temporary CR files from the Temp folder - I'm still getting the same error from this function that doesn't exist anymore.

What could be the problem?

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

1) Does the report work in the CR 2008 designer?

2) Make sure you are on [SP3|https://smpdl.sap-ag.de/~sapidp/012002523100007123572010E/cr2008_sp3.exe] and [FP3.5|http://www.sdn.sap.com/downloads/BusinessObjects/cr2008fp35.exe] on top of that.

3) What is the code to run the report object?




CrystalReportViewer1.ReportSource = "C:\test2.rpt"

Dim crReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
crReportDocument.Load("C:\Crystal\crnet\vbnet_win_simplepreviewreport\World Sales Report.rpt")
CrystalReportViewer1.ReportSource = crReportDocument


CrystalReportViewer1.ReportSource = New World_Sales_Report()


4) Where are you changing the report - in the VS .NET IDE or in the CR designer?

- Ludek

Former Member
0 Kudos

Thank you.

Yes, I've checked everything - I'm using the latest version and updates. The code is about the same, and everything works in the designer.

I'm using this font formatting formula in the crosstab report in the summary field:

BooleanVar i;

If i=True Then

crBlack

Else

(

If CurrentFieldValue >= CurrentDate Then

crGreen

Else If CurrentFieldValue < CurrentDate And i=False Then

crRed

Else

crBlack

)

The formula worked fine for years, and it still works. But under certain circumstances I've started getting error:

A boolean is required here. Details: errorKind Error in File TicketTabSchedule2 {38C64669-8EAE-4469-A785-DC08696DFE50}.rpt: Error in formula Object_Visibility: 'BooleanVar i; ' A boolean is required here. Details: errorKind

I'm trying to figure out what could cause this, but I can't, because even if I modify or remove this formula completely (either in VS or CR designer) and clear the cache I'm still getting the same error.

former_member183750
Active Contributor
0 Kudos

The code is about the same

What code? I provided three distinct ways of coding. Which of the three ways are you using?

But under certain circumstances I've started getting error

- What are these certain circumstances?

- What happens if you use the report in a new app? Use a saved data report, then all I'd like you to use is;

CrystalReportViewer1.ReportSource = <path to saved data report>

does that work?

- Ludek

Former Member
0 Kudos

1. Here is the code for opening the report:

DataSet dsReport;

string tabPath = Server.MapPath(p + "Datasource/TicketTabSchedule.xsd");

string reportPath = Server.MapPath(p + "TicketTabSchedule2.rpt");

rpt.Load(reportPath);

Then I'm getting the dataset and bind the report:

rpt.SetDataSource(dsReport.Tables[1]);

2. By certain circumstances I mean different data from the database in the fields that are not even used in this report.

3. I've tried this report in two applications - same thing.

But the strangest thing for me is why the report displays the same error for "'BooleanVar i" even if I remove this formula completely?

Edited by: Peter Afonin on Apr 18, 2011 2:15 PM

former_member183750
Active Contributor
0 Kudos

I'm not sure Peter about the why, but I'd like to see what this report does in the CR designer. Use the blog [Troubleshooting Issues with VS .NET Datasets and Crystal Reports|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13270] [original link is broken] [original link is broken] [original link is broken]; to do that and let me know the results.

Also, consider a brand new test app that would have the following on page init:

Create dataset

load report

pass dataset to report

view report

Umm, try to open the report in the desinger and do a "Save as" on it. Weird, but it may help...

- Ludek

Former Member
0 Kudos

Thank you, Ludek, I'll try. But I'd tried to "Save as" and use different copies of the report already - still the same.

former_member183750
Active Contributor
0 Kudos

Yahh, "save as" was a "hail marry" pass attempt

Let me know how the other tests go.

- Ludek

Answers (0)