Wednesday, September 23, 2009
Deploying a Crystal Reports Application to a Remote Server
A common misconception about deploying a Crystal Reports application written in ASP.NET is that the remote server must have the Crystal Reports .NET server components installed. The only thing to keep in mind is that you must purchase a licensed copy of Crystal Reports from Business Objects (www.businessobjects.com) in order to deploy your application to a remote server. The license for the version that comes shipped with Visual Studio .NET is just for evaluation and only works on the local development machine.
The issue that developers run into is how the Crystal Reports Developer tool is installed on the development machine. When installed, the developer tool installs the server components into the following directory:
C:\Program Files\Common Files\Crystal Decisions\2.5\managed
From there, the components are registered into the local machine's Global Assembly Cache (GAC) located in C:\windows\assembly. If you are using Visual Studio .NET to develop your application, then you reference the Crystal Decisions classes from the GAC. This is fine when you run the application on the local machine. But when you deploy the application to the remote server, by default you will get an error because the Crystal Decisions components are not registered in the remote server's GAC. Here is how you work around this issue.
For all of the classes your application references, you need to go to the above Common Files directory and copy the matching DLL files to your application bin folder. The bin folder is located in the root of your Visual Studio .NET application. Once you have copied the DLLs, remove any old references from your Visual Studio .NET application. You will find this setting in Solution Explorer under References. Right-click any CrystalDecisions.* reference and select Remove. Then right-click on Reference and select Add Reference. Click Browse, where the default directory should be your application's root, and double-click the bin directory. Select the Crystal Decisions components and click Open and then OK. Recompile your application, and upload it to the remote application. Make sure you upload all of the contents of the bin folder.
With the steps above, you should not have any issues deploying your Crystal Reports application built with Visual Studio .NET. If you are still using classic ASP to generate your Crystal Reports, then the components still have to be registered on the server: either use the Installation CD or extract the components and manually register the components on the web server using regsvr32.exe or a COM+ package. You can find additional support information atwww.businessobjects.com/support/default.asp.
Wednesday, July 15, 2009
Get all controls inside window form and set its value
This code cleans/set the value of textbox control to space("") inside the formwindow and inside the groupbox control.
VB.NET
For Each octl As Control In Me.Controls
If (TypeOf octl Is GroupBox) Then
Dim gbox As GroupBox = DirectCast(octl, GroupBox)
For Each ictl As Control In gbox.Controls
If (TypeOf ictl Is TextBox) Then
Dim itxt As TextBox = DirectCast(ictl, TextBox)
itxt.Text = ""
End If
Next
End If
If (TypeOf octl Is TextBox) Then ' textbox outside the groupbox
Dim txt As TextBox = DirectCast(octl, TextBox)
txt.Text = ""
End If
Next
C#
foreach (Control octl in this.Controls)
{
if ((octl is GroupBox))
{
GroupBox gbox = (GroupBox)octl;
foreach (Control ictl in gbox.Controls)
{
if ((ictl is TextBox))
{
TextBox itxt = (TextBox)ictl;
itxt.Text = "";
}
}
}
if ((octl is TextBox))
{
TextBox txt = (TextBox)octl;
txt.Text = "";
}
}
Solution for suspected MS SQL Database
In addition to these ideas, also check out www.microsoft.com/support for the MS Knowledgebase. Specifically Q165918.
Firstly look in\LOG and look at all recent errorlog(s). There WILL be an indication here as to why the database has been marked suspect. You need to fix whatever the problem is first (i.e. missing file, permissions problem, hardware error etc.)
Then, when the problem has been fixed and you're either sure that the data is going to be ok, or you have no backup anyway, so you've nothing to lose, then change the database status to normal and restart SQL Server. To change the database status, and to get more information on recovery, look up the sp_resetstatus sp in the Books Online.
If you don't have access to sp_resetstatus information, then the short version of this is :-
UPDATE master..sysdatabases SET status = status ^ 256 WHERE name =
If the database still goes back into suspect mode, and you can't fix the original problem, and you have no recent backup, then you can get information out of the database by putting it into emergency mode. If you do this, extract the data/objects out with bcp/transfer manager and then rebuild the database. Note that the data may be corrupt or transactionally inconsistent.
Issue the following command to put the database into emergency mode (you'll need to allow updates first)
UPDATE master..sysdatabases SET status=32768 WHERE name=''
Firstly look in
Then, when the problem has been fixed and you're either sure that the data is going to be ok, or you have no backup anyway, so you've nothing to lose, then change the database status to normal and restart SQL Server. To change the database status, and to get more information on recovery, look up the sp_resetstatus sp in the Books Online.
If you don't have access to sp_resetstatus information, then the short version of this is :-
UPDATE master..sysdatabases SET status = status ^ 256 WHERE name =
If the database still goes back into suspect mode, and you can't fix the original problem, and you have no recent backup, then you can get information out of the database by putting it into emergency mode. If you do this, extract the data/objects out with bcp/transfer manager and then rebuild the database. Note that the data may be corrupt or transactionally inconsistent.
Issue the following command to put the database into emergency mode (you'll need to allow updates first)
UPDATE master..sysdatabases SET status=32768 WHERE name='
Tuesday, May 19, 2009
CONVERSION PROJECT
Visual Basic 6.0 (SQL Server 2000) to C# ASP.NET (SQL Server 2005) on the front-end side is not that hard but on the back-end side I encounter some problems espcially on cursor which is used on the existing system.
Here are the modules and screenshot of the WEB ERP
Subscribe to:
Posts (Atom)