creating and exporting a csv from Display tag table - jsp-tags

export is not working for csv:
(org.displaytag.decorator.MessageFormatColumnDecorator:66 - decorate) ==> Caught an illegal argument exception while trying to format an object with pattern {0,date,dd-MMM-yyyy}, returning the unformatted value. Object class is {0,date,dd-MMM-yyyy}
exception is :(org.displaytag.decorator.MessageFormatColumnDecorator:66 - decorate) ==> Caught an illegal argument exception while trying to format an object with pattern {0,date,dd-MMM-yyyy}, returning the unformatted value. Object class is {0,date,dd-MMM-yyyy}

Make sure you don't have escapeXml="true" as a property for your display:column tag.
I know it's probably too late for the OP to get this answer, but I think this could help some people stuck with this problem.

Related

Jmeter - While converting CSV data to base64 with groovy getting below error

Code >
Error >
Help to solve this error!
Purpose is to pass
${encodedPayload}
to http post request. Currently getting ${encodedPayload} instead of base64 encoded data.
From the error it seems that your ${type} string doesn't have any value.
If you're trying to use String Interpolation - make sure to define it beforehand:
def type = "some type"
//and then you can refer it anywhere as "${type}"
if you're trying to reference a JMeter Variable - make sure that it exists and has an anticipated value using Debug Sampler and View Results Tree listener combination. Additionally you should rather use vars shorthand for JMeterVariables class instance, i.e. instead of:
${type}
use
vars.get("type")
In general you don't need any scripting, if you just need to send Base64-encoded JSON you could just go for __base64Encode() custom JMeter Function (can be installed using JMeter Plugins Manager)

Excel VBA objsnmp.set strange things

I use the objSNMP.get method in Excel VBA without any problems.
I'd like to use the objSNMP.set method, but unfortunately it's not that easy. According to the website, it should work similarly to get, with the difference that there is one more parameter: the value to be sent.
If I try the official way:
objSNMP.Set ("43.18.1.1.2", OIDValue)
Image1
I get the message "Compile error: Syntax error".
I found another solution that works conditionally. Namely as follows (it can be seen commented out in the picture):
randomVarName = objSNMP.Set("OID", Value)
For example:
temp = objSNMP.Set(".1.3.6.1.4.1.9.9.68.1.2.2.1.2." & PortNum, 21)
In this case, the code runs without error. This is interesting because I haven't found any official information about this anywhere. Somewhere deep in the recesses of the internet, I only found this possible solution some time ago.
If, on the other hand, I do not enter the value directly, but write the name of a variable there (e.g. VLANNum),
temp = objSNMP.Set(".1.3.6.1.4.1.9.9.68.1.2.2.1.2." & PortNum, VLANNum)
I receive an error message. Image2
It doesn't matter if the type of the variable is not declared, string or integer. I also tried several different cell types in Excel, but nothing changed.
The error message is:
Run-time error '-2147467259 (80004005)':
The requested SNMP operation attempted to modify a variable, but
either a syntax or value error occurred.
Based on the above, I cannot insert the value read from the excel table at the end of the "objSNMP.Set" method in such a way that it can send the value. I could only solve the task if I create 4094 different "objSNMP.Set" lines and select what is necessary from among them. Not very efficient.
I have the solution. The value transferred with the variable works in the following form:
objSNMP.Set ".1.3.6.1.2.1.2.2.1.7.9", CInt(x)
Where x is the variable.

how to deal with CapitalizationError during importing in simpro CSV in brightway2?

when I import a CSV file I get the following error:
CapitalizationError: Possible errors in upper/lower case letters for some parameters.
'_a3_spruce_yes'' not found; could be '_a3_spruce_yes'
'_a3_osb_thickness'' not found; could be '_a3_osb_thickness'
'_a3_primary_frame'' not found; could be '_a3_primary_frame'
'_a3_pp_density'' not found; could be '_a3_pp_density'......(continue)
and if I look into the csv file it looks like (I took only one input and project parameter as example, they are basically all so, with the A capitalized)
Project Input parameters
_A3_Spruce_yes;0;Undefined;0;0;0;No;(0/1) Choice of spruce
....
Project Calculated parameters
_A3_Douglas_Yes;1-_A3_spruce_yes;Choice of Douglas
...(there also other calculated parameters but always with the same A capitalized)
Any idea on:
-why this prob
-how to fix it
There is an error in the input file. The CapitalizationError is incorrect; rather, there are some references which refer to undefined variables in the input data, e.g. _Wall_Weight is defined in a long formula that includes the variables _A3_OSB, _A3_Plywood, and _A3_PP, but these variables are not themselves defined anywhere. The correct error in this case should be a ParameterError, and can only be solved in the input data (and in the exporting program that allows incomplete references to be exported in the first place).

Getting Error While Converting IEnumerable to System.Data.Objects.ObjectSet

I am using mvc4.0, enityframework 4.2.1, c#, After generating .EDMX file I tried to cast the context object to IEnumerable by the below code
IEnumerable<TransactionsModel> pro = (IEnumerable<TransactionsModel>) x.ToList();
but I am getting the following error
Unable to cast object of type 'System.Data.Objects.ObjectSet`1[MCLInventory.Models.Projects]'
to type 'System.Collections.Generic.IList`1[System.String]'.
Thanks
Bhanu Prakash Inturi
Looks like you're failing on the ToList() call itself, rather than the cast. A few suggestions...
Do you know what kind of list you expect to come out of the ToList() call? If so, have that on a separate line from the cast to IEnumerable<TransactionsModel>.
I wouldn't be surprised if you need to cast x into something else first. For that matter, what kind of object is x? That's kind of pertinent to the question, and the error seems to suggest to me that what you think it is and what the program thinks it is are not the same.

Invalid Parameter Name

I am having a problem with saving of data because of an incorrectly generated parameter name.
The table has a field "E-mail", and when the class wrapper is generated, the InsertCmd uses "#E-mail" as one of the parameters. In SQL Server, this is illegal and generated an exception.
I have hunted all over SubSonic for a way to modify the parameter name to simply "#Email" but the ParameterName property is read only.
I am using SubSonic 2.2 and don't have the source for it to make an internal modification.
Any ideas?
TIA
I got a mate of mine that uses SVN to pull the source code, and as expected, found a bug in the SS source.
When the column name is set in the class wrapper, the setter for the ColumnName property sets the ParamaterName property for you correctly using
"parameterName = Utility.PrefixParameter(Utility.StripNonAlphaNumeric(columnName), Table.Provider);". This removes any illegal characters like the hyphen in my E-mail column.
BUT... The property ParameterName is NOT used when the SQL commands are created. Here is the code in SQLDataProvider.GetInsertSQL, line 1462.
pars.Append(Utility.PrefixParameter( colName, this));
I changed this to
pars.Append(col.ParameterName);
and the problem is now sorted.
Thanks to you that came up with possible solutions.
You can modify the templates if you can't change the column name. See this blog post for details of how:
http://johnnycoder.com/blog/2008/06/09/custom-templates-with-subsonic/

Resources