fixed length reader returns empty set. Weird issue - smooks

I have written a sample smooks config using fixed length reader[1] with many fields.
I see a weird issue here. That is, if i have the last field AnnualReportReturnedDate[8] in the configuration it does not return any sets. that is my set is null.
So, i checked one by one by adding all fields and my configuration works fine. When i try to add AnnualReportReturnedDate[8] filed, it is not working.(taht is empty set is returned) Further if i change the length of that filed to 2/5 it works..but it is not working fro length 8. That is ,
if i defined AnnualReportReturnedDate[2]--works, AnnualReportReturnedDate[8]--Not works.
Why do i get this type of annoying issue?
[1]
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:fl="http://www.milyn.org/xsd/smooks/fixed-length-1.3.xsd">
<fl:reader
fields="RecordId[10]?trim,CompactedCorpName[60]?trim,FileNumber[9]?trim,CorporationName[60]?trim,...........,AnnualReportReturnedDate[8]?trim,AnnualReportReturnedCode[2]?trim"
skipLines="1"></fl:reader>
</smooks-resource-list>

The issue here is, in my file, in the middle it had a line, which did not have enough length of characters. SoO, smooks skipped the whole file to process.

Related

Problem with line breaks in PDF document generated by BIRT

I have some cell texts in a BIRT report which do not flow as nicely as I hoped.
For example,
The text is Long value resultwithaverylongname whichcannotbreak and I had hoped that it would be displayed like this:
Long value
resultwithaverylongname
whichcannotbreak
The render options are as follows:
renderOptions.setOutputFormat(IPDFRenderOption.OUTPUT_FORMAT_PDF);
renderOptions.setOption(IPDFRenderOption.PAGE_OVERFLOW, IPDFRenderOption.OUTPUT_TO_MULTIPLE_PAGES);
renderOptions.setOption(IPDFRenderOption.PDF_TEXT_WRAPPING, true);
renderOptions.setOption(IPDFRenderOption.PDF_WORDBREAK, true);
It seems to me that my desired output is physically possible but I don't know why BIRT does not break on a whitespace and breaks in the middle of the word.
I am using BIRT 4.16 (from Sourceforge). The texts contain normal whitespace (no non-breakable spaces) and are displayed via a data object.
3.Sep.21
I now have an example project which I am trying to commit to Github. In the meantime here is a screenshot showing breaks which look good and others which are not...
The git repo is here: https://github.com/pramsden/test.wordbreak
If the text "resultwithaverylongname" physically fits, then you are right:
BIRT should not break it in the middle of the word.
Your renderOptions seem right (depending of what BIRT version you are using).
At first glance this looks like a bug.
But: In German language, we often have quite long words, and I've created a lot of (complex) PDF reports with BIRT, but I never saw this issue.
So I guess it is a tiny silly detail which causes this.
Just to double-check:
Are the spaces between "Long", "value", "result..." normal spaces (0x20)? or non-breaking spaces?
Which BIRT release are you using?
Are you using a data item or a dynamic text item and if so, is it HTML or plain text?
Can you create a reproducible simple test case and post the rptdesign file somewhere?
well i don use BIRT , but try to use (\n),
in my case I use PDFFlow library to generate pdf docs, and to make a line-break i just use \n
this is a simple example code to create a pdf file and use line break
var DocumentBuilder.New()
.AddSection()
.AddParagraphToSection("Hello world! \n go to the next line")
.ToDocument()
.Build("Result.PDF");
try it and tell me if it works

Using datepicker in DotNetNuke-7 module

I'm a DNN beginner. I am currently building a module in which I can display statistics. My DotNetNuke Version is 7.0. The statistic is from Chartjs. For this statistic I would like to implement filters. These filters should be datepickers. As UI element I have now included a textbox with TextMode='Date'. But currently I have problems to set the default value of this field. The default value should be 01.01. of the current year.
I have already tried to set the value via C# server side. Unfortunately without success. I also tried to set the value on the client side via JavaScript. Unfortunately also without success.
These are some lines I tried in JavaScript:
document.getElementById(<%= this.DatumVon.AccessKey %>).value = "01.01.2019";
document.getElementById(<%= this.DatumVon.AccessKey %>).innerText = "01.01.2019";
document.getElementById("DatumVon").value = "01.01.2019";
These are some lines I tried in C# in the method "Page_Load" (server side):
this.DatumVon.Text = "01.01.2019";
I expected the value of the TextBox to be 01.01.2019. However, it currently only contains dd.mmm.yyyy. How can I change this?
Thank you.
There is something wrong with your localization. Please refer to the jQuery UI datepicker documentation (the "Localization" section), this should give you the answer.
wow... I solved it. I made it. Sometimes the solution is right in front of you and you don't see it. Michael Tobisch was absolutely right. When setting the value, the format is very important. I have always used the German format. A DNN TextBox with TextMode="Date" can't handle that. DNN converts this TextBox into an HTML input field. But this input field can only be clear with the format "yyyy-mm-dd". Depending on the geographical position of the client (at least that's what I think) the text displayed in the input field will be formatted. But the value of the input field always has the same format ("yyyy-mm-dd"). So very important here: the displayed text and the actual value have different formats.
Many thanks again to Michael Tobisch for the mental inspiration and the patience with me.
What is also important is that the access to the actual ID of a DNN element works as follows: this.Element.ClientID and not as I assumed before this.Element.AccessKey. This was also buggy.

#Dblookup and formatting on web

I have been developing a web application using domino, therein I have dblookup-ing the field from notes client; Now, this is working fine but the format of value is missing while using on web.
For example in lotus notes client the field value format is as above
I am one, I am two, I am one , I am two, labbblallalalalalalalalalalalalalalalalalalaallllal
Labbbaalalalallalalalalalaalallaal
Hello there, labblalalallalalalllaalalalalalalalalalalalalalalalalalalalalalalala
Now when I retrieve the value of the field on web it seems it takes 2 immediate after 1. and so forth, I was expecting line feed here which is not happening.
The field above is multi valued field. Also on web I have used computed text which does db lookup from notes client.
Please help me what else could/alternate solution for this case.
Thanks
HD
Your multi-valued field has display options associated with it and the Notes client honors those. Obviously, your options are set up to display entries separated by newlines.
The computed text that you are using for the web does not have options like that and the field options are irrelevant because you aren't displaying the field. Your code has to insert the #Newlines. That's pretty easy because #DbLookup returns a list, and if you concatenate a list and a scalar, the scalar will be appended to each element of the list. (Look at the third example under "concatenation, pairwise" here to see what I mean.
The way you've worded your question is a little unclear to me, but what you need in your computed text formula is either something like this:
list := #DbLookup(etc,. etc.);
list + #Newline;
Or something like this:
multiValueFieldContainingListWithDbLookupResult + #NewLine;
I used #implode(Dblookupreturnedvalue;"");
thanks All :)

Start index error while doing Code First Migration

I am trying to add fields from VB.Net class file to SQL database, while doing "Add Migration" It is showing "startIndex cannot be larger than length of string."
enter image description here
I had the same error message when i tried to make a migration. The cause in my case was an empty value for MigrationId for a particular migration in the _MigrationHistory table.
This field must have a value in the same format as the string parameter of the attribute [Migration("YYYYMMDDHHMMSS_SeedData")], which is described in the other answer.
Most of all you have some class in your data project with attribute Migration (maybe for seeding data or something similar) which name is not in expected format like this:
[Migration("YYYYMMDDHHMMSS_SeedData")]
Adjust the migration name to be in YYYYMMDDHHMMSS_Description format to fix the error startIndex cannot be larger than length of string.

Openrefine not working as expected

I'm very new to OpenRefine, so please bear with me if i have made a simple mistake.
I'm parsing a HTML website to gather some date.
Everything went fine with fetching the individual pages, but now the parsing of the HTML fails.
I'm creating a new column, based on the one holding all the page's HTML. I'm trying to get to the data in a specific DIV[20].
In the"create column based on this column" window it gives me a preview when using value.parseHtml().select("DIV")[20] , which results in exactly what i need... executing it gives me nothing but blank cells.
it even tells me that it is "filling 0 rows with grel:value.parseHtml().select("DIV")[20]"
Any clue what i'm doing wrong here?
You just need to finalize with .toString() to output the JSON.org object AS a string.
This is explained on our wiki here: https://github.com/OpenRefine/OpenRefine/wiki/StrippingHTML#extract-html-attributes-text-links-with-integrated-grel-commands
I also updated the select() function with that example: https://github.com/OpenRefine/OpenRefine/wiki/GREL-Other-Functions#selectelement-e-string-s