Monday 28 January 2008

Crystal Reports Asp.Net issues

Deployed Crystal Reports to server by:

Run CRRedist2005_x86.msi (taken from C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\CrystalReports\)

Icons did not display in CR Toolbar:

Copy C:\Inetpub\wwwroot\aspnet_client to root of website)

 

ADO provider not found (SQL Server 2000):

Report (design-time) connection was SQL-Native changed to be SQLOLEDB.

 

Change connection information at run-time

                CrystalDecisions.Shared.TableLogOnInfo tliCurrent;
                foreach (CrystalDecisions.CrystalReports.Engine.Table tbCurrent in crSource.ReportDocument.Database.Tables)
                {
                    tliCurrent = tbCurrent.LogOnInfo;
                    tliCurrent.ConnectionInfo.ServerName = server;
                    tliCurrent.ConnectionInfo.UserID = username;
                    tliCurrent.ConnectionInfo.Password = password;
                    tliCurrent.ConnectionInfo.DatabaseName = dbname;

                    tbCurrent.ApplyLogOnInfo(tliCurrent);
                }

 

Toolbar Not working

The toolbar options were not working because a post-back was being generated that performs the functionality - the assigning of the report was within a !IsPostBack block. As the report is not held in state it must be reloaded during post back.

Monday 21 January 2008

NHibernate transaction locking oops!

Was testing catching NHibernate.StaleObjectStateException (exception where one user updates a record which another user then attempts to update without getting newer version).

Was getting 'Failed to initialise lazy..." when reloading record on associated collection due to a timeout and also appeared to be locking the server (no queries could be run on tables involved in failed update)

It came down to the transaction not being Rolled-back when exception thrown - so obviously DB still in transaction.