on 08-28-2015 1:18 AM
Hello:
I came across the issue I reported here:
Now I am confused because what I thought it would work it actually doesn't work in all cases.
I used code like this to set the connection and run any CR report in our system.
private ConnectionInfo CreateConnectionInfo() | ||
{ | ||
ConnectionInfo connectionInfo = new ConnectionInfo(); | ||
// | connectionInfo.DatabaseName = "rdDev"; | |
connectionInfo.UserID = _reportRequestInfo.ReportRunUser; | ||
connectionInfo.Password = _reportRequestInfo.ReportRunPassword; | ||
connectionInfo.ServerName = _reportRequestInfo.ReportRunInstance; | ||
return connectionInfo; | ||
} |
private static void SetDbLogonForReport(ConnectionInfo connectionInfo, ReportDocument reportDocument) | |
{ | |
// | Database database = reportDocument.ReportClientDocument.DatabaseController.Database; |
// | foreach (ISCRTable table in database.Tables) |
// | { |
// | _log.DebugFormat("table: {0}", table.QualifiedName); |
// | |
// | } |
Tables tables = reportDocument.Database.Tables; | |
foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables) | |
{ | |
TableLogOnInfo tableLogonInfo = table.LogOnInfo; |
_log.DebugFormat("table={0}, location={1}", table.Name, table.Location); |
tableLogonInfo.ConnectionInfo = connectionInfo; | |
table.ApplyLogOnInfo(tableLogonInfo); | |
} | |
} |
Digging more into the issue, I have I found code such as this one: crls/CrlsReportDocument.cs at master · chrishibler/crls · GitHub
or the one that is generated by Ludek's utility (very similar with the code from the previous link) that sets all sorts of properties and it makes use of the RAS Server classes
Do I need to code this way or the other way? It seems that my way of doing it has the issue that it doesn't retain the original report table schema names.
Basically there are two sets of objects, one under the CrystalDecisions.ReportAppServer.DataDefModel and the other one under CrystalDecisions.CrystalReports.Engine. When do I use one and when do I use the other?
I looked with .Net reflector and the objects under CrystalDecisions.CrystalReports.Engine seem to be wrappers of objects under CrystalDecisions.ReportAppServer.DataDefModel. Why have two sets of objects? I personally find it confusing.
Thanks
HI Costa,
CR does not support Oracle synonyms. To use RAS you have to add the assemblies.
Click on the Overview tab and on the left you'll see a link to get samples, RAS samples are there, download them and try some of them. It will answer a lot of your questions on how to....
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Don:
Not sure why you thought of synonyms - perhaps based on my other message. It is true that some of the tables referenced in the report had synonyms, others didn't though. Do you think that the CR runtime, once it detects synonyms, it tries to detect the schema of a table?
Thanks
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.