Comments Panel
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Page 1 of 1 |
[ 14 posts ] |
| Print view | Previous topic | Next topic |
| Author | Message |
|---|---|
|
General ![]() Joined: Thu Jan 26, 2012 5:18 pm Posts: 187 |
I am looking for any tips or tutorials on how to configure the "comments panel" components.
I set up a few tables in the database that correspond with "what I thought" where used by this component. I am missing something. Was hoping someone out here has used this and had some notes they could share. Last edited by tailfire on Wed Feb 22, 2012 8:27 pm, edited 1 time in total. |
| Wed Feb 22, 2012 6:48 am |
|
|
General ![]() Joined: Thu Jan 26, 2012 5:18 pm Posts: 187 |
WOW I found the documentation
http://www.inductiveautomation.com/supp ... syntax.htm I should read this first... |
| Wed Feb 22, 2012 6:52 am |
|
|
Moderator ![]() Joined: Sun Apr 02, 2006 2:46 pm Posts: 1974 Location: Sacramento, CA |
Good, let us know if you run into any problems.
_________________ Travis Cox Inductive Automation Technical Support Rep. |
| Wed Feb 22, 2012 1:57 pm |
|
|
Colonel ![]() Joined: Tue Oct 26, 2010 5:58 pm Posts: 148 |
its a long road trying to find the perfect turbo encabulator!
|
| Wed Feb 22, 2012 5:33 pm |
|
|
General ![]() Joined: Mon Sep 29, 2008 11:38 am Posts: 267 |
Call me old fashioned, but I like the feel of the retro encabulator better.
Of course, neither of them beat a good interocitor.. sigh. |
| Wed Feb 22, 2012 6:52 pm |
|
|
Moderator ![]() Joined: Thu Mar 30, 2006 10:08 pm Posts: 1176 |
_________________ Nathan Boeger, CISSP-ISSAP, CCNP Voice, VCP Not Another Industrial Blog - My SCADA software blog "Design Simplicity Cures Engineered Complexity" |
| Thu Feb 23, 2012 10:17 am |
|
|
General ![]() Joined: Tue May 31, 2011 6:27 am Posts: 310 Location: Minnesota |
Just to add on to this, here is an example intended to be indexed on a tag path.
MySQL Code: CREATE TABLE IF NOT EXISTS `notes` ( `ID` int(10) unsigned NOT NULL AUTO_INCREMENT, `UserName` varchar(45) NOT NULL, `TimeStamp` datetime NOT NULL, `NoteText` text NOT NULL, `TagName` varchar(45) NOT NULL, `IsSticky` tinyint(3) unsigned NOT NULL, `Attachment` longblob DEFAULT NULL, `AttachmentName` varchar(45) DEFAULT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=22 ; MS SQL (assumes the database is called sqltags) Code: USE [sqltags] GO IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[notes]') AND type in (N'U')) DROP TABLE [dbo].[notes] GO USE [sqltags] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[notes]( [ID] [int] IDENTITY(1,1) NOT NULL, [UserName] [nvarchar](50) NOT NULL, [TimeStamp] [datetime] NOT NULL, [NoteText] [ntext] NOT NULL, [TagName] [nvarchar](255) NOT NULL, [IsSticky] [int] NOT NULL, [Attachment] [varbinary](max) NULL, [AttachmentName] [nvarchar](50) NULL, CONSTRAINT [PK_notes] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF GO Attachments:
Last edited by Greg.Buehler on Fri Feb 24, 2012 8:21 am, edited 1 time in total. |
| Thu Feb 23, 2012 11:01 am |
|
|
General ![]() Joined: Mon Apr 04, 2011 4:40 pm Posts: 374 Location: Hatfield, PA |
Nice example. This is very helpful.
_________________ There are 10 types of people in this world, those who understand binary and those who don't. Doug Keller Electronics Project Manager Clemens Food Group |
| Fri Feb 24, 2012 5:09 am |
|
|
General ![]() Joined: Wed Feb 24, 2010 5:56 pm Posts: 388 |
I ended up building my own. We needed to have dropdowns with preconfigured comments, that way we can track calibrations and search for other stuff without having to worry about typos. I also set it up so that the user can use the current timestamp or use a calender component to enter in a manual timestamp if they dont get around to entering the comment in for a few days.
|
| Fri Feb 24, 2012 5:27 am |
|
|
General ![]() Joined: Mon Apr 04, 2011 4:40 pm Posts: 374 Location: Hatfield, PA |
One problem I found with this example... if you add a note with an attachment it works fine. If you add a note without an attachment it won't accept a null in the Attachment column and throws up an error.
Quote: Implicit conversion from data type varchar to varbinary(max) is not allowed. Use the CONVERT function to run this query. Maybe this is just a sql2005 thing? Not sure how to get around this as the Attachment column is set to accept nulls. _________________ There are 10 types of people in this world, those who understand binary and those who don't. Doug Keller Electronics Project Manager Clemens Food Group |
| Fri Feb 24, 2012 5:54 am |
|
|
General ![]() Joined: Tue May 31, 2011 6:27 am Posts: 310 Location: Minnesota |
Duffanator wrote: One problem I found with this example... if you add a note with an attachment it works fine. If you add a note without an attachment it won't accept a null in the Attachment column and throws up an error. Quote: Implicit conversion from data type varchar to varbinary(max) is not allowed. Use the CONVERT function to run this query. Maybe this is just a sql2005 thing? Not sure how to get around this as the Attachment column is set to accept nulls. Probably just need to change the table schema to fit your needs. This was tested using MySQL. The MS SQL table hasn't actually been used/tested yet. |
| Fri Feb 24, 2012 8:17 am |
|
|
Trooper ![]() Joined: Wed Apr 25, 2012 1:14 am Posts: 17 |
I having this problem as well (SQL2008 db) and still working around without a solution.
Another question, how can we getting DataSet of Comments panel while adding a new Note? |
| Wed Apr 25, 2012 2:24 am |
|
|
Moderator ![]() Joined: Sun Apr 02, 2006 2:46 pm Posts: 1974 Location: Sacramento, CA |
To get the attachments to work with MS SQL Server you can set the INSERT QUERY 1 to the following:
Code: INSERT INTO Notes (Note, Username, TStamp, Attachment, Filename, Sticky) VALUES (?, '%s', CURRENT_TIMESTAMP, CAST(? AS VARBINARY(MAX)), ?, ?) _________________ Travis Cox Inductive Automation Technical Support Rep. |
| Wed Apr 25, 2012 7:12 am |
|
|
Trooper ![]() Joined: Wed Apr 25, 2012 1:14 am Posts: 17 |
Thank you Travis, the solution fixed my problem.
Travis.Cox wrote: To get the attachments to work with MS SQL Server you can set the INSERT QUERY 1 to the following: Code: INSERT INTO Notes (Note, Username, TStamp, Attachment, Filename, Sticky) VALUES (?, '%s', CURRENT_TIMESTAMP, CAST(? AS VARBINARY(MAX)), ?, ?) |
| Wed Apr 25, 2012 6:40 pm |
|
|
|
Page 1 of 1 |
[ 14 posts ] |
|
|
All times are UTC - 8 hours |
Who is online |
Users browsing this forum: Google [Bot] and 6 guests |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum |



