<< SharePoint 2019/SE 'Modern' Web PartsTable of contents 
SQL Query Viewer Web Part

The SQL Query Viewer Web Part allows to query external SQL Server databases and displays the result as a pageable list without having to resort to Sharepoint Designer.
The Enterprise version adds OLE-DB and ODBC data source support (MS Access, Excel, CSV, Oracle etc.), allows to create Web Part connections (row filters etc.), sort columns and define search filters.
Sharepoint 2019 Modern SQL Query Viewer Web Part

Web Part Configuration:


Title:
enter the optional web part title

Web Part:
AESQL

Configuration:
enter the below configuration options:

connection=enter the database connection string
pwd=enter the connection password
parameters=Northwind (alternatively enter the name of your connection parameter file)
query=SELECT.. (enter your SQL SELECT query)
pagesize=7 (enter the desired page size)
filter=LastName (enter the desired optional search filters)
formatting (column formatting, see "Column Formatting here)
totalcolumns=column1;column2;..(enable column totals)
grid=1 (enter the desired grid layout)
header=some text (enter the optional header text)
footer=some text (enter the optional footer text)
rows=0 (suppress the number of rows displayed at the bottom)
columnheaders=0 (suppress the column headers)
columnwidths=Lastname=200 (set speific column widths)
columnnames=Lastname= Last Name (define column aliases)
alternaterowcolor=pink (define the alternate row color)
print=1 (enable printing)
export=1 (enable CSV exporting)
options=enter additional options as needed

Web Part Configuration
Webpart Homepage & Download »


Please enter a comment below if you want to give feedback or have suggestions for improvements:

User Comments Post a Comment 

Eric Gonzalez  
7/27/2021 17:05 
How can I add Totals for columns?
Juerg  
7/27/2021 17:08 
Eric,
you will first need to re-download and then update the web part (the current version is 2.1.75).
You then can add the below lines to the web par’s “Configuration” setting:

totalcolumns=CheckedIn;Confirmend;other columns as needed..
formatting=SchDate:{date=d}


Please note that we are not able to reach you via [email protected] (eg. we get non-delivery messages).
Eric Gonzalez  
7/27/2021 17:57 
I originally orderd the AEWB-S bundle. Is there a link i can use to update the bundle? Or do I have to just download and install the individual webparts
Juerg  
7/27/2021 18:08 
Eric,
please just download the SQL Query VIewer web part for SP 2019 (see /apps/page.asp?Q=5753 )
Eric Gonzalez  
8/18/2021 17:27 
Is there a way to hide the password on the connection String?
I had to used the UserID and the password in the connections String. I was not able to use the pwd= option for my Advantage SQL database? Thanks
Excellent Product!!!
Juerg  
8/18/2021 17:42 
Eric,
you can use the {pwd} placeholder which can be embedded in the web part’s “DB Connection String” setting.
The placeholder will be automatically replaced by the value entered into the “Connection Password” field (which is masked by the web part)

Example:
Driver={Microsoft ODBC for Oracle};Server=myServer;Uid=myUser;Pwd={pwd};
Andreas  
12/15/2022 17:43 
Hi,
what are possible options, I need the export/print buttons or the alternate row colors. Are this funtions possible in the modern design?
thx
Juerg  
12/16/2022 14:20 
Andreas,
we have now added the

print=1
export=1
alternaterowcolor=pink

configuration settings.
Please re-download the web part and then update the farm solution.
Andreas  
12/22/2022 11:40 
@Juerg: thx for implementing the features.

Print work fine, but export and alternaterowcolor do not work...
Andreas  
12/22/2022 11:43 
additional info: we have replaced just the sppkg-file because we work only in modern design.
Juerg  
12/22/2022 11:56 
Andreas,
please update the farm version since the sppkg file is just a proxy.
Hector Maldonado  
2/8/2024 21:38 
I have an issue with dark themes, the results background is transparent and the text is gray, hard to see.

Can you change the background of the rows? not just the alternate, but all or the non-alternate?
Juerg  
2/9/2024 18:27 
Hector,
the easiest way would be to assign a background color to the web part itself by adding the below line to the “Configuration” setting:

options=css=.AESV {background:white}