Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

The sql below returns all required fields that I want on my report. The report fields reference each field as tblContracts.pr_number etc and if I use this sql in a dataadapter it returns the data I'd expect.

 

Problem is if I put all these fields on my report I get an error from the crystal reports engine. If I remove the suppliername field from the report it works OK. This field is the only one which comes from another table, but as the data all gets put into a dataset into a table called tblContracts it uses the prefix tblContracts like all the others.

 

Any ideas please as this is driving me nuts!!

 


       m_strSQL = "SELECT tblContracts.order_line, tblContracts.pr_number, tblContracts.budget, tblContracts.dept, " & _
                  "tblContracts.po_number, tblContracts.dated, tblContracts.commencement, tblContracts.expires, " & _
                  "tblContracts.contact, tblContracts.contact_tel, tblContracts.price, tblContracts.description, " & _
                  "tblContracts.active, tblContracts.internal, tblContracts.s0, tblContracts.s1, tblContracts.s2, " & _
                  "tblContracts.s3, tblContracts.s4, tblContracts.s5, tblContracts.s6, tblContracts.s7, tblContracts.s8, " & _
                  "tblContracts.s9, tblContracts.s10, tblContracts.s11, tblSuppliers.name AS suppliername FROM tblContracts INNER JOIN " & _
                  "tblSuppliers ON tblContracts.Supplierid = tblSuppliers.supplierid WHERE (tblContracts.po_number = '" & _
                  strPONumber & "') ORDER BY order_line "

My website
Posted

Sorted this...

 

It helps if when calling the report I pass the correct dataset.....DOH.

 

Still the investigative work looking into this has given me new insight into VB and crystal reports

My website

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...