This should be simple. If I have a DataSet... lets call it ImageDataSet in a report and it is a collection of ImageObjects that have two properties, lets say Photo and Caption.
So if i were writing in c# to access the second image in the collection, I would say something like ImageObjectsCollection[1].Photo to access the second photo in the collection.
My question is how can I do that within the reportviewer. Just access a specific image.
Everything I have read only shows =Fields!Photo.Value in which it would get all of them
or =First(Fields!Photos.Value) which would get the first in the collection and =Last(Fields!Photos.Value) which would access the last one in the collection. So I ask how could I specificaly access an image in between. Thanks
anyone?|||wow nothing?|||I am sorry I cannot help, but my situation is similar so I am hoping you get an answer to this. I was actually hoping to be able to pass a dataset to the Report's Custom Code, but I do not think this can be done.|||You can't randomly access rows in a datasource via RS. There isn't really a straightforward way to accomplish this, although I can imagine really convoluted means such as having a list and setting the visibility property based on the caption.
Really the way to accomplish this is to modify your query to return only the rows you want. What are you trying to accomplish that you need to randomly access returned rows?
|||hopefully I am not misunderstanding this, but if each photo/caption is a row, could you create a dataset that gets the distinct photo names/captions, then use a multiselect parameter (bound to the distinct dataset) and return the photos based on the users selections? This would get ugly if you have a lot of photos as the multiselect parameter dropdown could get pretty large.
the other option is a textbox parameter where the user can enter a portion of the caption and you return the results via a dynamic query:
="select photos, caption from image_table where caption like %'" & Parameters!Caption.Value & "'%"
that way, when a user enters "dogs", the query returns all photos with the word dog in the caption.
by the way, the above is air code and may need tweaking...