how load images from Project - ImageURL s Are Stored In DataBase

edited April 2010 in FastReport .NET
hi my dear friends ...
i have many images stored in my Project in Images Folder...
i saved their URL in DataBase ....
one of those addresses is like : ~/Images/1.jpg

how can i tell PictureObject in my report to show these images (stored in my project)???
i do many ways and i test ImageLocation Property without any resaults....
plzz help me and tell me step by setp to solve this problem ...
i really like fast report and i do not want replace it bacause of this...
thanks for attention

Comments

  • edited April 2010
    Hello,

    You need to do the following:
    - in the WebReport.StartReport event, pass the physical path root to the report:
    WebReport1.Report.SetParameterValue("PathRoot", Server.MapPath(""));
    

    - in the report designer, select your Picture object and create BeforePrint event handler:
    string pathToPicture = (string)Report.GetDataColumn("YourTable.YourColumn");
    string pathRoot = (string)Report.GetParameterValue("PathRoot");
    Picture1.ImageLocation = pathRoot + pathToPicture.Remove(0, 1); // Remove is needed to remove ~ char
    

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.