Showing posts with label programmer. Show all posts
Showing posts with label programmer. Show all posts

Sunday, March 25, 2012

Crystal Reports Syntax

I am not really a programmer but I am writing a report in CR XI and I am having syntax issues. I need some sort of operator after my 'then' statement (See code below) "Else" only works on the first line. I tried "And" or "Or" does not work. Can someone please help!!!!

If {REPORT_LINE.SECTION_NUMBER} = 1 and {REPORT_LINE.LINE_NUMBER} IN 100 TO 199 Then 'Cash' - need function

If {REPORT_LINE.SECTION_NUMBER} = 1 and {REPORT_LINE.LINE_NUMBER} IN 200 TO 299 Then 'Short Term Investments' need fuction

If {REPORT_LINE.SECTION_NUMBER} = 1 and {REPORT_LINE.LINE_NUMBER} in 300 To 399 Then 'Account Receivables'

If {REPORT_LINE.SECTION_NUMBER} = 1 and {REPORT_LINE.LINE_NUMBER} In 500 To 599 Then 'Fixed Assets'

If {REPORT_LINE.SECTION_NUMBER} = 1 and {REPORT_LINE.LINE_NUMBER} In 600 To 699 Then 'Long Term Investment'okay I figured it out, instead of using If.... Then statements there is a command call "switch" that you can use for all true values. My report is now done YEAH!!!!!|||u can also use :
If .... then

elseif ...... then

else

endif

Thursday, March 8, 2012

Crystal Report Doubt

Dear All,

i am visual basic Programmer.But new to crystal report . I coded like below

report1.Formulas(1) = "compadd2='" & (PockAdd2) & "'" 'Place
report1.Formulas(2) = "compadd3='" & (PockAdd3) & "'" 'City
report1.Formulas(3) = "strtitle='" & (strtitle) & "'" 'Title
report1.RetrieveDataFiles
report1.Action = True

Which Shows an error "Invalid File name", While Executing the line "Report1.RetrieveDataFiles"

Have any solution for this problem.

Pls let me know

Regards

Abdul VahidTry the next :
1.- Click on Menu / Database / Verify Database
and / or
2.- Include file definition before preview report
.
Report1.DataFiles(0) = SomePath & "\Somefile.Mdb"
Report1.DataFiles(1) = SomePath1 & "\Somefile1.Mdb"

.