Sunday, November 19, 2017

How to create Table Header constant in Body of RDLC and SSRS Reporting?


Hi ,

This is a simple steps guide in 1 report where I had created the Header Tab-lix common for all pages in body.  In this report I had used 3 tab-lix and Header I had made constant using the advanced mode.

This is for reference to remember to do complete the report without crushing your head in grinder. :)

I had defined 5 steps.

1. Click on Advanced mode.
2. Select Static Row. And Change the 2 properties mentioned in screenshot.


Monday, September 18, 2017

How to call Stored Procedure in MS Dynamics NAV?

How to Connect with SQl in NAV 2009?

This is for NAV 2009 using Automation Object For Above 2009 you can change these variables to Dotnet. The Link is provided below :- 

Direct Link For Reference in NAV 2013 and Above.

Name DataType Subtype Length
ADOConnection Automation 'Microsoft ActiveX Data Objects 2.8 Library'.Connection 
LADOCommand Automation 'Microsoft ActiveX Data Objects 2.8 Library'.Command 
LADOParameter Automation 'Microsoft ActiveX Data Objects 2.8 Library'.Parameter 
lvarActiveConnection Variant  
SQLString Text  1024
ADORecordSet Automation 'Microsoft ActiveX Data Objects 2.8 Library'.Recordset 

Name ConstValue
pcodServerName Server NAME
pcodDatabaseName DBNAME
pcodUserID USERID
pcodPassword PASSWORD


Step 1 :- Create the Connection


ltxtConnectionString := 'Driver={SQL Server};'
                        + 'Server='+pcodServerName+';' 
                        + 'Database='+pcodDatabaseName+';' 
                        + 'Uid='+pcodUserID+';' 
                        + 'Pwd='+pcodPassword+';'; 

NameCompany := 'DEV Company';

EXIT(ltxtConnectionString);

Step 2. :- Calling the SQL Connection.


IF ISCLEAR(ADOConnection) THEN
  CREATE(ADOConnection);

ADOConnection.ConnectionString := GetLiveConnectionString;

ADOConnection.Open;

Step 3. :- Write the SQL Querry


SQLString := 'select CAST(sum(SIL.Amount) as float) as InvoiceAmount, '
            + '((SUM(SIL.Amount)-SUM(SIL.[Unit Cost (LCY)]*SIL.Quantity))/SUM(SIL.Amount)*100) as GrossProfit '
            + 'from dbo.['+NameCompany+'$Sales Invoice Line] as SIL '
            + 'join dbo.['+NameCompany+'$Sales Invoice Header] as SIH '
            + 'on SIL.[Document No_] = SIH.[No_] '
            + 'where (SIH.[Posting Date] between '+ ConvertedStartDate + ' and ' + ConvertedEndDate + ');';

Step 4. :- Execute the SQL Querry

ADORecordSet := ADOConnection.Execute(SQLString);

Step 5 :- Manuplate if you want the record set if you want the SQL Record Set.

ADORecordSet.MoveFirst;

Step 6 :- Close All Connection and Clear the Variable.


ADORecordSet.Close;
ADOConnection.Close;
CLEAR(ADORecordSet);
CLEAR(ADOConnection);

Tuesday, August 15, 2017

More than 30 Points you must think before designing any RDLC Reports in MS Dynamics NAV 2017

Hi,

This post is related with RDLC Report Defination Language in C/AL so before Designing you must

know the reason why and whom and How you will create Reports in MS Dynamics NAV 2017.

So my readers will be able to resolve many problems and concepts which anyone can use in their

daily development process.

25. We can pick Year , Month and Date Difference From Posting Date in NAV.

Using 

= Year(Fields!PostingDate.Value) Further you can also use this as grouping in RDLC.

24. We can use Format in TextBox & also Use HTML in TextBox in NAV

You can use HTML Format in Reports using Textbox If you need help in it you can comment below.

23. Use Of Exit Funtion in Source Expression

You may use  Exit Function also in Data Source of DataItem of RDLC Reporting

22. PrintOnlyIfDetail

Most of you might be knowing it can be used to save unwanted dataset in Report so can be used to improve the timing issue.

21. Use Matrix Report

20. Use conversion Function in RDLC Reporting to convert Format of Expression

19. What is the use of Dataset (Fields!Expression,"Dataset Result")?

It Defines the scope of Field Expression to complete the Result.

18. Use of Function in RDLC 

Check where Code.BlankZero Defination is Given in Report in Report Properties.

17. We can also use Date Function in RDLC Reports

16. We can use year for Grouping in RDLC Reports

15. INLine IF (IIF) and Switch Case can be used in expression of Row and textboxes

14. We can change Expression of Text Box on Behalf of conditions

13. Filling row with color even odd as per requirement.

You can use it in visibility expression

=Iif(RowNumber(Nothing) Mod 2, "PaleGreen", "White")

You can change the Color of BackGround on Behalf of grouping in MS Dynamics NAV.

12. We can insert Row No. in Table using inbuilt function ROWNUBER in RDLC

11. We can repeat header in RDLC Report on every page using static property

10. We can use top n property present in Filters of tablix property to calculate top N customer Item Vendor Report.

9. You can put images in MS Dynamics NAV Report and according to conditions.

8. You can Dynamically break a Tablix and remove last Line from tablix easily using RowNumber Inbuilt Function in RDLC.

=Int((RowNumber(Nothing)-1)/25) 

So these are the points which are possible in MS Dynamics NAV if any any of the above point you need practical session you can comment me or directly message me from my blog I will update you with my blog.

Thanks to all my readers.

Happy Independence Day 2017 to all Indians.