User in query report

Hello All,
   I have to user name for some condition in “query-report”  like following

SELECT customer_name,delivery_address FROM tabCustomer WHERE refered_by IS NOT NULL and owner=‘%s’%(webnotes.session[‘user’])

i got following error

Traceback (innermost last):
File “…/lib/webnotes/handler.py”, line 154, in handle
execute_cmd(cmd)
File “…/lib/webnotes/handler.py”, line 189, in execute_cmd
ret = call(method, webnotes.form_dict)
File “…/lib/webnotes/handler.py”, line 206, in call
return fn(**newargs)
File “…/lib/webnotes/widgets/query_report.py”, line 61, in run
result = [list(t) for t in webnotes.conn.sql(report.query)]
File “…/lib/webnotes/db.py”, line 130, in sql
raise e
ProgrammingError: (1064, “You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘[‘user’])’ at line 1”)
all-app.min.js:307
  1. Uncaught TypeError: Cannot read property ‘length’ of undefined
How can i implement this?

Thank you



You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

To post to this group, send email to er...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/xSu5x7bdYq4J.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Hi Gangadhar,

Use script report for this. Refer to gross profit report to get some idea.

Thanks,
Anand.

On 09-May-2013, at 4:04 PM, gangadhar kadam <em...@gmail.com> wrote:

Hello All,
   I have to user name for some condition in "query-report"  like following

SELECT customer_name,delivery_address FROM tabCustomer WHERE refered_by IS NOT NULL and owner='%s'%(webnotes.session['user'])

i got following error

Traceback (innermost last): File "../lib/webnotes/handler.py", line 154, in handle execute_cmd(cmd) File "../lib/webnotes/handler.py", line 189, in execute_cmd ret = call(method, webnotes.form_dict) File "../lib/webnotes/handler.py", line 206, in call return fn(**newargs) File "../lib/webnotes/widgets/query_report.py", line 61, in run result = [list(t) for t in webnotes.conn.sql(report.query)] File "../lib/webnotes/db.py", line 130, in sql raise e ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '['user'])' at line 1") all-app.min.js:307
  1. Uncaught TypeError: Cannot read property 'length' of undefined
How can i implement this?

Thank you



You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

To post to this group, send email to er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/xSu5x7bdYq4J.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un...@googlegroups.com.

To post to this group, send email to er...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.