Hello all,
I have a basic .Net app that pushes a string (strCat) over into a crystal report parameter {?@cat} .
The app has a bunch of checkboxes, once the user checks them and wants to run the report this code runs:
This then merges these categories together into a string. For example "HOSE, TOOL, ABRA". I then use this string (strCat) as a parameter {?@cat} in a crystal report. It does a search funtion for data. This code is below:
The problems are: It doesn't work. Now if I manually set the strCat to be = "HOSE" it works. If I add a = "HOSE, TOOL" it does NOT work. If I manually enter it in Crystal Reports and run the report, it does work.
Also, I know i will need to remove the last COMMA in the string, how do I do that?
Any ideas or suggestions on what to do?
I have a basic .Net app that pushes a string (strCat) over into a crystal report parameter {?@cat} .
The app has a bunch of checkboxes, once the user checks them and wants to run the report this code runs:
Code:
Public Sub checkboxes()
strCat = ""
If CheckBox1.Checked = True Then
strCat = "ABRA "
End If
If CheckBox2.Checked = True Then
strCat += "BRUS "
End If
If CheckBox3.Checked = True Then
strCat += "BUCK "
End If
If CheckBox4.Checked = True Then
strCat += "COVE "
End If
If CheckBox5.Checked = True Then
strCat += "HOSE "
End If
If CheckBox6.Checked = True Then
strCat += "PART "
End If
If CheckBox7.Checked = True Then
strCat += "ROLL "
End If
If CheckBox8.Checked = True Then
strCat += "SASP "
End If
If CheckBox9.Checked = True Then
strCat += "TAPE "
End If
If CheckBox10.Checked = True Then
strCat += "TOOL "
End If
If txtCinput.Text <> "" Then
strCat += txtCinput.Text
End If
'go through and insert COMMA where spaces
strCat = strCat.Replace(" ", ", ") 'what about last comma, need to remove, but how?
This then merges these categories together into a string. For example "HOSE, TOOL, ABRA". I then use this string (strCat) as a parameter {?@cat} in a crystal report. It does a search funtion for data. This code is below:
Code:
{IM_ITEM_MASTER_MC.Item_Category} in [{?@cat}]
The problems are: It doesn't work. Now if I manually set the strCat to be = "HOSE" it works. If I add a = "HOSE, TOOL" it does NOT work. If I manually enter it in Crystal Reports and run the report, it does work.
Also, I know i will need to remove the last COMMA in the string, how do I do that?
Any ideas or suggestions on what to do?