Consume sql server data



  • Hi. I'm new to jsreport. I followed this guide https://jsreport.net/blog/pdf-reports-in-sql-server but I got stuck because it is an old version. I'm working with the latest version of jsreport and it does not work for me, nor does it show any error or show any data, it just stays blank. Please someone can update the theme. What are the new steps to be able to consume sql server data from jsreport?


  • administrators

    hi! i checked the post and it looks up to date with last version of jsreport (v2), there are only some screenshots about jsreport studio that are old but it does not make any difference for the purpose of the post. maybe you forgot to assign the script (in which you do the mssql connection) to the template, you can do that using these options:

    0_1537801378613_Captura de pantalla 2018-09-24 a las 10.02.10 a.m..png



  • thanks for answering. This is my template screen.
    0_1537816317163_upload-8976a1c5-5baf-4338-9354-aad494c83256
    and this is the script
    0_1537816361519_upload-6055bbf9-3478-4197-8860-248cfe131d1c
    tcp/ip is activated
    0_1537816384937_upload-8a83c9e4-5568-45a6-9f27-f8929b707f03
    the result is blank, it shows nothing. It does not show any error either. I'm lost.
    What I can be doing wrong?



  • Is your SQL Browser service running?

    Maybe rather paste the code into the extra js file and debug it with vscode.



  • Hola. yes, sql browser service running.
    vscode.
    0_1537822049653_upload-65f74537-5f88-44ac-bb6c-ef823cc29727
    0_1537822339886_upload-588134c9-5112-49fb-8ae3-7e556cc29f26
    version of my sql server
    0_1537825140087_upload-9653cecc-c6b5-42d1-9b6e-86385b87bc8f



  • Greetings. I found the solution. this code worked for me. I can already consume data from sql server.
    0_1537967356670_upload-51d0bd5a-f463-46b7-b58d-b2bf302eb80a
    0_1537967391658_upload-1c8483f4-c527-4d76-a194-cc0d31c96005



  • this got it working for me as well (was having no luck using the original blog post!)

    would be great to see the docs updated with an example that explains the logic to help folks get started


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.