472,101 Members | 1,601 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,101 software developers and data experts.

passing null parameter

Expand|Select|Wrap|Line Numbers
  1. Private Sub BPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BPrint.Click
  2. Dim frm As New FrmPrintReport 'reports
  3. Dim cr As New CRepResponsable
  4. cr.SetParameterValue(0, Val(Me.TBAccountNumber.Text))'integer
  5. cr.SetParameterValue(1, Me.TBAccountNumber.Text)'string
  6. cr.SetParameterValue(2, vbNull) 'integer
  7. cr.SetParameterValue(3, vbNull) 'string
  8.  
  9. frm.CrystalReportViewer.ReportSource = cr
  10. frm.MdiParent = Me.MdiParent
  11. frm.Show()
  12. End Sub
  13.  
  14. i have the code above. i could not pass a null parameter, to the crystal reports. i will have an empty report  i tried vbnull.null and vbnull.empty same result.
  15. but if I put
  16. cr.SetParameterValue(2, Val(Me.TBSubAccount.Text))) 'integer 'not null
  17. cr.SetParameterValue(3, Me.TBSubAccount.Text) 'string 'not null
  18. the report display the values.
here is the select expert formula (CR):
Expand|Select|Wrap|Line Numbers
  1. {CUSTOMERS.SUB_ACCOUNT_NUMBER} = {?SubAccount_String} and
  2. {ecole.serial} = {?AccountNumber} and
  3. {CUSTOMERS.ACCOUNT_NUMBER} = {?AccountNumber_String} and
  4. {ecole.sub_account} = {?SubAccount} 
  5.  
How could i pass a null parameter?
Jan 9 '07 #1
2 2133
bplacker
121 100+
you can't just pass "" as an empty string instead of a null value?
Jan 9 '07 #2
kenobewan
4,871 Expert 4TB
Have you tried DBNull.Value?

Hope that this helps.
Jan 10 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Bucky Pollard | last post: by
6 posts views Thread by MSDNAndi | last post: by
12 posts views Thread by Andrew Bullock | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.