Get Geolocations from SQL database to be used in Bing Maps - sql

Basically I have a set of geolocations and other information corresponding to each point in a table in a SQL database. I have a Bing Maps website with checkboxes to set different filters for which geolocation pins should be displayed. I'm basically wondering how I can most efficiently query the database and update pins on a map, based on given checkboxes.
Alternatively, as requerying may be expensive as the table size increases, how could I load the entire database and only display certain pins based on the selected checkbox filters?
When researching this I found answers regarding GeoRSS files, but those solutions are specific to points that are all loading at once and that will continue to stay in view. It doesn't seem like filters can be applied in this process (without further requerying).
EDIT: When I say 'filters' I'm basically talking about narrowing down the currently displayed pins by things like the date the geolocation was recorded, and various other things that will use checkboxes. Let's say I have a list of restaurants and they each have their ID, geolocation, date added (to the database), and a foreign key for their type of food. I'd like to be able to select through the available food-types to limit results to Italian and Mexican restaurants but still provide the functionality of showing Chinese restaurants with the click of a button.
And to make it easy, I'll initially take all database entries in.

You could use an SSRS Report with a Map Control to display the info on a Bing Map. That way you can use an expression in the "hidden" property of the marker to determine whether or not to show the pushpin and map your checkboxes to parameters.
See
http://technet.microsoft.com/en-us/library/ee240845.aspx for using a map control.
If SharePoint is an option you can have a completely interactive experience with PowerView.
Here is an introduction http://office.microsoft.com/en-gb/sharepoint-help/maps-in-power-view-HA103005792.aspx

Related

Track clicks on a button based on preceding button clicks

I need to track clicks on a button at the end of a sequence of selections. As shown in the image, there are five different business plans (circled in red), and each plan can be for three different years (highlighted in blue). The user will checkbox a business plan type (e.g., market trend) and click a year (e.g., 2017), then click the PDF button (highlighted in black) to download that particular plan (market trend for 2017 in this case).
So instead of counting the total clicks of PDF downloads, the task is to count how many times a particular plan is downloaded based on the plan type and year.
The PDF button, the checkbox for each plan type, and the click button for each year all can be tracked individually. They are also all on the same URL.
GTM and GA are used for tracking. Can anyone share some thoughts of how to achieve this type of tracking?
Thanks!
Yao
If you are using google tag manager you can use dataLayer.push() to push to an array which can be used to differentiate the clicks based on the interaction.
Approach is described here
Google Analytics custom dimensions
In your particular case you could have the dataLayer configured to add the different key / values for the different report components and then the trigger will be configured to fire when the download button is clicked.
For example on each of the check boxes you could have:
<input type="checkbox" onclick="dataLayer.push({'plan_component': 'Market Trends'});">
You'd probably better having an array to store this info.
The resultant data can be viewed or aggregated via a custom report download. Described here.
Custom Dimensions and Metrics
It can be a bit tricky to understand and you'll need to change the site so that the dataLayer gets populated with the requisite data but this is the way to go. Best of luck.

What is the difference between fields and formfields?

in word pressing alt+F9 can display "FieldCodes"
How can I access this programmatically using vba and pair them with the formfields?
You can access the field code by ? Application.ActiveDocument.Fields(1).Code
And you can access the form fields by Application.ActiveDocument.FormFields(1)
But is there any guarantee's about the indices matching?
Can a formfield ever not be a Field? can a Field ever not be a formfield?
Will changing these away from FORMTEXT have any unintended side effects, or are these basically nice and friendly linking id's / display values allowing you to view them and swap between them with ease?
Edit: I've come up with the following to get the fields Code. I'm still unsure if it's a good idea to edit them or not, or what they represent.
Application.ActiveDocument.FormFields(1).Range.Fields(1).Code
Fields are general objects, they can be :
document's properties (built-in or custom),
mailing / mergemail,
calculation,
form fields,
...
A form fields is an field for inputs.
Take a look at the links in the tag info of word-field, there is a lot of interesting things!
And you can access them by their own collections (press F2 in VBE to use Object Browser).
For Fields the general collection is in Application.ActiveDocument.Fields,
but you can find them in a lot of objects (check with Object Browser!).
Take a look at that answer to have an idea of the other objects in which you can find it! ;)
To my knowledge, there is no possibility nest something inside a FormField, like you can do in a Field.
I'm not sure to understand that question :
"Will changing these away from FORMTEXT have any unintended side effects,
or are these basically nice and friendly linking id's / display values
allowing you to view them and swap between them with ease?"
If you want to create a Form that users can fill, you'll need to stick with FormFields.
If you want to display values at specific places in a document, Fields is the way to go.
I'd even suggest Custom Document Properties for a general use, and MergeMail for Mailings. ;)

Generating dynamic displayed annotations in Tableau dashboard

Given the impressive flexibility of the platform, I feel certain there is a way to accomplish this but I'm having trouble putting it together. I have a dashboard in Tableau that is comprised of two data visualizations. On one sheet I have a bar graph of sales by category that is filtered by Month/Year of sale, pretty straight forward. On the other sheet I have a simple line graph of totals sales over time. This gives the user context for the sales per month they see represented in the bar graph.
What I would like to achieve is this: When a user changes the Month-Year filter for the bar graph, I would like an annotation to show up on the line graph that highlights that month in the overall sales data along with some summary stats (total sales, average order price, etc.). I have been reviewing the following dynamic annotations concept http://vizpainter.com/dynamic-annotations-part-3/ but I don't think it will get me where I want to go. Any suggestions would be greatly appreciated.
Thanks,
Ryan
There are three things you need to learn how to use in Tableau: Tooltips, Annotations and Worksheet actions.
Most data can be added to a tooltip and formatted however you want. Tooltips will appear dynamically when you hover over parts of the dataviz. If you want permanent labels then you can use Annotations (which can be attached to a data point or area and can contain dynamic data).
Worksheet Actions allow events on one sheet to trigger changes in what is shown on another. For example, a selection of worksheet A can Highlight an area on worksheet B, which is what you want.
The best way to learn how to use these is to follow the online documentation and help. But the first step is knowing what to look for. Search for Tooltips, Annotations and Actions in the online help.
As an alternative look for examples using these tools on Tableau Public. Here is a link to a dashboard that uses Actions and Dynamic Tooltips to explore the popularity of UK childrens' names: https://public.tableau.com/shared/NCJ6F59B9?:display_count=yes
Feel free to download and explore how actions and tooltips are used.

Posting Panels Twice (Understanding pre-init)

I have a page that dynamically builds a group of Panels based on a SQL call.
Here is an example of what I am trying to accomplish.
When the page is first loaded several Panels are dynamically built. Lets say there is one panel for each State: CA, NJ, FL, etc.
If a user clicks on one of the panels (ie. one of the states) a SQL call is made and brings back a list of cities within that state. The page then dynamically builds the panels only this time listing the cities within the state clicked. When the user clicks on of the cities it calls SQL and find all of the schools listed in that city and displays them in panels (again one school per panel).
What's Happening
When the states are loaded they display fine. Though when the user clicks a particular state the page reloads and then displays all of states and all of the cities after listing all of the states instead of just listing the cities.
The proper cities are being listed so the SQL call is working.
Solution
I know several things.
ViewState is remembering the panels previously created and loading them
or
When I step through the code it's loading both the states and then the cities.
Dynamic controls are handed during the pre-init stage of the life-cycle.
Question
How can I solve this problem? I didn't post any relevant code because there is a decent amount of it to sift though. If parts of it are needed / wanted ask and I can edit this post.
I have already searched though Microsoft's documentation and the like so please don't post links to those unless you are fairly certain they will help with the issue.

Best way to select from a list - aren't the two listboxes getting a little old?

How many times have we seen this type of selector:
List Box Selector http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/MoveItemsListBox.jpg
I was just about to start creating this in a WinForms app, when I thought that others may have some ideas for doing this better. We need it to sort - so the right hand list will need up/down buttons. But this seems so old school. I love devexpress components, and was thinking of asking them if they would consider adding a component that handles this functionality with a slick UI.
I am thinking that a graphical representation of the objects, and a graphical representation of the listboxes - that would be a more intuitive way to move items around.
Has anyone seen an open source project like this?
If a CheckListBox won't suffice (and it usually will), then the "modern" approach would be to use a ListView or similar component with a "Transfer" column. Render the button inline in that column, one for each row, so that it only takes one click to move an item from one to the other.
You see this everywhere in Vista, usually with hyperlinks as opposed to buttons. Instead of clicking on an item and then choosing an action, you click the action at the item level.
I wouldn't go overboard with slickness as it can impair functionality, but the dual-listbox screen is definitely old-school.
Also, if there's a very large amount of data to manage, it helps to provide a progressive search at the bottom of one or both lists.
I have done this type of selection using (essentially) a single CheckListBox that displays each item as an image. Part of the image looks like a LED, which is on (bright) if the item is selected or off (dark) if it is not selected.
This works well if you have a reasonable amount of data to select from, and also works well in a multi-column format if you can predict that the options will have reasonably similar lengths.
Allow users to drag items in/out of list 2, and also drag to reorder in list2.
(All items dragged out of list2, and dropped anywhere outside the list, get put back into list 1, in their correct place in the list by alphabetical or natural order.)
You can merge the two list boxes into one with the help of groups (LVGF_GROUPID flag): one group for selected and one for not selected.
You can also implement group membership changes with drag-drop between them. This way single drag-drop can move an item into the other group at the appropriate position, saving most/all of the other buttons.
Additionaly the bottom of each group can have one pseudo item with help text (i.e. "Drag items here to...") that is visible only when relevant.