VB6 closes without an error message on the line below when "strCompany" is longer than 255 characters. Is there some way to make this work?
rptReport.ParameterFields.GetItemByName("@company").AddCurrentValue (strCompany)
VB6 closes without an error message on the line below when "strCompany" is longer than 255 characters. Is there some way to make this work?
rptReport.ParameterFields.GetItemByName("@company").AddCurrentValue (strCompany)
Short answer: it doesn't look like it.
Just ran into an issue with this today. When a report was generated with a parameter 281 characters in length and exported to a PDF, the application crashed. When the report was displayed on the screen, the parameter's value was cut-off, but the application did not crash.
Shortening the value to 255 characters solved the immediate problem.
Data fields have the option of being defined as 'Memo', but it does not look like parameters have that data type available as an option.
I personally have never run into this, but here's how I add data to parameters in Crystal Reports and work's just fine.
rptReport.SetParameterValue("@company", strCompany)
Of course @company
is your parameter name and strCompany
is your value (string) to give to the parameter.