[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 292
  • Last Modified:

Crystal Reports - RecordSelectionFormula issues

This is a windows Application:

I am trying to select all the records that have a submitted state of "Pending Submission"
It is not working.
it returns all data to me.
I need to figure out why its not returning the specified data.
any idea?

                hardwareSalesSum.SetDataSource(myMPSCommissionsDS);
                crystalReportViewer1.ReportSource = hardwareSalesSum;
                hardwareSalesSum.RecordSelectionFormula = "{SelectMPSCommissionsTransactionBalance.Submitted} = 'Pending Submission'";

Thank you,

NurveTech
0
NurveTech
Asked:
NurveTech
  • 5
  • 4
  • 2
1 Solution
 
frodomanCommented:
Try changing your record selection formula before you assign the reportsource to your viewer...

frodoman
0
 
NurveTechAuthor Commented:
Tried that already and it still does the same thing.
0
 
mlmccCommented:
Is the report saved with data?

If so use this

hardwareSalesSum.DiscardSavedData

               hardwareSalesSum.SetDataSource(myMPSCommissionsDS);
               hardwareSalesSum.DiscardSavedData
               hardwareSalesSum.RecordSelectionFormula = "{SelectMPSCommissionsTransactionBalance.Submitted} = 'Pending Submission'";
               crystalReportViewer1.ReportSource = hardwareSalesSum;

mlmcc
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
NurveTechAuthor Commented:
for some reason the discardsaveddata is not coming up as an option for me in intelisense, and when i try to compile with it, it fails, am i missing something?
0
 
mlmccCommented:
How is hardwareSalesSum declared?

You can also open the report and uncheck the SAVE DATA WITH REPORT option.

mlmcc
0
 
frodomanCommented:
Can you show a more complete section of your code - I suspect the problem may be in lines that we haven't seen.

Also, if you have used the 'save data with report' option simply modify the report, unselect that option, and save it again.

frodoman
0
 
NurveTechAuthor Commented:
the code i have shown is all i use to try and load the data, other then the report that I created, but it doesnt save any data.
0
 
frodomanCommented:
I find that difficult to believe.  For example, aren't you declaring hardwareSalesSum somewhere?  What is hardwareSalesSum anyway, is it a Reportdocument object, a .Net dataset?  

frodoman
0
 
NurveTechAuthor Commented:
ahh, i do that right above everything else, sorry i thought that was in there.

HardwareSalesSummary hardwareSalesSum = new HardwareSalesSummary();

hardwareSalesSum.SetDataSource(myMPSCommissionsDS);
crystalReportViewer1.ReportSource = hardwareSalesSum;
hardwareSalesSum.RecordSelectionFormula = "{SelectMPSCommissionsTransactionBalance.Submitted} = 'Pending Submission'";

This is my entire function.
0
 
frodomanCommented:
What is HardwareSalesSummary?  I mean, what type of object is it?

0
 
NurveTechAuthor Commented:
It is the crystal report object.
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

  • 5
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now