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

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

Crystal Report Does Not See Filter in Typed DataSet/DataTable in WinForms

I am using VB.NET 2005 WinForms.  I set a Filter on a Typed DataSet / DataTable, but when I set the Crystal Report to use this DataSet, the report seems to ignore the Filter.

I confirm that the Filter does work by setting a breakpoint on the following statement:
Me.txtResultCnt.Text =   clsOrgLookup.gDsOrgLookup.dt_spOrgLookupResults.DefaultView.Count

I set the Report DataSource like this:
rptMyReport.SetDataSource(clsOrgLookup.gDsOrgLookup)

Any thoughts as to why the report prints all the rows in the DataTable, and not only the Filtered rows ?   Thank you.
0
cgaDesign
Asked:
cgaDesign
  • 4
  • 3
  • 2
2 Solutions
 
WikkardCommented:
Have you tried to apply selection criteria within the report rather than in the dataset ?
OR
Have you tried filtering the dataset when you fill it. ie at database ?

0
 
cgaDesignAuthor Commented:
I fill the dataset in another screen, and display in a a DGV, having a Tag field
Then the user selects, via Tags, only the rows to print.
I then filter the DataSet/DataTable according to the Tag fields that are True.
   Using clsOrgLookup.gDsOrgLookup.dt_spOrgLookupResults.DefaultView.RowFilter = "Tag = 1"

Thank you.
0
 
WikkardCommented:
Could you create a new datatable with just the row you need (from the main ds) and pass that to the report ?

Its a hack I know =p
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
mlmccCommented:
Does the report have saved data?
If so it will ignore the filter and display the data that is saved

mlmcc
0
 
cgaDesignAuthor Commented:
mlmcc,
CrystalReports having saved data, unless I am missing something, is a new concept for me;  can you explain the essence of that, or provide a tutorial link?  Thanks.
0
 
mlmccCommented:
Crystal by default saves the data with the report when you save it.  You can turn the default off through the FILE --> OPTIONS.

If data is saved with the report then the report opens with that data and isn't changed unti you refresh the report through the F5 or refresh icon.

mlmcc
0
 
cgaDesignAuthor Commented:
2 things ...
1. I have Crystal Reports for VS 2005.  It does not have any FILE / OPTIONS menu.  I only get at Crystal through VS 2005.  Lots of others have this issue as well.  I have looked for other menu settings that seem to address a data save, and found one possible, but no change.

2. The report does print what is in the DataTable ... and the user changes that each time they do a search that I have provided for them.  The only problem is that I later filter this table, and the report seems to ignore the filter.  I even tried a Refresh property.

Thanks for your suggestions.
Steve


0
 
mlmccCommented:
I dont hav ethe VS versions so I am not sure where that property is.  I know it is there.  Is there a REPORT OPTIONS?

mlmcc
0
 
cgaDesignAuthor Commented:
I have not received information with which I can solve my problem, and there is also an issue with versions of CR.  I will give up on this for now. Thanks.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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