Archive for the ‘RTC Reports’ Category

How to see Dataset result in RTC reports

Wednesday, January 11th, 2012

When we run report in RTC, the report is executed in by using classic report code and dataset result is passed to RTC report where we need to show the data in rdlc report.

to check the dataset we need to activate about this report first and then run again..

1.    Run report Ex: G/L Register

2.    Click Preview

3.    On the Report Page Top Right Corner Help Button is there.
On this button press About This Report (Ctrl+Alt+F1).

dataset1.jpg

4.    Dataset feature is activated

dataset2.jpg

5.    Now run the report again and see About this report

dataset3.jpg

File Export in RTC with “Common Dialog Management”

Sunday, February 20th, 2011

I hope you have observed that a new window will be opened with options Open, Save and Cancel while exporting a file in RTC.

* I have taken Report 9171 - Export Profiles as example.

If you Run the report in classic, you will have an option to select the path and file name in Options tab

cc1.jpg

But if you run the same report in RTC, you will not have an option to select the path and file name in options tab

rtc1.jpg

After clicking OK, you will get the options to Open, save and cancel

rtc2.jpg

If you want to export the file as in Classic Client like with common Dialogue Management, follow the below steps..

Create a local function “DownloadFile” in Codeunit 419 - 3-Tier Automation Mgt.

TempFileName := DownloadTempFile(TempFileName);

IF ISCLEAR(FileObject) THEN

  CREATE(FileObject,TRUE,TRUE);

IF FileObject.FileExists(FileName) THEN

  FileObject.DeleteFile(FileName,TRUE);

FileObject.MoveFile(TempFileName,FileName);

rtc3.jpg

Name   DataType        Subtype           Length

*FileObject     Automation     ‘Windows Script Host Object Model’.FileSystemObject      

Modify the code in Report - OnPreReport()  and Report - OnPostReport() Triggers as

rtc4.jpg

Comment the code in RequestOptions Form -  OnOpenForm()

RequestOptionsForm.FileName.VISIBLE := NOT ISSERVICETIER;

Recreate the requestpage by using the transformation tool

Now, run the report in RTC

It will have an option to select file path and name

 rtc5.jpg

Click Ok and it will save the file in the given path as in Classic Client.

Monthly Purchase Invoices in Chart

Friday, February 11th, 2011

One of the new features of RTC is Charts in reports .

Today I would like to see the monthly total purchase invoices amount in charts.

Started as below..

As I need to show the Month names in Y-Axis of the Chart so I have taken Date table as my first dataitem to get the month name and year.

“Startdate” and “EndDate” are calculated to get the Months start date and end date by using “Startingdate” and “EndingDate” which are entered in request form by user.
Report - OnPreReport()
IF (StartingDate = 0D) OR (EndingDate = 0D) THEN
ERROR(Text000);

StartDate := CALCDATE(’<CM - 1M + 1D>’,StartingDate);
EndDate := CALCDATE(’<CM + 1D>’,EndingDate);

CompInfo.GET;
VendFilters := “Purch. Inv. Header”.GETFILTERS;

The “Date” table has been filtered by calculated “StartDate” and “EndDate”.

Date - OnPreDataItem()
SETFILTER(”Period Start”,’%1..’,StartDate);
SETFILTER(”Period End”,’..%1′,EndDate);

The “Period Name” is Concatenated with the Calculated “year” and saved in “PeriodText” text variable.(will discuss the use of this variable later )

Date - OnAfterGetRecord()
PeriodText := “Period Name” + ‘-’ + FORMAT(DATE2DMY(”Period Start”,3));

In Purch. Inv. Header - OnPreDataItem() trigger

The Purchase Invoices are filtered by “Posting Date” with Months Start date and End Date

And

In Purch. Inv. Header - OnAfterGetRecord() trigger

The records which have Posting Date below start date and above end data are skipped.

Purch. Inv. Header - OnPreDataItem()
SETRANGE(”Posting Date”,Date.”Period Start”,Date.”Period End”);

Purch. Inv. Header - OnAfterGetRecord()
IF (”Posting Date” < StartingDate) OR
(”Posting Date” > EndingDate)
THEN
CurrReport.SKIP;

If I run the report with Starting date = 01-01-10, Ending Date = 10-01-11 and Buy-from Vendor No. = 10000 in classic client, the output is

Classic Output 1:

Classic Output

Now, to transform the report to RTC

Click Create Layout Suggestion under Tools..

It will create layout but the layout is not 100% so it has not created Date, Body (3) section of Classic report

So we need to create a grouping here with the variable “PeriodText” which we have calculated in Date - OnAfterGetRecord()

Here I have taken Year also because if i have entered periods in 2010 (01/01/10)and 2011(01/02/11), the grouping will be done on months like January, February of 2010 and 2011. In order to avoid that I have taken Year also in “PeriodText”.

Save the layout and report.

Transform the request form to request page by using Transformation tool.

Now run the report in RTC by adding it in any Page or Command

dynamicsNAV:////runreport?report=xxxxx

the Preview will look like Classic

RTC Layout

RTC Output 1

 Now we need to add Chart to Layout

From tool box drag the Chart on to the layout

Right Click and Select Properties

Set the following properties as shown in screenshots

Chart Setup 1

Chart Setup 2

Chart Setup 3

Chart Setup 4

Run the report in RTC and now we can see the monthly Purchase invoices in chart

Chart Output 1

Final Chart Output

Please let me know if you have any queries.