Показать сообщение отдельно
Старый 15.12.2009, 12:10   #30  
GLU is offline
GLU
Участник
MCBMSS
Лучший по профессии 2009
 
52 / 74 (3) ++++
Регистрация: 08.12.2002
Адрес: Москва и Моск. обл.
Изменение стандартной Печатной формы для записей MS CRM
Источник: http://adrian-alexan.blogspot.com/

Думаю проблема стандартных печатных форм всем известна, приведенная статья показывает, как можно подменить стандартную печатную форму собственной разработкой.

Удачи в кастомизации.
=================================================================
One of the most annoying drawback which was raised by my clients ever since CRM 3.0, was the dull and inflexible print preview form of CRM entities. Needing to print out every day several types of records on such print previews and file them, turned out to be a real burden using the default print preview.

The main complaints were about:
- the layout of the print preview form is not customizable (layout, position of fields, adding or removing fields etc)
- the look (the design) cannot be customized (e.g. adding a company logo, colors, fonts, etc)
- the child collections’ information cannot be added to the print preview screen

One of the most efficient approaches to implement your own print preview page for any entity form is to perform the following steps:
1. create a custom CRM / SSRS report to be used as print preview for that entity
2. update the form.crm.htc file with a code which checks if there is a custom report defined for the current entity to be loaded instead of the default print preview. In case there is one, the customization will load that report page instead of running the default print preview page.
Add in Global.js file an array with the entities supporting custom reports for print preview:

Код:
var PrintPreviewReports = new Array();
PrintPreviewReports[Lead] = "Print Leads"; //This is the report name
Add the following code in the form.crm.htc at the beginning of Print() function:

Код:
if(PrintPreviewReports!=null && PrintPreviewReports[_oSubmitForm.crmFormSubmitObjectType.value]!=null)
{
RunReport(true, PrintPreviewReports[_oSubmitForm.crmFormSubmitObjectType.value], "", _oSubmitForm.crmFormSubmitObjectType.value, PrintPreviewReports[_oSubmitForm.crmFormSubmitObjectType.value]+".rdl", 1);
}
The approach is rather simple for a developer; once the customization has been set in place and you have a first model for a report, then it should take about 30 minutes per each new report to implement in order to be used as entity print preview.

Here’s the sample screen for this solution in production:

Default - Print Preview


Customize - Print Preview