如何使用vb.net

时间:2015-06-22 07:47:04

标签: vb.net crystal-reports

在我的应用程序中,用户从列表中选择一个客户。然后,我使用此选定客户(CustID是所选客户的ID)使用recordselectionformula过滤水晶报表中的记录。但是,允许用户在不选择客户的情况下查看报告。在这种情况下,CustID为零,并且不应该有recordselectionformula。我的代码如下。

if CustID>0 then 'this part is working fine
    crystalreport.recordselectionformula="{vSaleReport;1.CustomerID}=" & CustID
else
    crystalreport.recordselectionformula=""  'this line is not working
endif

当用户选择客户(CustID> 0)时,会设置recordselectionformula并且晶体报告按预期过滤记录。但是,当用户未选择客户(CustID = 0)时,不会删除先前设置的recordselectionformula,并且不会为所有客户显示报告。它仍然显示根据以前选择的客户过滤的数据。

任何人都可以指导我如何删除以前设置的记录选择公式。

由于

1 个答案:

答案 0 :(得分:0)

当你提供null时,它不会返回任何结果而是通过数据库字段,这将反转所有结果

这是诀窍......试试这个:

-(void)isDictionaryWord:(NSString*)word {   

UITextChecker *checker = [[UITextChecker alloc] init];
NSLocale *currentLocale = [NSLocale currentLocale];
NSString *currentLanguage = [currentLocale objectForKey:NSLocaleLanguageCode];
NSRange searchRange = NSMakeRange(0, word.length);    
arrPredectiveText=[checker completionsForPartialWordRange:searchRange inString:word language:currentLanguage];  

}

我不确定VB代码检查语法一次