Google Table Chart

30 views
Skip to first unread message

Ramakrishnan Srinivasan

unread,
Jul 27, 2022, 7:50:42 PM7/27/22
to Google Visualization API
Hi,
 I am getting Jira data from Postgres dB and trying to create a Table output.

1. I have concatenated Jira keys to hyperlink Jira URL
2. One of my column is concatenated with <strong>.some text</strong> to bold the title.

When I use like this to get the rows to charts data format, it is throwing errors in console "Uncaught SyntaxError: Invalid or unexpected token"

My query is how to query SQL db get such unknown multilime text data and fit  it into Google Table cell..

Can you please help me with this?

Thank you

with warm regards
ramki

......
def final_comments_qryStr = "SELECT * FROM tmptbl_pr_commit_loc_comments WHERE loc_added IS NOT NULL OR loc_deleted IS NOT NULL ORDER BY project_key, repo_slug, to_branch_name, scoped_id DESC LIMIT 500;"

                                          def eachpr_comments_list_of_list = []

                                          def eachpr_comments_list_title = ["{label:'BB Project', id:'bbproject', type: 'string'}"
                                                               ,"{label:'BB Repo', id:'bbrepo', type: 'string'}"
                                                               ,"{label:'From Branch Name', id:'frombranch', type: 'string'}"
                                                               ,"{label:'To Branch Name', id:'tobranch', type: 'string'}"
                                                               ,"{label:'Pullreq ID', id:'prid', type: 'string'}"
                                                               ,"{label:'Manager', id:'manager', type: 'string'}"
                                                               ,"{label:'Pullreq Creator', id:'prcreator', type: 'string'}"
                                                               ,"{label:'Updated Date', id:'prupdated', type: 'string'}"
                                                               ,"{label:'Jira Keys', id:'jirakeys', type: 'string'}"
                                                               ,"{label:'Comment Count', id:'commentcount', type: 'number'}"
                                                               ,"{label:'Comments and Replies', id:'comments', type: 'string'}"
                                                               ,"{label:'Loc Added', id:'locadded', type: 'number'}"
                                                               ,"{label:'Loc Deleted', id:'locdeleted', type: 'number'}"
                                                             ]

                                          eachpr_comments_list_of_list.add(eachpr_comments_list_title)

                                          def rows2JsonObj = bb_sql.rows(final_comments_qryStr)  

                                          def rows2Json = new JsonBuilder(rows2JsonObj).toPrettyString()
                                          def json = new JsonSlurper().parseText(rows2Json)

                                          if(json) {
                                              json.each { thisMap ->
                                                //logx.info("thisMap values = ${thisMap.values()}")
                                                def thisRowValuesList = []
                                                thisRowValuesList.add('"' + thisMap["project_key"].toString() + '"')
                                                thisRowValuesList.add('"' + thisMap["repo_slug"].toString() + '"')
                                                thisRowValuesList.add('"' + thisMap["from_branch_name"].toString() + '"')
                                                thisRowValuesList.add('"' + thisMap["to_branch_name"].toString() + '"')
                                                thisRowValuesList.add('"' + thisMap["scoped_id"].toString() + '"')
                                                thisRowValuesList.add('"' + thisMap["manager"].toString() + '"')
                                                thisRowValuesList.add('"' + thisMap["pr_creator"].toString() + '"')
                                                thisRowValuesList.add('"' + thisMap["pr_last_update"].toString() + '"')
                                                thisRowValuesList.add('"' + thisMap["jira_keys"].toString() + '"')
                                                thisRowValuesList.add(thisMap["comment_count"])
                                                thisRowValuesList.add('"' + thisMap["comments_replies"].toString() + '"')
                                                thisRowValuesList.add(thisMap["loc_added"])
                                                thisRowValuesList.add(thisMap["loc_deleted"])
                                                eachpr_comments_list_of_list.add(thisRowValuesList)
                                              }
                                            }          


..... 
Reply all
Reply to author
Forward
0 new messages