How to create a list banner button in a table to down load in pdf the list of records.

ArjunL
Tera Contributor

I have created a list banner button in the problem table to down load the list of related problem to incident,

 

the scripting part i dont know what to write.

.

This button is similar to export pdf in list view.

ArjunL_0-1716205434916.png

 

silmilar kind of button neeed in  problem banner. to down load the list of records.

 

ArjunL_1-1716206017779.png

 

 

21 REPLIES 21

@ArjunL 

it's list banner button and also script you are using is not as per what I shared in the link

please update it as per the link and then share the status

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader



@Ankur Bawiskar 

 

I have used the below script , able to download the blank page , no record showing, please send me the correct script.

 

function downloadPdf(){



  var checked = g_list.getChecked(); // get's the sys_id of the checked records


  var query = "sys_idIN" + checked.toString();


  var rows = checked.split(",").length; // rows to be sent to the pdf function


  var view = " "; // set this to default for columns present in default view for list layout


  //var view = ""; // set this to empty if you want all the columns present in the list layout including the customized ones.



  var dialog = new GwtPollDialog('u_sample_table', query, rows, view, 'unload_pdf');


  dialog.execute();


}


 
ArjunL_0-1716285337436.png

 

 

@Ankur Bawiskar  Could you please send me the right code

@ArjunL 

it's there in the link I shared

please share what did you try so far?0

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I have used the below script , able to download the blank page , no record showing, please send me the correct script.

 

function downloadPdf(){



  var checked = g_list.getChecked(); // get's the sys_id of the checked records


  var query = "sys_idIN" + checked.toString();


  var rows = checked.split(",").length; // rows to be sent to the pdf function


  var view = " "// set this to default for columns present in default view for list layout


  //var view = ""; // set this to empty if you want all the columns present in the list layout including the customized ones.



  var dialog = new GwtPollDialog('u_sample_table', query, rows, view, 'unload_pdf');


  dialog.execute();


}