Is there a way to change the background color of rows on reports currently? Or can someone point me in the right direction of the files needed to change to be able to accomplish this?
I have been able to do this. Here is how I did it. I built a web based report using the custom table by adding the Widget on a page and Selecting the Reporting Category and Custom Table. Then selected the customize the report in the widget.
I then selected the DataSource to be the Advanced Database Query (SWQL, SQL). I then did SQL.
When configuring the Table Layout, I selected one of the columns and click on the +Advanced link.
Then select the checkbox for Allow HTML Tags.
I created a custom SQL function to convert the EventTypes.backcolor to an HTML HEX color and utilize javascript to change the styling of the TR row.
I will attach the functions I used.
Here is an example query used:
SELECT TOP 100 EventID, EventTime, dbo.ntta_BackgroundColor(EventID,EventTypes.BackColor) + Message as Message
FROM Events, EventTypes WHERE Events.EventType = EventTypes.EventType;
I use the eventID as the unique identifier for the ID of the div in order to set the background color to the correct row.
With this Allow HTML Tags functionality we are able to do some amazing things. An you can too without having to edit aspx pages.
Having the functionality built into the system would have been great, but this works for now until the new functionality is don.
this would be a great feature request!
I feel the same way , i mean already i can pull the BackColor from the EventTypes table , if i knew what ASP or JS script that fomated the data from the reports i could add a check for BackColor= in the <field> line of the .report file and using the ${BackColor} for the actual style of the background color. However I am also yet to find what file is formatting this data.
Got it. Thanks!
IS there a current way to do this or at this time not possible rob?
Thanks for this my report was built into the legacy report writer so i m moving it now to the web report writers, however i just ran into an issue where i don't see the Node Status icon option anywhere for up/down/warning etc do you have an idea where this could be?
NVM i figured that part out , i have to select Generic Icon then just use /NetPerfMon/images/{0} in that field
I used the SQL query you posted in the NOC View screen for my web report. I then created some a function to create the image link for the icons and built them without Solarwinds options.
Then just put this in the query to add the icons as a column:
dbo.mine_Icon('/netperfmon/images',RTRIM(Nodes.GroupStatus)) + ' ' + dbo.mine_Icon('/netperfmon/images/vendors', RTRIM(Nodes.VendorIcon)) as Icons,
If you want the Node.StatusLED icon, you would do this to dipslay it within your SQL.
dbo.mine_Icon('/netperfmon/images', RTRIM(Nodes.StatusLED)) as Icons,
CREATE FUNCTION dbo.mine_Icon
( @url AS VARCHAR(MAX),
@icon AS VARCHAR(MAX)
)
RETURNS VARCHAR(MAX)
AS
BEGIN
-- <img src="/netperfmon/images/vendors/8072.gif " class="sw-rpt-txticon" width="16" height="16">
RETURN '<img src="' + @url + '/' + @icon + '" class="sw-rpt-txticon" width="16" height="16">';
END
Oh that's prob even better make the db do the work but i don't like that you can't add the new reports as resources in views now. It only includes the legacy reports. ....
Right custom table ... if i wasn't an idiot i would've seen that eariler
You can but you have to add it view the Customize Page.
Then select the add Resource and Go to the Reporting Category and select the Custom Table resource.
Then on the page select to Customize the Report. The add the SQL as a Datasource.
Yeah i am just an idiot, but do you know why it shows up with this error when a non-admin user logs in? Report resource failed to properly initialize. »
Currently only an account with administrator rights can access reports with SQL queries (stops people using SQL to access information that they wouldn't generally have access to).
that should only be for editing reports. Everyone should be able to view the report even if they don't have admin rights.
I've just run through some quick testing on my system.
1) Using a custom table in a web-based report with a SQL query as a datasource, a non-admin account can view the report and see the table. With Report Management access, the account can see/modify the custom table but only view the SQL datasource (cannot modify).
2) Using a custom table on a view with a SQL query as a datasource, a non-admin account gets the "report resource failed to properly initialize" error. If I give the account "Customize View" access, the account still cannot edit that resource at all (presumably because of the SQL datasource).
My initial comment was based on the information here: Am I missing something or does Web Reporting require admin privledges for SQL reports? Now I'm not sure if the difference between 1 and 2 above is a bug or intended...
This is definitely a bug. Otherwise, it would provide a better message instead of giving an error. I don't believe this is intended, since we could build the same report in Web Based Report building and the users can see it.
hi everyone, got the coloured rows working a treat for me, but for other users i get Report resource failed to properly initialise
is this still a bug, as i have just upgraded to the latest version?
How can i just add the web report i have created to the page instead of using this custom table resource?
hi, where do I input the custom SQL function attached to convert the EventTypes.backcolor to reflect in the rows.
When you create a custom table view. There is an option to use custom SQL.
Thanks , I was wondering where to put the sql functions attached in the file, I am missing that part.
So, I added a table and selected sql query and used the select statement. The select statement would not work with the sql functions and I do not know how to add those in as the validation does not work for those 3 functions in the attached file, I think I am missing a step somewhere.
You will have to add those functions to the database through the backend.
c.gura
Is it possible to have some details on it?
@msarkar
Sure, what kind of details are you wanting?