2

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)

JHanz99
  • 31
  • 4
  • "I receive an error" is a bit vague. Just to be thorough, can you edit your question to add the error message you are receiving? – C-Pound Guru Feb 20 '15 at 13:34

2 Answers2

1

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.

jakdep
  • 852
  • 1
  • 11
  • 28
0

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.

Trevor
  • 7,777
  • 6
  • 31
  • 50