Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Change Location property of table object Post Reply Post New Topic
Author Message
zhiyuan
Newbie
Newbie


Joined: 20 Nov 2007
Online Status: Offline
Posts: 2
Quote zhiyuan Replybullet Topic: Change Location property of table object
    Posted: 21 Nov 2007 at 7:31am
CryMy report uses COMMAND AS data sourse, and when I change the location of data source in my C# code, I have to assign the myTable.Location property, I found .net read in COMMAND as one table, so, when I assign its location as

MyTable.Location = (string)ConfigurationSettings.AppSettings["databaseName"] + ".dbo." + crTable.Location.Substring(crTable.Location.LastIndexOf(".") + 1);

after this statement, Location will be something like SERVERNAME.dbo.COMMAND, and CryI get following error message:
 
System.Runtime.InteropServices.COMException was caught
  Message="Failed to load database information.\nDetails: The database DLL 'crdb_query.dll' could not be loaded.\rError in File C:\\DOCUME~1\\Zhiyuan.Li\\LOCALS~1\\Temp\\serviceReport {935100AA-592A-4781-BBAC-9F61FF773FCE}.rpt:\nFailed to load database information."
  Source="rptcontrollers.dll"
  ErrorCode=-2147482931
 
however, if I just assign its location property to COMMAND, which is just as how it read in, I got following error message when doing the report export:
 
CrystalDecisions.CrystalReports.Engine.InternalException was caught
  Message="Failed to open a rowset.\nDetails: ADO Error Code: 0x\nSource: Microsoft OLE DB Provider for SQL Server\nDescription: Incorrect syntax near ','.\nSQL State: 42000\nNative Error: \rFailed to open a rowset.\rError in File C:\\DOCUME~1\\Zhiyuan.Li\\LOCALS~1\\Temp\\serviceReport {AAD0566D-162B-482F-8035-90B39BED5B9C}.rpt:\nFailed to open a rowset."
  Source="CrystalDecisions.ReportAppServer.DataSetConversion"
  StackTrace:
       at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
       at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export()
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.Export()
       at ReportsForServiceProvider.ReportManager.SaveAsPDF(ReportDocument aReport, String spName) in C:\Documents and Settings\Zhiyuan.Li\My Documents\Visual Studio 2005\Projects\ReportsForServiceProvider\ReportsForServiceProvider\ReportManager.cs:line 242
 
Can anyone give me a hint on what I should do with Command when assigning Location property?
 
Thanks
 
Zhiyuan
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 21 Nov 2007 at 12:42pm
I am not certain what you are trying resolve. The CR command object generally holds the SQL query. I have never tried to iterate its return in the CR objects. I believe each command object returns essentially a single table of data. I am not aware of a single command object returning multiple tables.
 
If you are talking about a .Net command object that was not clear to me.
 
I am wondering if simply using a .Net dataset might not be a better solution and give you added flexibility.
 
I am sorry I code in VB.Net so I cant send anything in C#. Perhaps others on the forum can help in that regard. They may be able to correct any mistakes in my understanding of the CR Command object.
 
Regards,
 
John W.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.