Trying to keep data from moving down in grouped report - visual-studio

I'm trying to create a report which shows a list of all companies and all jobs awarded for that company. I have the company name at the top of the group with a total at the bottom-inside of the group. I also have address information for the companies which I am trying to keep directly under the company name. The address data keeps moving down. How can I keep the data up directly under the company name.
As you can see from the image above. I want the address information moved up directly below the company name. Below is what my design view looks like.

If you can do a screenshot of the report in design that would help. My guess is you have to work with the "insert row outside group above" while having the company row group selected. Then put your address in the right row.
The other way I have seen is to put the address and company and text all together in one output line in the SQL and use Char(10) + Char(13) to put in the line breaks.

Had to add a new line in an expression.
=Fields!Company_Name.Value & vbcrlf & Fields!Address.Value & vbcrlf & Fields!Province.Value

Related

In QuickBase, is there a way to add a drilldown report to a formula field?

One thing I appreciate about QuickBase table to table relationship summary formulas is that they automatically are hyperlinked to a drilldown report (e.g., if I had a field that counted the # of passing scores for a person and the person had 2, then there's automatically a link to the parent table/report and if I click it, I can see both of that individual's passing score records).
Unfortunately, I lose that functionality when writing a formula outside of the table-to-table default options (e.g., the # of passing scores divided by the # of passing + non-passing scores does not give option to add a drilldown report). Is there a way to add drilldown to a formula field? The closest I got was adding a report link field, but it'd be nice if that was a hyperlink with a number to avoid taking unnecessary space.
You should be able to do that using a Formula Rich Text field with an HTML hyperlink and adding a query parameter in your URL. You can get some help building the query if you turn off the new report style, then going to More > Show the expanded URL for this report. The expanded URL should look like this:
I agree with the Rich text field.
I prefer to build a query instead of using the expanded one.
The expanded url has a temporary id :(
Here is an example how you can create an own link if you use a formula Rich text field.
For sure, you have to replace a couple of variables in the following link ;)
// qid=1 >> id of your drilldown report
// mx{6.TV.2} >> 6 is the related field's id, 2 is the key of your table (master)
// the numbers are just an examples
// _DBID_TEMPLATES_CHILDREN >> you can find it at bottom of the children table's
advanced settings
"<a href=\""& URLRoot() & "db/" & [_DBID_TEMPLATES_CHILDREN] & "?
a=s&qid=1&dlta=mx{6.TV.2}&opts=disprec&isDDR=1\"> "& [# of Templates childs] &" </a>"

ServiceNow-How to get a record (INCIDENT/REQUEST/CHANGE)

Is there any common URL to navigate to serviceNow portal with number (INC/REQ/CHG)?
I have an common URL (INC/REQ/CHG) which can be navigated to ServiceNow portal by sys_id:
https://XXXXdev.service-now.com/nav_to.do?uri=task.do?sys_id=XXXXXXXXXXXXXXXXXXXXX
I have tried below URLs for incident but it is creating a new record
XXXXdev.service-now.com/nav_to.do?uri=incident.do?sysparm_order=INC0XXX
OR
XXXXdev.service-now.com/nav_to.do?uri=incident.do?number=INC00XXXX
No problem if there are different URLs for INC, REQ or CHG, I want a URL to see record by giving a number but not with sys_id.
From what you have described I believe you want:
https://[instance].service-now.com/incident.do?sysparm_query=number=INC1234567
https://[instance].service-now.com/sc_request.do?sysparm_query=number=REQ1234567
https://[instance].service-now.com/change_request.do?sysparm_query=number=CHG1234567
Or the catch all
https://[instance].service-now.com/task.do?sysparm_query=number=INC1234567
https://[instance].service-now.com/task.do?sysparm_query=number=REQ1234567
https://[instance].service-now.com/task.do?sysparm_query=number=CHG1234567
(see https://docs.servicenow.com/bundle/helsinki-servicenow-platform/page/use/navigation/concept/c_NavigatingByURL.html)
If you want to keep the outer frames of SN then use the nav_to.do?uri= version e.g.
https://[instance].service-now.com/nav_to.do?uri=sc_request.do?sysparm_query=number=REQ1234567
which is what #kirk has described.
You have a couple of options depending on what you're trying to do exactly.
Email
If you're trying to send this link in an email notification, you can use ${URI_REF} for the table that the notification is generated on.
This will automatically generate a link to the record.
You can also dot walk to another table, for example
Catalog Task up to the Requested Item ${request_item.URI_REF}
Current task up top the parent record ${parent.URI_REF}
Calculated
If you are looking to generate this based on some calculated method you can do this with the table name and the record number.
https://instance.service-now.com/nav_to.do?uri=/table_name.do?sysparm_que‌​ry=number=RECORD_NUMBER
For instance for a Change record with record number CHG0000123
https://instance.service-now.com/nav_to.do?uri=/change.do?sysparm_que‌​ry=number=CHG0000123
You may also reference a record by using a parent table, though this is more for an interesting note rather than a good practice. INC, REQ, and CHG all inherit from the Task table so you could do this.
https://instance.service-now.com/nav_to.do?uri=/task.do?sysparm_que‌​ry=number=CHG0000123
The drawback to using the parent table is that it won't have all fields and won't have the proper form layout. Mostly just an interesting exercise.
You may also leverage the text search and the system will pull up a record that matches the record number.
https://instance.service-now.com/nav_to.do?uri=/textsearch.do?sysparm_que‌​ry=number=CHG0000123
Note that this works out of the box and you could have configured search to not behave that way.
Business Rule
Another method inside of a Business Rule is to use the current.getLink() method. This will return a URL to the record. If you would like to add to a journal entry, you could use this
var currentLink = "[code]<a href='" + current.getLink() + "'>" + current.number + "</a>[/code]";
var journal = gs.getMessage("The new record is {0}", [currentLink]);
gr.work_notes = journalEntry;
Your initial URI will actually work with a NUMBER (like INC000001), assuming that number is actually the display field for the table (as it is by default):
https://XXXX.service-now.com/incident.do?sys_id=NUMBER
When you do a sys_id= lookup, we first lookup by the sys_id column. If it's not found there, we try a lookup on the display value (number), which will load the form exactly as you expect.
{yourinstance}.service-now.com/nav_to.do?uri=incident.do?sys_id={incidentNumber}
Replace incidentNumber with your incident number .

Microsoft Access - Multiple Items Form Image

I have 2 tables: One of them is named 'ImageDrive', and the other is named 'Person'. In the Person table, there is a field called 'Primary Image Path' and it stores part of the path, i.e., "\DefaultPicture\default.jpg". The ImageDrive table has a field Drive which stores "C:\MyDocuments\Pictures".
I created a Person form, with a form type of "multiple items form". I then removed the textbox and replaced it with an image control for the Primary Image Path field.
Now the problem is, how do I go about extracting the information from the Drive field in ImageDrive and combining it with the Primary Image path? I need to combine them in order to set the Image control picture.
I have tried using Expression Builder and came up with the expression [ImageDrive]![Drive]&[Primary Image Drive] for the image control source. However, when I click on Form View, it shows nothing.
What is the right way to do this?
I'm not sure if you wanted to do this in VBA or not, but here is a small bit of code that may help for getting the path of that user. You can combine that with a Recordset to reference your other table of pictures. Or use two recordsets, one for each table.
Dim myR as Recordset
Dim myR2 as Recordset
Dim filePath as String
Set myR = CurrentDb.OpenRecordset("ImageDrive", dbOpenDyanset)
Set myR2 = CurrentDB.OpenRecorset("Person", dbOpenDynaset)
'When you open these two Recordsets they will open on the first record of each FYI
'You can either use myR.FindFirst or a Select statment to sort through the records
filePath = myR![Field_name_of_path] & myR2![Field_name_from_other_table]
'Now filePath contains what you need.
'You can also use Environ$("USERPROFILE") & "\My Documents"
'to get something like C:\username\My Documents and set that as a string as well
Set myR = Nothing
Set myR2 = Nothing
After including the image control, go to the control source of the image control. and using the dlookup method to get the drive, as the form is created by using the fields the Person table. Below will be the line of code to be put at the control source.
"=DLookUp("[Drive]","ImageDrive","[Drive] IS NOT NULL") & [Primary Image Path]"

Get statistic of record counts from FileMaker using AppleScript

Can somebody advise whether there's a good built-in way (= AppleScript command) to pull out statistics for a DB:
I need to count the number of occurrences of a string in a particular field over all records.
E.g. for a record that has
Name
Phone
Town
the script would return how many records exist with identical towns.
Step 1 - Create a relationship.
- File > Manage Database > Define Database
- Relationships tab
- Duplicate your table occurance and name it (I used related_towns)
- Drag a relationship between the two from town to town
- Click OK.
Step 2 - Create a calculated field that counts the instances of the related (duplicative) town name.
File > Manage Database > Define Database
Fields Tab
Type in the name of your new field (I used number_of_related_towns) at the bottom of the screen
Select "Calculation" from the field type list
Count the times that the town appears in your relationship with this calcuation:
Be sure that "Evaluate this calculation in the context of" is set to the name of your base table (what your layout is based on). Replace related_towns with whatever you named your new table occurance.
Step 3 - Write a script to display your data.
Scripts > Manage Scripts
New button (bottom left)
Rebuild the screenshot below. I added comments, which hopefully explain?
Let me know if you have any questions.
I would do this in FileMaker. It is built for exactly this. Do you know how to do it in FM?

VB6 and data-bound MSHFlexGrid, moving and populating columns

I'm working on a VB6 program that connects to a SQL Server 2008 R2 database. In the past I have always used the MSFlexGrid control and populated it manually. Now, however, the guy who is paying me for this wants me to use data-bound grids instead, which forces me to use the MSHFlexGrid control because I'm using ADO and not DAO. So, I have two questions...
First, how would I move a column in a MSHFlexGrid? For example, if I wanted the third column to appear as the sixth column in the grid, is there a simple single line of code that would do that?
Second, believe it or not, I've never had to do anything in a grid other than display the data, as is, from a recordset. Now, however, I have a recordset with some fields that contain just ID numbers that refer to records in other files - for example, a field containing an ID number referring to a record in the Customers table, instead of the field containing the customer's name. What is the easiest way to, instead of having a column showing customer ID numbers from the recordset, having that column show customer names? I thought I read somewhere that there's a way to embed a sql command in a MSHFlexGrid column, but if there is I wouldn't know how to do it. Is this possible, or is there a simpler way to do it?
TIA,
Kevin
The column order would typically be handled by your SELECT statement.
Say you have a Pies table that has a FruitID foreign key related to the FruitID in a Fruits table:
SELECT PieID AS ID, Pie, Fruit FROM Pies LEFT OUTER JOIN Fruits
ON Pies.FruitID = Fruits.FruitID
This returns 3 items: ID, Pie, and Fruit in that order.
Moving columns after the query/display operation is rarely used, but yes ColPosition can be used for that.
Wow! VB6.... Back to the future! :-)
You can move Columns using the ColPosition Property.
This article shows how you could setup the grid to display hierarchical data.
If you just want to display the customer name on the same line as the main data then that is doable as well by just creating the proper SQL for your data source. For that matter you can control the column order the same way as well.
Now, how about considering upgrading to .Net? Just kidding..... No, I'm not. OK. I am, maybe. :-)

Resources