Archive for April, 2014

Attempt to load Oracle client libraries threw BadImageFormatException.

Error Message : Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.
Situation :
case 1) If you are using 64 bit machine for development and want to publish project on your machine then
case 1) If you are using 64 bit machine for server and want to publish project on server then
and if 32 bit version of oracle is not installed in your machine.

Resolution :

1) If 32 bit client version of oracle is not installed, then install 32 bit client. then problem will be resolved.

2) If you want to run published setup on 32 bit, then go to iis (inetmgr), then select application pool which you have assigned to your application => go to advanced setting => Enable 32-bit Application = true.
Means now your application will run on 32 bit environment instead of 64 bit environment.
IIS 32 bit enabled and 32 bit Oracle client works.
IIS 32 bit disabled and 64 bit Oracle client works too.

Advertisements

DateAdd Function in Crystal Report

 

The DateAdd() function can be used to add an interval of time to a date.

Syntax:

DateAdd (intervalType, number, startDate)

Interval Type Description
yyyy Year
q Quarter
m Month
y Day of year (same result as w or d.)
d Day (same result as w or y.)
w Weekday (same result as y or d.)
ww Weeks
Adds the indicated number of weeks to startDate.
h Hours
n Minutes
s Seconds

 

Example :

DateAdd(“D”, 1, “15/04/2014”)         ==>     Output : 16/04/2014

DateAdd(“M”, 1, “15/04/2014”)         ==>     Output : 15/05/2014

Format a number in a formula string in Crystal Report

Syntax : 

totext(Fieldname or Formula,0,””)

 

Here 0 indicates no decimal point is required.

“” indicates remove comma from numeric value.

Barcode font size problem in exporting Crystal Report to PDF using ASP.Net

I m exporting crystal reports to pdf format but the default paper size of pdf file is legal,

Problem arises during exporting report in pdf with barcode data. Data in barcode in pdf is not able to scan using barcode reader device. Report is generated in asp.net 2010 & Crystal report 13.

Solution :
Add two DWORD key and set value to 1. Following are two registry key where you have to add new keys.

HKEY_CURRENT_USER\Software\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Export\PDF\ForceLargerFonts

HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Export\Pdf\ForceLargerFonts

If PDF folder is not exist in registry, then create new one and add ForceLargerFonts key with its value to 1.

Restart IIS or project windows (VS 2010).

Problem will be resolved.