on 05-20-2011 4:14 PM
Hi All,
I'm doing a project where my report developer team is developing reports in Crystal reports XI.
This report use oledb provider to connect to sql server 2000.
I have tables name like
"abcowner.xyztable"
"pqrowner.xyztable"
so same table in different owner/schema.
Crystal report is using "pqrowner.xyztable" and it runs fine in crystal report.
I'm have embedded this report in asp.net 3.5 and using 11.5.37.0 runtime. When this report is run in asp.net application using
CrystalDecisions.CrystalReports.Engine.ReportDocument() , it's using table in different schema i.e. "abcowner.xyztable".
I have to manually change the location of the table to point to correct owner. I can't fix like this becuase the application wouldn't know which owner/schema to pick.
foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
{
crTableLogonInfo = crTable.LogOnInfo;
crTableLogonInfo.ConnectionInfo = crConnectionInfo;
string strLocation = crConnectionInfo.DatabaseName + "SCHEMA/OWNER." + crTable.Location.Substring(crTable.Location.LastIndexOf(".") + 1);
crTable.ApplyLogOnInfo(crTableLogonInfo);
crTable.Location = strLocation;
}
Any suggestion ?
Thanks
Thanks in advance.
Hello,
Simple answer, if you don't know how is CR supposed to know which schema to use? CR will use the one it has saved in the RPT file.
You'll have to code in for the user to select which one to use, someone has to tell your app which schema to use, either user interface or a config file.
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.
One thing I'd do 1st is make sure you are on [SP 6|https://smpdl.sap-ag.de/~sapidp/012002523100015859952009E/crxir2win_sp6.exe]. Eventually you'll need the SP 6 runtime:
CR XI r2 (SP6) MSM
https://smpdl.sap-ag.de/~sapidp/012002523100000634042010E/crxir2sp6_net_mm.zip
CR XI r2 (SP6) MSI
https://smpdl.sap-ag.de/~sapidp/012002523100000633302010E/crxir2sp6_net_si.zip
Perhaps using the InProc RAS SDK will be better also. See KB [1553921 - Is there a utility that would help in writing database logon code?|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333533353333333933323331%7D.do].
- Ludek
How are you changing it to begin with, and describe what you mean by manually change the location.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Adam,
I opened the RPT using CR IX then went to Databse -> Set DataSourceLocation then drill down the properties of the each table, right click the overridden qualified table name properite and typed in dbname.owner.tablename (for ex: northwind.abcowner.xyztable)
This is what i'm doing in code
ReportDocument crDoc = new ReportDocument();
crDoc.Load(strPath);
foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
{
crTableLogonInfo = crTable.LogOnInfo;
crTableLogonInfo.ConnectionInfo = crConnectionInfo;
crTable.ApplyLogOnInfo(crTableLogonInfo);
If i comment this two lines, then it's picking the "pqrowner" . I have to manually set Location to point to "abcowner" which is picked correctly if I just run under CR IX or crystalreportview control
string strLocation = crConnectionInfo.DatabaseName + ".abcowner." + crTable.Location.Substring(crTable.Location.LastIndexOf(".") + 1);
crTable.Location = strLocation;
}
crDoc.ExportToDisk(ExportFormatType.PortableDocFormat, tmpInputFilePath);
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.