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.
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?