AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 05.02.2009, 23:50   #1  
Blog bot is offline
Blog bot
Участник
 
25,631 / 848 (80) +++++++
Регистрация: 28.10.2006
There are several ways to do this. Either you use the existing Picture which is stored in table 79 Company Information or you can embed the image into the Report itself, or you can link to the picture externally. In this scenario I will be looking at how to use the picture already in the database and and how to embed the picture into the report itself.

How to embed the Picture:

1. For us to be able to embed the picture into a report we need to have the Company Picture as a file. I have exported the company picture to c:tempCompanyPicture.bmp

2. Ok, now let us add this to Report 111. Design Report 111

3. Select "View/Layout" to go into Visual Studio.



4. Select the Report and choose "Report/Embedded Images"



5. Select "New Image..." and select your company picture, in my case c:tempCompanyPicture.bmp



6. With that completed open the Toolbox and add a Image control to the Report.



7. With the Image Control added we need to the set correct properties for this control. Set Source=Embedded, Value=companypicutre and MIMEType=image/bmp



9. Save and import RDLC changes, and then compile report in Classic client.

10. Run "dynamicsnav:////runreport?report=111" to open up report 111. And as you can see below company picture is displayed.



We have no looked at how to embed the Company Picture into the report. Now let us have a look on how to use the Company Picture already in the database.

How to use the Picture stored in Company Information table:

1. Deleted the above embedded Company Picture, if you followed the steps above.

2. Design report 111

3. Now we need to have a Variable with is references to the Company Information Table. Lets create a new called CompanyInfo



4. Exit C/AL Globals and ad the following code to the "OnPreReport()" trigger: CompanyInfo.CALCFIELDS(Picture);



5. Now we should add a Picture Box on the Sections with SourceExpr: CompanyInfo.Picture. We need to do this to have the element available for us in Visual Studio.



6. It is now time to open Visual Studio. Select "View/Layout"

7. Notice that we now have an new entry in the DataSet



8. Now lets add this to the report. We need to add the Company Picture first as a TextBox to the body of the report. This will enable us to use it in the Page Header. We add this text field in the table found in the body section. Select column to right and right click the Table Column and select "Insert Column to the Right



9. With the new cell created in the table set the following properties:

Value: "=Convert.ToBase64String(Fields!CompanyInfo_Picture.Value)"
Name: "CompanyPicture"

10. Now let us add the Image control just as we did for the embedded scenario. Open the Toolbox and add a Image control to the Report.



11. With the Image Control added we need to the set correct properties for this control.

Source: "Database"
Value: "=Convert.FromBase64StringReportItems!"CompanyPicture.Value)"
MIMEType: "image/bmp"

12. Save and import RDLC changes, and then compile report in Classic client.

13. Run "dynamicsnav:////runreport?report=111" to open up report 111. And as you can see below company picture is displayed.





Thanks, Claus LundstrГёm, Program Manager, Microsoft Dynamics NAV



Источник: http://blogs.msdn.com/nav-reporting/archiv...o-a-report.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 


Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 00:07.