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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 25.09.2013, 14:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,631 / 848 (80) +++++++
Регистрация: 28.10.2006
kamalblogs: SSRS Tip: Prevent report execution through controller – Dynamics Ax 2012
Источник: http://kamalblogs.wordpress.com/2013...amics-ax-2012/
==============

What a user might hate to see is a blank report. No matter where the mistake lies the earlier we react the happier the user is. Here today i’m sharing a tip on how you could stop/warn/show a info after the report execution is initiated  after the user clicks the “Ok” button in the dialog.

In the example discussed here, the idea is to check preemptively if a query will return a record or not. If no then the report aborts execution.

To implement this, open the controller of your report or create one.

On the controller class, override the method “preRunValidate”

Place the code as shown here. This method is invoked after the user clicks the “Ok” button and before the report is executed. Do not block the super call in this method as it does few other important validations. This method can return an error/warning/info. If it is a warning or error the report aborts further execution.

protected container preRunValidate(){ container validateResult = super(); Query firstQuery; int recordcount; firstQuery = this.getFirstQuery(); custStatementCount = QueryRun::getQueryRowCount(firstQuery, 6); if (custStatementCount > 5) { validateResult = [SrsReportPreRunState::Error, "No valid records found for the specified range"]; } return validateResult;}Standard recommends the method to be used for validating if the report returns a large amount of data.For reference see \Classes\CustAgingReportController\preRunValidate\
For more tips and learning about SSRS – AX 2012 order the book Dynamics AX 2012 Reporting Cookbook authored by me.



Related articles


Источник: http://kamalblogs.wordpress.com/2013...amics-ax-2012/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
kamalblogs: SSRS tip: Take care that VS and AX client are in the same layer for SSRS – Dynamics AX 2012 Blog bot DAX Blogs 0 09.09.2013 16:11
kamalblogs: Book review: Extending Microsoft Dynamics AX 2012 Cookbook Blog bot DAX Blogs 1 09.09.2013 16:11
dax-lessons: Get the underlying SSRS Report Query, reset query , add your own ranges and execute report [Dynamics AX 2012, X++] Blog bot DAX Blogs 0 30.04.2013 01:13
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 10 Blog bot Dynamics CRM: Blogs 0 17.08.2012 03:27
ax-erp: Creating SSRS-Reports in Dynamics AX 2012 – What’s no longer possible in AX-reports Blog bot DAX Blogs 0 18.07.2012 12:11

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

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

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