cancel
Showing results for 
Search instead for 
Did you mean: 

CRVS2010 Beta - Selection Formula

Former Member
0 Kudos

I have some reports created with CR4VS2008 that normally work in VS2010+CR4VS2010 (after the standard conversion of the VS solution), but if I edit without changes the .rpt in VS2010 and than save the file in the new CR format, the selection formula hard coded in the rpt no longer works (the selection formula is very simple: {table.field} = 'ALL' ).

Thanks in advance for your help.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hello,

When you edit the old report also Verify the database. What happens?

THank you.

Don

Former Member
0 Kudos

Hi Don,

I just tryed but the problem persists.

For the CR Designer the database has been changed, but this is not true.

Anyway nothing happens.

Thanks

Rocco

0 Kudos

Hi Rocco,

Actually if CR indicates the database changed it did as compared to what the report has saved for your original database info. This also includes field size and naming as well as linking etc.

What database are you using and which database driver, ODBC, OLE DB, Native, etc.?

Thank you

Don

Former Member
0 Kudos

I am using both Access 2003 and SQL Server CE 3.5 SP2, with an OLE DB connection, the problem is the same on both.

0 Kudos

Hi Rocco,

Are you using both databases in the same report or supporting both DB's but only using one at a time?

If you are using both that may be the issue. You can't use Server side Grouping and SQL Expressions will cause problems if they are not deleted first. Try deleting the fields and then tables in blocks to see when the report starts to work and then narrow down which table is causing the problem and to the field level.

Thank you

Don

Former Member
0 Kudos

Hi Dan,

thanks for you help.

Anyway I'm using only a connection at a time (to support both Access .mdb files and SQL Server CE .mdf files but in two different deployments).

Also I am using only one table for my reports ... for this reason I think the problem i very strange.

It is possible that I'm forgetting something but i do nothing (I only save the report in the new format) and then in CRVS2008 my reports work without problem.

Thanks again

Rocco

Former Member
0 Kudos

Hi Don,

I solved my problem.

I changed in report and in code from rpt.RecordSelectionFormula to rpt.DataDefinition.SavedDataSelectionFormula and now it works.

// CS code

...

MyReport rpt = (MyReport )MyWindowsForm.crystalReportViewer1.ReportSource;

...

// Does not work in CR4VS2010 Beta2 but works in CR4VS2008

rpt.RecordSelectionFormula = "{TABLE.FIELD} = 'MY FILTER VALUE'";

// Works in CR4VS2010 Beta2

rpt.DataDefinition.SavedDataSelectionFormula= "{TABLE.FIELD} = 'MY FILTER VALUE'";

Hope this help.

Rocco

Former Member
0 Kudos

I was struggling with this issue asswell (I was using RecordSelectionFormula() for all my reports) for a long time,

but this solution finally helped me (now using SavedDataSelectionFormula() ).

Thanks a lot microc

Former Member
0 Kudos

I've been looking for this solution for a long time. THANKS!

Answers (1)

Answers (1)

0 Kudos

Thank you for posting your solution.