How to add an image to an SSRS report with a dynamic url? - reportingservices-2005

I'm trying to add an image to a report. The image src url is an IHttpHandler that takes a few query string parameters. Here's an example:
<img src="Image.ashx?item=1234567890&lot=asdf&width=50" alt=""/>
I added an Image to a cell and then set Source to External and Value to the following expression:
="Image.ashx?item="+Fields!ItemID.Value+"&lot="+Fields!LotID.Value+"&width=50"
But when I view the report, it renders the image html as:
<IMG SRC="" />
What am I missing?
Update
Even if I set Value to "image.jpg" it still renders an empty src attribute. I'm not sure if it makes a difference, but I'm using this with a VS 2008 ReportViewer control in Remote processing mode.
Update
I was able to get the images to display in the Report Designer (VS 2005) with an absolute path (http://server/path/to/http/handler). But they didn't display on the Report Manager website. I even set up an Unattended Execution Account that has access to the external URLs.

I have a SSRS Report that displays the information about the countries of the users of a site that we support at work. This is based on the IIS log data. On this report, in the first column of the table is an image field that holds a small .gif of the flag for each country. I was running into the same exact issue described in the question above. The path to the external image was calculated in the report’s query based on the country code. I initially setup the URL to point to something like http://www.mystaticcontent.com/fotwimg/us.gif for a United States flag and so forth. All I got was a red X broken image displayed in the report. Then I found this MSDN article that shined some light on the issue for me.
This is what I did with the report to make it work:
Moved the fotwimg folder that has all the gifs from the static content server to the local SSRS machine, which also has a web server running on it.
Setup a virtual directory on the default web site in the local SSRS machine IIS Manager.
Then I changed the report query to refer to the image in the local SSRS machine, by machine name, like this http://mylocalssrsmachine/fotwimg/us.gif
Voila, it works… or at least it worked for me.

Have you tried using a fully qualified path?
http://<servername>/images/image1.jpg
More Info

I have this problem too..
I have looked at the SSRS error logs, and the IIS server logs. Some findings:
External images with URLs to static images work. (e.g. http://intranet/site/logo.jpg)
I can add parameters to static image URLs and it still works. (e.g. http://intranet/site/logo.jpg?foo=1) The parameter will be ignored, and the image displays. This suggests that SSRS is not choking on the ?.
If I link the external image to an ASPX page that returns a report with no parameters (e.g. http://intranet/site/image.aspx), it still doesn't work.
IIS logs show the report server requesting the image, and getting a 200 OK response.
Report server logs show this:
webserver!ReportServer_0-116!14cc!01/09/2012-12:20:29:: i INFO:
Processed report. Report='/Path/ReportName', Stream=''
ui!ReportManager_0-115!7b8!01/09/2012-12:20:29:: Unhandled exception:
System.Web.HttpException: File does not exist. at
System.Web.StaticFileHandler.GetFileInfo(String
virtualPathWithPathInfo, String physicalPath, HttpResponse response)
at System.Web.StaticFileHandler.ProcessRequestInternal(HttpContext
context) at
System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context,
AsyncCallback callback, Object state) at
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously)
I wonder if SSRS is doing something boneheaded like adding the "correct" file extension before saving the file?
i.e. something like (1) SSRS downloads /Page.aspx, which supplies an image with Content-Type: image/jpg; (2) SSRS saves this to a temporary folder with a filename like tempname.aspx.jpg; (3) SSRS looks for tempname.aspx to incorporate the image into the report; (4) Error
I suppose you could test this by handling .jpg requests in code-behind... Unfortunately that's beyond my ASPX skills at the moment.

My case: Load from localhost depending on product's code.
Image.Source= "http://LOCALHOST/IMG/" + Fields!CODE.value + ".jpg"
Problem: Sometimes file is uploaded with extension ".png"; so it's needed a FileExists validation.
Solution:
1)Add auxiliar table
PRODUCT_PHOTO_EXTENSION
id (FK references PRODUCT)
extension (varchar)
2)Create Store Procedure. Do the FileExists validation on sql and store the extension found in PRODUCT_PHOTO_EXTENSION.extension:
insert into PRODUCT_PHOTO_EXTENSION
SELECT A.id,'.JPG' FROM PRODUCT A LEFT JOIN PRODUCT_PHOTO_EXTENSION AF ON A.id=AF.id WHERE AF.id IS NULL AND Matriz is null and dbo.FileExists('D:\directory\' + code + '.jpg')=1
insert into PRODUCT_PHOTO_EXTENSION
SELECT A.id,'.PNG' FROM PRODUCT A LEFT JOIN PRODUCT_PHOTO_EXTENSION AF ON A.id=AF.id WHERE AF.id IS NULL AND Matriz is null and dbo.FileExists('D:\directory\' + code + '.jpg')=1
3)Load image file using this field.
(SSRS; image.source expression)
Iif(Fields!EXTENSION.Value<>"", "http://LOCALHOST/IMG/" & Fields!CODE.Value & Fields!EXTENSION.Value, "" )
4) Result: Load image according it extension; avoid that red "x".
Hope it helps

Related

How to upload images with the Dashboard and know the image URL using cloudinary?

Goal: My goal ist to upload images and a) keep the original name and b) know the exact URL path.
I set the Upload preset to:
Overwrite: true
Use filename or externally defined public ID: true
Unique filename: false
Delivery type: upload
Access mode: public
When I upload images using the Dashboard Media Library my images keep the original filename (which is great) but cloudinary adds a unique ID  "v1585290075" into the URL.
https:// strong textres.cloudinary.com/xxxxx/image/upload/ => v1585290075 <= /2020-03-27-ee-apps/xxxxxxx.png
This unique ID prevents me from knowing the exact URL. 
Question: How can I upload images and avoid getting the unique ID in the URL??
The Unique ID you're referring to is a version component that you can utilize to bust the CDN's cache (see here). It is not mandatory and you can safely remove it and the images will still show.

XPage view control search not working

I am new to domino designer and I am required to develop an application with it. I have went through some tutorials and I am stuck at the search function. I have followed guides I found but the search function in view control is not functioning. When I input anything into the search string(even static value), I get a server error 500. The error code is not very useful for solving my problem.(I have the full text index enabled.)
I tried to create my forms and views with the SiteFinderDemo template. I do not get an error but any search string returns 0 results.
I can modify the SiteFinderFinal's codes to work the way I want properly with the demo documents, but the search function else where just cannot work.
I also noticed new documents created with forms or xpages within the SiteFinderDemo instead of the agent do not work with the search function. I assume it has something to do with the full text searching, but I cannot find any information about it. What am I supposed to set up my application so that the search in view control can work without the server error, and what should I do to make new documents work with the search?
Thank you very much and sorry for such a long question.

Return Places nearbysearch with only 'my' locations loaded to 'Bulk Uload Tool' against my API/ID

GOAL:
I am working to return a result set of locations via the types=other parameter so that I can ensure ONLY MY locations are part of the result set.
Question/Scenario 1:
I am able to submit place/add for a location and retrieve that location with nearbysearch, however I am not able to add all my data via this method such as hours, image, url, etc. Is there formatting to support this data upload in the place/add?
Question/Scenario 2:
I have uploaded my locations in the 'Bulk Upload Tool' under my ID that is associated to my API key. In the upload I included the category 'Other'. None of these locations return in my nearbysearch result set. Should they return? If so, does anyone have insight to how?

Unable to display web part error on Custom List Form (New Item)

I'm gonna take my chance at asking a question here because I really cannot find the root cause of this problem.
I'm working on a WSS 3.0 site, using SPD 2007 and I'm fairly new to Sharepoint development in general.
I'm customizing the DispForm.aspx page. The page is a simple edit page but at the end, I add a custom list form web part for adding comments (which are stored in another list) and below, a dataview for viewing the comments associated to the item displayed by the DispForm.aspx page.
What i want to do resembles the functionality displayed on this page, I inspired myself from it and you can in fact see my comments as the latest one :
http://sharepoint.microsoft.com/blogs/GetThePoint/Lists/Posts/Post.aspx?ID=209
Everything was working, until I delete all the comments i had made as a test. Now all i get from my Custom List Form is this "unable to display this web part error".
I've had a look at the logs, I understand what it is complaining about but i have no clue on how to fix it or even understand why there is such an error to begin with.
SPDataSourceView.ExecuteSelect() - selectArguments: IsEmpty=True, MaximumRows=0, RetrieveTotalRowCount=False, SortExpression=, StartRowIndex=0, TotalRowCount=-1
Error while executing web part: System.InvalidOperationException: Unable to open the specified list item. --->
System.ArgumentException: **Value does not fall within the expected range**.
at Microsoft.SharePoint.SPList.**GetItemById**(Int32 id, String strRootFolder, Boolean cacheRowsetAndId)
at Microsoft.SharePoint.SPList.GetItemById(Int32 id)
at Microsoft.SharePoint.WebControls.SPDataSourceView.ExecuteSelect(DataSourceSelectArguments selectArguments) --- End of inner exception stack trace ---
at Microsoft.SharePoint.WebControls.SPDataSourceView.ExecuteSelect(DataSourceSelectArguments selectArguments)
at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigatorInternal()
at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigator()
at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigator(IDataSource datasource, Boolean originalData)
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.GetXPathNavigator(String viewPath)
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform()
InnerException 1: System.ArgumentException: Value does not fall within the expected range.
at Microsoft.SharePoint.SPList.GetItemById(Int32 id, String strRootFolder, Boolean cacheRowsetAndId)
at Microsoft.SharePoint.SPList.GetItemById(Int32 id)
at Microsoft.SharePoint.WebControls.SPDataSourceView.ExecuteSelect(DataSourceSelectArguments selectArguments)
we're talking about a "new item" form, so i don't understand why I'm getting an error on GetItemById. What is it trying to get and how do i fix it?
Finally, I haven't changed the CAML query created by SPD. I did make change to the Comments list such as renaming or deleting unused columns but i don't think it is the cause of the problem because deleting the custom list form and recreating it didn't fix the issue.
Any clues as to where or what I should be looking at? I'm fresh out of ideas.
Thanks.
In Sharepoint Designer, Open the DispForm that you inserted the "Comments" custom list form into.
In Code view, find the DataFormWebPart for the list.
Locate the line <SharePoint:SPDataSource runat="server" DataSourceMode="ListItem" and change the DataSourceMode to DataSourceMode="List"
Inside of the ParameterBindings, find <ParameterBinding Name="ListItemId"..... and change it to <ParameterBinding Name="ListItemId" Location="None" DefaultValue="0"/>

How do I specify parameters to a SP and to the report?

I think I've got a fundamental misunderstanding going on, concerning a SQL Server Reporting Services report, which I'm trying to make run locally in a WinForms app (eventually it will be in a WPF app, but that's later). I'm don't write many reports, and whenever I have in the past, I've used Crystal Reports. But we're trying to get away from Crystal.
Anyway, the report I'm working with uses a stored procedure in SQL Server. This SP takes 2 parameters. I also want to pass some parameters to the report itself, things like the title, etc. It's been a long time since I've done this with Crystal, but it seems to me that what I did was configure the parameters to the Crystal report, to accept parameters both for the SP and for the report, and then within the Crystal designer assign which parameter goes where. So, I tried doing the same thing with my new .RDLC report, but that's not working. When the report gets displayed in the ReportViewer control on the form, it says:
"The 'ClientNumber' parameter is missing a value."
ClientNumber is one of the parameters to the SP. And that table adapter seems to be supplying it, in the Fill method. So, I'm wrong about how this works. So then, how do I assign values to the parameters of the report?
in rdlc reports you must run sp by a data provider like SqlCommand, then you must make a named dataset, after that you can fill dataset with SqlCommand returned data. please see the below:
private void PrintBankReport(ReportDataSource rds)
{
rds.Name = Constants.Accounting.ClientReportDataSourceName.BankReportDS1;
rds.Value = ((BankReportDataSet)Session[Faraconesh.Portal.Common.Constants.Accounting.Session.BankReport]).ReportDetail;
ReportViewerControl.LocalReport.DataSources.Add(rds);
ReportDataSource rds2 = new ReportDataSource();
rds2.Name = Constants.Accounting.ClientReportDataSourceName.BankReportDS2;
rds2.Value = ((BankReportDataSet)Session[Faraconesh.Portal.Common.Constants.Accounting.Session.BankReport]).ReportItem;
ReportViewerControl.LocalReport.DataSources.Add(rds2);
}
but in rdl reports (server report) you can pass a sp to a report as a datasource and report can specify the parameters automatically.

Resources