on 05-27-2011 2:46 PM
Dear Forum
Is there a method avaialble in c# to establish if an enforced inner join has been made between two tables for crystal reports.
This query follows on from one i posted a few days ago ref data security.
We have a method of securing the data using a combination of a stored procedure and views. But the process requires a enforced inner join between the SP and the views.
The idea being if the SP is in place and has a enforced inner join then data is secure.
We require a method in code of establishing if this join is in place from the perspective of the SP
Any ideas would be welcome
Thank you all in advance
Paul
Hi Paul,
There are Linking API's but I don't believe they will return the type of link you are using and it's not clear if the link is done in CR or in the SP?
One option you can use is to get the SQL CR has in the report and parse it to determine if the join exists, assuming the join is done in CR, if it's not then the users won't be able to change it in CR.
To get the SQL CR uses:
GroupPath gp = new GroupPath();
string tmp = String.Empty;
try
{
rptClientDoc.RowsetController.GetSQLStatement(gp, out tmp);
MessageBox.Show(tmp, "SQL Statement: ", MessageBoxButtons.OK, MessageBoxIcon.Information);;
}
catch (Exception ex)
{
btnSQLStatement.Text = "ERROR: " + ex.Message;
return;
}
To get the links use this API: CrystalDecisions.CrystalReports.Engine.Database.Links
And to get the link Types: CrystalDecisions.Shared.LinkJoinType
Check the SDK help file for more info and the Object Browser also.
Thank you
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ooops. I just realized my post was the same as Don's last point in his message. Please assign him resolution points if the Database.Links resolves your issue.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should be able to get the information you need by exploring the ReportDocument.Database.Links property. This is a collection of TableLink objects which allows you to inspect the JoinType. Some of the join types we support are:
Equal
Includes all the records where the linked field value in both tables is an exact match.
GreaterOrEqual
Includes all records in which the linked field value in the primary table is greater than or equal to the linked field value in the lookup table.
GreaterThan
Includes all records in which the linked field value in the primary table is greater than the linked field value in the lookup table.
LeftOuter
Includes all the records in which the linked field value in both tables is an exact match and every record in the primary for which there is no match.
LessOrEqual
Includes all records in which the linked field value in the primary table is less than or equal to the linked field value in the lookup table.
LessThan
Includes all records in which the linked field value in the primary table is less than the linked field value in the lookup table.
NotEqual
Includes all records in which the linked field value in the primary table is not equal to the linked field value in the lookup table.
RightOuter
Includes all the records in which the linked field value in both tables is an exact match and every record in the lookup table for which there is no match.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.