SSRS Loop through data, adding a new title if the chapter/section changes - sql

I'm building an SSRS report in Report Builder 3.0 (2014). I have five sections of data I'm working with: inspection number, chapter, section, code, and description. The report is only going to show data for one inspection, so all data is filtered on InspNo first. There are often multiple codes associated with an InspNo.
What I have: for every code associated with an inspection, the code is listed along with its description.
What I need: I need to add the chapter and section info, but only when it changes. For example, let's say the codes associated with an inspection are 302.7, 304.10, 304.12, and 505.1. I would like the result to be as follows:
Chapter 3
Section 302
302.7 - Description
Section 304
304.10 - Description
304.12 - Description
Chapter 5
Section 505
505.1 - Description
I have tried using Lists, but the chapter and section get repeated for every code. Any ideas how to make it work?
****UPDATE****
I'm getting closer to a solution. Right now I'm using a combination of textboxes and lists. The chapters and sections are text boxes, and the codes/descriptions are lists. All of the elements have a visibility expression using InStr. The lists are working perfectly. However the text boxes are giving me issues.
It seems my visibility expressions on elements outside of lists are only looking at the first piece of the pulled data. In the example above, Section 302's visibility expression is =IIF(InStr(Fields!FAILEDCODE.Value, "302") > 0, False, True). This is working great because the first code is 302.7. Section 304's visibility expression is =IIF(InStr(Fields!FAILEDCODE.Value, "304") > 0, False, True). This text box is always hidden. It seems like Report Builder is only checking this InStr value against the first line of data, not the entire set. Does anyone know if this is accurate or if there's a workaround?

Related

#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 :)

Documentation with Diagram "Hyperlinks" in Enterprise Architect?

I'm struggling to get all the required (and only the required) information into the documentation of my Enterprise Architect Project. Precisely: we have modelled various requirements and displayed the source "standards" for these requirements in our diagrams by using the "hyperlink"-element out of the common toolbox. (This allows us to capture a title, the website where the documentation is found and a description of this documentation).
Now this element is visible on the diagram, but not in the package-view of our model and it does not get generated in our word (docx) documentation.
I can see that it should be possible to get this in the documentation, because a "Model Report" which basically prints everything does print the hyperlinks. But I can't find what I have to select in my template (in the package-tree view, as a package field, element field or diagram field) in order to get this printed. I can't just use the model report since this basically dumps the whole database in the document and reverse-engineering this model report has proven too difficult for me. Actually I would expect this to be in some kind of documentation for EA, but could not find such a thing with this level of detail... is there, is there a reproducible way of finding such things out in further cases? (btw I'm using EA 11.0)
[sorry there were illustrations here, but I'm not allowed to upload them...]
As Geert has already noted, there is a difference between "proper" elements and diagram-only elements. This is actually reflected in the document template editor, where there is an "Element" section inside the "Diagram" section. This will produce output for all elements in the diagram, whether or not they are also in the project browser.
Here's an example of the information you can pull out of your hyperlinks. Given a diagram with a hyperlink:
... and a template which outputs name, alias and hyperlink for each element in the diagram:
... EA will generate a document will the following contents:
So if you want the hyperlink to result in a hyperlink in the document, use the HyperlinkAlias field.
What might be a bit confusing is the fact that in addition to the Hyperlink element type in the Common diagram toolbox, EA allows you to create hyperlinks in regular elements (in the Element Properties dialog, Related tab: Files, which can be local files or web addresses).
In fact, I would recommend that you use those in your Requirement elements rather than diagram-only Hyperlinks if traceability is a priority in your model. The diagram-only Hyperlinks, on the other hand, give you a clearer visual.
Selecting a subset of the elements in a diagram ("only the required information") is a little more involved and depends on how your model is structured. Template fragments will get the job done, but you might be able to achieve your desired result by just using the filters in the document generation dialog.
The hyperlink is an element that is stored in the same package as the diagram it is used on, it is just not visible in the project browser (similar to a note element).
There's a good chance that it doesn't have a name, so make sure you don't omit nameless elements.
So if you print all the element of the package containing the diagram then you should be able to print the hyperlink as well.
In case that fails you might want to consider creating a template fragment based on an SQL query or a script. Those offer lots of flexibility to print whatever you need, even if it is located in a different package.
[Edited on 04.05.15 to reflect the comment by Uffe and provide a final solution]
Ok, based on Geerts answer, using the following custom query fragment in the diagram section:
select
t_object.ea_guid as CLASSGUID,
t_object.Object_Type as CLASSTYPE,
t_object.Object_Id as OBJECTID,
t_object.name as HL_Name,
t_object.Stereotype as HL_Stereotype,
t_object.object_type as HL_Type,
t_object.Alias as HL_Alias,
Note as Notes
--,t_object.*
from t_object
left join t_diagramobjects on (t_object.Object_ID = t_diagramobjects.Object_ID)
left join t_diagram on (t_diagram.Diagram_ID = t_diagramobjects.Diagram_ID)
where t_diagram.Diagram_ID = '#DIAGRAMID#'
and t_object.Object_Type='Text'
I was able to get a list of the hyperlinks following the diagram, this is the fragment:
custom >
{HL_Alias}: {HL_Name}
{Notes}
< custom
The "Notes" can be printed by getting the attribute directly out of the t_object table. Don't get confused as I was at first: the auto-completion on t_object and the results (t_object.*) DO NOT SHOW a Note-Attribute, but it does exist an when you write it into the query, it gets generated in the document.

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

Rally Create custom view based on presence of description

I am trying to identify the list of stories that do not contain any text in the "Description" field. This would be part of a report that specifies which stories are "incomplete".
In case you are interested to know why I need this:
We are facing this issue every now and then in some of our projects. Getting some basic information filled in helps reduce the time spent in iteration planning and backlog grooming meetings.
Per WS API documentation Description is of type Text and it only formally supports contains, !contains operators. !contains is not intended to return artifacts with empty text field.
!= and = operators are not supported by Text field. Nevertheless != null works with Description, while it does not work with custom fields of type Text.
This query:
https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?query=(Description%20%3D%20null)&start=1&pagesize=20&fetch=Description
will return stories with empty description.

How to detect a section in a wikimedia page dump

I have looked around quite a bit to try and answer this question, but to no avail. I am parsing wikimedia page dumps to process certain pages (yes, I am aware of several tools to parse wikimedia page dumps, but they don't work for me as well as my parser).
Question is simple. I know how to detect start of a section (e.g. "==External References=="). That's easy. What's not well defined is how to detect when a section ends? For example, for most sections I can scan until start of next section header, but that isn't reliable. I looked at wikimedia's help page on sections, but it doesn't say how to detect end of a section.
There is no "section end" marker in MediaWiki syntax. A section extends until the next section header of the same or lower level. (There is also a "section 0" containing all the text before the first section header.)
Yes, this implies that sections at different levels can overlap, as in this example:
This text is in section 0.
== Section 1 begins here ==
This text is in section 1.
=== Section 2 begins here ===
This text is in sections 1 and 2.
=== Section 3 begins here ===
This text is in sections 1 and 3.
== Section 4 begins here ==
This text is in section 4.
Note that headings created using the HTML <h1>, <h2>, etc. tags don't begin or end sections, and won't have section edit links, even though they look otherwise identical to section headings.
Section headings inside templates do get section edit links, which let you edit the corresponding section of the template, but they're treated specially and are not considered part of the normal section structure of the containing page. There are also some weird special cases here involving section headers inside template parameters which I don't fully remember off the top of my head.
The automatically generated first level heading at the top of every page also doesn't count as a section heading, although any extra first level headings created with = Heading = do.