insert image in crystal report - asp.net

i need to set logo of company according to the title of it..so along with company title want to send image path and set the image accordingly...
My motot is to set image dynamically..but not from database...
Read the ideas.nd coverted image in byte[]..but i am not able to send it along with parameter...and wat parameter shall i take on report for displaying it???
Please help

I am not sure if Crystal Report accept byte[] as a parameter.
Do you have the path of the images, if so I guess you could try to create a report with an image on it, then right click on the image and select ->"Format Graphic" -> On the "Picture" tab, you can set the "Picture Location",
You can try to put the Image file path on the "Picture Location" properties.
Please correct me if my concept is wrong

Related

Copy images from imagefield

I currently have a pdf that contains imagefields.
The issue however is that we want to be able to copy the images users input into the pdf.
Is there a way to alter the imagefield or add a button to the form that will copy the image so it will be available for pasting?
I see that I can put a button on the page and via script access the value for ImageField1.value so I can set it. But how can I read it?
you can access the image data by ".rawValue" attribute.
For example with a button and "click" event.
FormCalc: $.parent.sPic.rawValue = $.parent.dPic.rawValue
JavScript: xfa.resolveNode("sPic").rawValue = xfa.resolveNode("dPic").rawValue
with dPic being imagefield and sPic being image. This script will copy the image from imagefield into the image.

OnClick on ticketid need to open a details of ticket using birt report

I had a requirement to create a report based on individual user whom having SR waiting for approval, On click on Ticket id the URL's should redirect to SR detailed page where he can check request approve or disapprove.
using hyper link in birt properties unable to pass the ticketid by using below url's
http://google.com/maximo/ui/maximo.jsp?event=loadapp&value=asset&additionaleventvalue=Ticketid
Could you anybody help in this regards.
If the cell you made clickable contains the ticketId, go to Properties -> Hyperlink -> Edit...
Select hyperlink type URI, and click the dropdown to the right of 'Location' to go to the Javascript window.
If you're going to use it more than once, I would make the static part of your hyperlink a variable. Then add the ticketId by clicking "column bindings" in the left-lower column in the JavaScript window and selecting the appropriate cells in the middle and right columns. You'd get something like
vars["staticPartOfHyperlink"] + row[TICKETID]
If you'd rather not use a variable, you can hard-code the static part (don't do this, it's ugly and asking for trouble):
"http://google.com/maximo/ui/maximo.jsp?event=loadapp&value=asset&additionaleventvalue=" + row[TICKETID]

How to take image source from code behind after updating it from client side

I have the following scenario.
User is trying to update the profile image , I am using uploadify plugin to upload image to server , and in callback I am setting
<img src="" runat="server" class="user-image" id="uploadedImage" />
SRC attribute to the uploaded path. This part is working good , then when user clicks on Save button , i need somehow to get new picture path and save it to database.
user.ImageUrl = this.uploadedImage.Attributes["src"];
doen't brings a new picture path , and returns a previous path.
Can someone help pls ?
If you want to accomplish this you may use using hidden field, among other ways.
Please refer to: http://www.codeproject.com/Articles/603102/Persist-JavaScript-changes-on-postback,http://forums.asp.net/t/1428896.aspx/1,http://forums.asp.net/t/1285473.aspx.

Image URL is correct but image not showing

I have a website on GoDaddy. All permissions are set correctly and the image DOES exist. However when the page loads the image for the item selected does not show. Here is my code
imagepath = "~/spaimages/" + currentSpaModel.Name.ToString() + ".png";
if (File.Exists(Server.MapPath(imagepath)))
{ this.spaimage.ImageUrl = Server.MapPath(imagepath); }
spaimage is an ASP control and thr URL that the image is set to is D:\hosting\xxxxxxx\calspas\spaimages\modelname.png
What am I doing wrong.
The file path D:\hosting\xxxxxxx\calspas\spaimages\modelname.png is the folder where the image resides on the web server. You are sending this as the <img> tag's src attribute, which tells the browser, "Go get the image at D:\hosting\xxxxxxx\calspas\spaimages\modelname.png." The browser cannot go off to the D drive of the web server, so it looks on its own D drive for that folder and image.
What you mean to do is to have the <img> tag's src attribute be a path to a folder on the website. You're just about there - just drop the Server.MapPath part when assigning the image path to the ImageUrl property. That is, instead of:
this.spaimage.ImageUrl = Server.MapPath(imagepath);
Do:
this.spaimage.ImageUrl = imagepath;
See if that works.
Thanks
Often, if an image "does not show" (I assume a red-x-equivalent is being displayed to show "broken image"), I right-click the broken image, copy the URL and open the URL in a separate browser window.
This way, when the image is being generated by some script, I see any error text that the script might have shown. If not, the real image would be displayed.
In addition, add an else block to the
if (File.Exists(Server.MapPath(imagepath)))
like
else
{
Response.Write(string.Format(
"File does not exist at '{0}'.",
Server.MapPath(imagepath)));
}
For debugging purposes.

Pop up to save image in asp.net

I am using asp.net 3.5 and C#.
I have a image which I want user can download.
Like, there would be a download button or link. When user click on this link he will be prompted with a pop up to save that image to his desktop.
I have tried with
<a href ="path" > </a>
but it is opening the image in other page, I want user to be prompted to either save or view the image,
please help
Thanks in advance
You need to write an IHttpHandler that serves the image along with a Content-Disposition header.
For example:
Response.AppendHeader("Content-Disposition", "attachment; filename=\"MyImage.png\"");
Response.TransmitFile(path);
You would probably pass the image name on the query-string.
If so, make sure it doesn't contain / or \, or attackers will be able to read arbitrary files.
You need to have another page or, better yet, an HttpHandler, that takes the image path as part of the query string or as a post parameter that will send the response with Content-Disposition set to attachment. Setting the content disposition this way will cause the browser to display the file download dialog. A slightly easier way, though it depends on the user doing something extra is simply to have the link open the image in a new page and let the user right-click on it and do a "Save As".
Download
or
<a href="/path/to/image" target="_blank">
Load Image in New Window then Use Save As</a>

Resources