C# - Crystal Reports SQL query Question

EFileTahi-A

Well-known member
Joined
Aug 8, 2004
Messages
539
Location
Portugal / Barreiro
How can I say to Crystal IFieldsObjects report to get only the records from an Access Database based on an SQL Query?

In other words:
My CR Report have some IFieldsObjects, but they list all records that exists in the target table, but I what it only to list the records when with a spesific criteria...

(SELECT * FROM _table_ WHERE _field_ = "bla")
 
EFileTahi-A

You can use the RecordSelectionFormula

Code:
crReportDocument.RecordSelectionFormula = "{A_Table.Field_In_Table} = Something ";

You can also create your own data tables with just the information you want and then tell CR where to get the data.

Code:
crReportDocument.Database.Tables[0].SetDataSource(A Table);
 
Linking a filtered datatable to the Crystal Report fulfilled all my needs...

Thank you once more.

By the way, I hope you can have internet soon at your home :)
Cheers!

- THREAD CLOSED -
 
Last edited by a moderator:
Back
Top