IF Number = 1 THEN
CopyText := Text003;
IF Number = 2 THEN
CopyText := 'Supplier Copy';
IF Number = 3 THEN
CopyText := 'Customer Copy';
IF Number = 4 THEN
CopyText := 'Book Copy';
I have compared Report Object Order 405 in NAV 2016 Object Designer and added the code as follows:
IF Number > 1 THEN
CopyText := Text003;
IF Number > 2 THEN
CopyText := 'Supplier Copy';
IF Number > 3 THEN
CopyText := 'Customer Copy';
IF Number > 4 THEN
CopyText := 'Book Copy';
However, notably, Text003 is 'COPY'
But still does not work.
I have compared Report Object Order 405 in NAV 2016 Object Designer and added the code as follows:
IF Number > 1 THEN
CopyText := Text003;
IF Number > 2 THEN
CopyText := 'Supplier Copy';
IF Number > 3 THEN
CopyText := 'Customer Copy';
IF Number > 4 THEN
CopyText := 'Book Copy';
However, notably, Text003 is 'COPY'
But still does not work.
IF Number = 1 THEN
CopyText := Text003;
IF Number = 2 THEN
CopyText := 'Supplier Copy';
IF Number = 3 THEN
CopyText := 'Customer Copy';
IF Number = 4 THEN
CopyText := 'Book Copy';
Hi Saurav,
By default, the Header name in Report 408 is decided by an expression =Code.GetData(1,3)
But this exact expression does not work for custom reports.
Did you face this and did you make a work around this?
Hi Saurav,
By default, the Header name in Report 405 is decided by an expression =Code.GetData(18,1) But this exact expression does not work for custom reports.
Did you face this and did you make a work around this?
I solved the GetData problem.
You have to select a TextBox in the Report Layout Body, Goto TextBox Properties, Visibility, Select Show or Hide Expression.
Click on fx, and populate the expression for example:
#Note that the Group Number 1 was set using SetData
#Note that the Control Code for GetData and SetData is in the Report Layout Properties under the Code Tab. Edit Accordingly
let me add one more trick here: these textboxes where setdata functions are written unger Visibility expression is typically quite tricky to access, since they are small and placed under the main tablix...
so what you might do if you are using Visual Studio is:
open Solution Explorer window (ctrl+alt+l) -> right click on report.rdlc -> open with -> xml (text) editor -> use search and type setdata.
Now you can see the Name of the textbox containing this functions and using this name you can come cack to layout editor (report.rdlc[Design]) and in Properties window find this textbox with the property Hidden containing code you are looking for. And actually it's even possible to make code adjustments in Report.rdlc editor:)
Answers
I would suggest to have a look on Report 405.
The Copy are created Based on CopyLoop Data Item.
On - OnAfterGetRecords of CopyLoop Data Item Look for Below Code -
And Change it To -
Where 1 Will be Original Without any copy text.
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page
We interact for the future of Code.
IF Number > 1 THEN
CopyText := Text003;
IF Number > 2 THEN
CopyText := 'Supplier Copy';
IF Number > 3 THEN
CopyText := 'Customer Copy';
IF Number > 4 THEN
CopyText := 'Book Copy';
However, notably, Text003 is 'COPY'
But still does not work.
Was there any patch or work around you included.
Thank you.
We interact for the future of Code.
IF Number > 1 THEN
CopyText := Text003;
IF Number > 2 THEN
CopyText := 'Supplier Copy';
IF Number > 3 THEN
CopyText := 'Customer Copy';
IF Number > 4 THEN
CopyText := 'Book Copy';
However, notably, Text003 is 'COPY'
But still does not work.
Was there any patch or work around you included.
Thank you.
We interact for the future of Code.
We interact for the future of Code.
IF Number = 1 THEN
CopyText := Text003;
IF Number = 2 THEN
CopyText := 'Supplier Copy';
IF Number = 3 THEN
CopyText := 'Customer Copy';
IF Number = 4 THEN
CopyText := 'Book Copy';
Regards
Rajasekhar.Y
We interact for the future of Code.
By default, the Header name in Report 408 is decided by an expression =Code.GetData(1,3)
But this exact expression does not work for custom reports.
Did you face this and did you make a work around this?
Thank you.
We interact for the future of Code.
By default, the Header name in Report 405 is decided by an expression =Code.GetData(18,1) But this exact expression does not work for custom reports.
Did you face this and did you make a work around this?
Thank you.
We interact for the future of Code.
Two Things -
1. I Told you the code as
** Why you changed it To > insted of =. Anything >4 will also be greater that 1,2,3,4?
2. Expression =Code.GetData(18,1), where GetData is a function mapped to a TextBox in Body of RDLC Report Named as PurchaseheaderDocumentType.
The Text Box will be small one and will have Red Font.
This Text Box have all fields which we need in Header, and the 18 number is mapped to one of the Names in Report Designer.
The Data Source of the mapped name in Navision Designer will be - STRSUBSTNO(Text004,CopyText)
Have a Look.
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page
I solved the GetData problem.
You have to select a TextBox in the Report Layout Body, Goto TextBox Properties, Visibility, Select Show or Hide Expression.
Click on fx, and populate the expression for example:
=Code.SetData(Cstr(Fields!ReportTitleText.Value) + Chr(177) +
Cstr(Fields!BuyFromAddr1.Value) + Chr(177) +
Cstr(Fields!SellToVendor.Value, 1)
Where the 2nd parameter is Group Number and the 1st is the datasets.
Then Goto the Textbox in the header where you want to GetData for example:
=Code.GetData(1,1)
//This Populates with changing value from Fields!ReportTitleText.Value
Do likewise for Other Fields by Incrementing in order for example:
=Code.GetData(2,1) //For Fields!BuyFromAddr1.Value
=Code.GetData(3,1) //For Fields!SellToVendor.Value
#Note that the Group Number 1 was set using SetData
#Note that the Control Code for GetData and SetData is in the Report Layout Properties under the Code Tab. Edit Accordingly
We interact for the future of Code.
so what you might do if you are using Visual Studio is:
open Solution Explorer window (ctrl+alt+l) -> right click on report.rdlc -> open with -> xml (text) editor -> use search and type setdata.
Now you can see the Name of the textbox containing this functions and using this name you can come cack to layout editor (report.rdlc[Design]) and in Properties window find this textbox with the property Hidden containing code you are looking for. And actually it's even possible to make code adjustments in Report.rdlc editor:)