iStock sales report viewer

Decrypting iStock sales reports delivered in the form of tab separated text files using OpenOffice Calc does not make me happy and therefore I decided to write a small app to be able to see them in a human-readable form. My requirements to such a viewer are modest, therefore it could easily be implemented by employing a little of JS inside a WEB page available online to everyone. I do not really need content of all those countless fields available in those sales reports, like my royalty rate or exclusivity status repeated for each image, etc., and the "application" supports only those, which I believe to be useful (not many). The initial result can be seen below.

Usage and features

Scroll the page downwards, load the iStock sales report file and play with the grid. The functionality listed below allows to perform a quick analysis of the sales by means of combining grouping, filtering and sorting.

Known issues

Rudimentary file format check expects the first four characters in the file to be "Name", as I can see in the files I get from iStock. If this is not the case, the file will not be parsed, an according alert will be shown instead. With the exception of that check the code does not rely on specific ordering of the fields in the input files and should survive if it changes. However, it relies on the naming of the fields of interest and will fail to work properly or completely if they change.

The link to the iStock image page is, in fact, a link to their search page, specifying the asset number as the search parameter. For me, clicking it results in getting to the iStock page of the desired image, but theoretically it may fail or even bring one to some irrelevant page.

The reason of using search requests instead of generating links to the image pages is that it appears that iStock uses a rather cumbersome way of addressing asset pages, employing at least two mutually exclusive approaches, one of them uses the asset number as the key component of the URL, another one uses an alternative asset number, and there can be something else. For most images an approach of generating URL-s with a more or less obvious from iStock site structure does work, but it also fails rather frequently. For now, querying their search for the asset number appears to deliver more reliable results even if the URL logic used does not look to be straighforward as well, for instance, in its language-related part of the search URL and enforcing language preferences on behalf of iStock in the result. This is also one of the reasons of the fact that there is no image previews: it is unclear how one could get a preview from iStock given the asset number or alternative asset number and which number should be used for the particular image.


The page does not send data anywhere, it is processed within the browser. In other words: no one except you can read your iStock sales reports using this implementation of the page, the owner of the server from which the page comes from is not an exception from this rule. JS code of the page is neither scrambled nor minified, everyone can inspect it. Everyone can also copy and modify it and I accept no any responsibility for possible clones of this code or page.


The app is rather a prototype for now, do not file a case against iStock if the information you can see on this page differs from your expectations, check it using some other tool instead. The prototype enjoys a traditional for WEB programming approach, with nearly no attempts to detect erroneous conditions, properly handle possible errors and report them to the user in a proper form, etc., just like nearly any WEB-based application does.

The text input below specifies iStock URL to follow upon clicking on links in the grid rows, its {AN} part is a template to be substituted with the actual asset number from the according record. One can enter one's own URL instead, for instance{AN}-{AAN} may work for most images. {AAN} is for the alternate asset number, which is collected from the input file, although is not displayed in the grid to avoid cluttering it with information which I believe to be practically useless.
Note: the template text is applied upon left clicking on the link, using the right mouse button followed by "Open link in new window" or something like that,it will always result in following the default URL.

iStock link URL
Controls below the column headers allow to filter the content of the grid. Dropdowns populated by the available values are used where it is appropriate, other columns require manual input with subsequent confirmation by pressing the Enter key. Yet another bug in the employed grid: the cross symbol shown within the filter's input control does not clear the filter if clicked, it only clears the input while the grid remains filtered. To drop the filter in such a situation one can click inside the according filter input and hit the Enter key. BTW, clearing the filter input text with subsequent hitting Enter should be used to drop the column filtering in general. In order to avoid a couple of other possible issues, filtering settings for now are cleared upon each file load, it is going to be improved in the future.
Grid rows per page

Current implementation is subject to testing and improvement, being something like "Version 0.1 alpha"

The article was created on 04.11.2017, last modified on 12.11.2017