Skip to Content
0

RecordSelectionFormula not applied a second time

Dec 14, 2017 at 11:05 AM

77

avatar image

Hi,

I'm using CR for VS SP 21 (inProc RAS - VB.Net 2015).

Let's take this sample:

  • I open a report (CrystalReports.Engine.ReportDocument.Load)
  • then setting the RecordSelectioFormula (using (CrystalReports.Engine.ReportDocument.RecordSelectionFormula)
  • exporting the report (f.ex. to PDF)
  • (everything's fine here)
  • now setting RecordSelectioFormula to a different filter
  • an export the report a second time
  • the second filter will not be applied!

PS. the report will not be closed and reopened for the 2nd export.

Any ideas,

Patrick

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

8 Answers

Best Answer
Patrick Simons Feb 01 at 01:01 PM
0

I tried it again and yes, the Refresh() method did the trick.

Thanks Don,

Patrick

Share
10 |10000 characters needed characters left characters exceeded
Patrick Simons Dec 18, 2017 at 07:44 AM
0

@Don,Ludek: any ideas?

Share
10 |10000 characters needed characters left characters exceeded
Patrick Simons Jan 03 at 07:24 AM
0

Thanks for your reply.

I was writing about exports, not about preview. So there's no Refresh or what do you mean?

Patrick

Share
10 |10000 characters needed characters left characters exceeded
Don Williams
Jan 02 at 02:23 PM
0

Happy New Year Patrick,

Did you call Refresh() on the second preview?

Just got back from 2 weeks off so I'll try to confirm this soon.

Thanks

Don

Share
10 |10000 characters needed characters left characters exceeded
Don Williams
Jan 11 at 03:49 PM
0

Hi Patrick,

Works for me, I open the report and preview it, I then have a button that sets a new record selection formula. I hit the button and the view the report, DO NOT use Refresh, it will resset the value you just set to the original. And I see the changes.

Original report has this:

{Customer.Customer Credit ID} <= 10

In code I set it to this:

rpt.RecordSelectionFormula = "{Customer.Customer Credit ID} >= 10";

After update below:


obhug.png (88.4 kB)
mvtft.png (44.8 kB)
Share
10 |10000 characters needed characters left characters exceeded
Patrick Simons Jan 18 at 07:47 AM
0

Hi Don,

Would it be possible to get the latest version of your test-program?

Thanks,

Patrick

Share
10 |10000 characters needed characters left characters exceeded
Patrick Simons Jan 23 at 07:41 AM
0

Reminder.... for the test program...

Share
10 |10000 characters needed characters left characters exceeded
Don Williams
Jan 25 at 04:12 PM
0

OK, this is odd, I missed my own view test....

My first test it DID NOT work fine when viewing the report.

The Data only shows 1 row with 10 and not >10.

I had to call rpt.Refresh(); after the record selection change.

Other odd part is Exporting automatically reruns the reports so I need to test when exporting as well...

Update you soon...

Same for exporting, refresh must be called.

Don

Share
10 |10000 characters needed characters left characters exceeded