Talk with the Author
 Crystal Reports Forum : General Information : Talk with the Author
Message Icon Topic: CR can not display in C# when using ..... Post Reply Post New Topic
Author Message
hanif
Newbie
Newbie
Avatar

Joined: 12 Apr 2011
Online Status: Offline
Posts: 1
Quote hanif Replybullet Topic: CR can not display in C# when using .....
    Posted: 12 Apr 2011 at 1:34am
HI
I made a report in crystal report 2008,its working fine into CR2008

i can use simple report and can display into C#.

but i am facing now problem when i change in code of report,
this is code of report  written  into select expert window

    {CompanyInfo.cmpName} = {?CompanyNameParmField} and
    {PurchaseOrder.poSupplierName} = {?SupplierName}  and
    {Users.userLoginStatus};

upto this code working fine in CR 2008 and also in C#
but when add if condition then facing problem in C# but not in CR 2008


if HasValue({?SupplierName}) then
(
booleanVar  flag:=
    {CompanyInfo.cmpName} = {?CompanyNameParmField} and
    {PurchaseOrder.poSupplierName} = {?SupplierName}  and
    {Users.userLoginStatus};
)
else
(
 booleanVar  flag:=  {CompanyInfo.cmpName} = {?CompanyNameParmField} and
                     {Users.userLoginStatus}

)

without using

booleanVar  flag:=
also have same problem.even if do not use it, only one exception msg change little bit


when i use if condition then its work fine into Crystal reports S/W but can not load into  C#.

i got following error when try to load this report into C# CR viewer.

"A number, currncy amount,boolean,date,time,date-time or string is expected here."
C:\filename.rpt
Error in formula <Record Selection>


A number, currncy amount,boolean,date,time,date-time or string is exprected here"







IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 13 Apr 2011 at 9:00am
Put this into a formula instead of into the Select Expert.  Take out the booleanvar because you don't need it. For this example, I'll call this formula "SelectIt"
 
In the Select Expert, take out all of what you have and type in:
 
 
The problem with using a formula like this is that the filter will NOT be passed to the database.  Instead, Crystal will pull in all of the data and apply the filter in memory so it's going to slow down your report.
 
-Dell
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.