Hi Masters,
I confuse of my problem. Here, a task from user. They need report for transfer shipment. But usually when enter/input for this table they didn't use item no but user search description (by using search description they could get the item no/part no). The problem is, there is 1 record that have multiply input but only have 1 item no/part no (others are comment only), but on report shown 4 part no which is the part no of 1st then loop to 2nd and 3rd line. How I delete or make it not loop for 2nd and 3rd line?
I hope all of you can understand what I mean.
Please and thanks
0
Comments
If you need only first record then use
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
I will try it. I have to modified last report from other consultant, i try if it is could or not (that's the prob)
I bet this conversation starte with the users saying "Yeah but in our old system..." That is called the road to hell.
Yeah you are correct. But, we can't avoid user habit. From the beginning they always search description rather than input part no or item no. Then use other comment on the next line. When I see table Transfer Shipment Line, that I found and realize why it loop. But until now can't solve. 1st Consultant who fix it before has resigned and now i confuse about his code.
onaftergetrecord()
PostedDocDim2.SETRANGE("Table ID",DATABASE::"Transfer Shipment Line");
PostedDocDim2.SETRANGE("Document No.","Transfer Shipment Line"."Document No.");
PostedDocDim2.SETRANGE("Line No.","Transfer Shipment Line"."Line No.");
//this part I guess for looping
vUnitPrice := 0;
vTotalAmt := 0;
IF vItem.GET("Transfer Shipment Line"."Item No.") THEN BEGIN
vUnitPrice := vItem."Unit Price";
vPartNo := vItem."Search Description";
// even user input just a comment and no part no, on the report still shown looping and take the 1st part no and on the description there's //show the comment
END;
vTotalAmt := vUnitPrice * "Transfer Shipment Line".Quantity;
Error while validating RDL content:
The value expression for textbox 'Transfer_Shipment_Line_Item_No_Caption' refers to field 'Transfer_Shipment_Line_Item_No_Caption'. Report item expression can only refer to field with in the current data set scoop on, if inside an aggregate, the specified data set scoop.
anyone know what the error mean?
Did you delete any field in classic sections and forget to delete in rdlc data (related to RTC report)?
Error message is completely different..not related to code which I suggested..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Error message is completely different..not related to code which I suggested..[/quote]
No. I didn't do anything with the table (deleted field or anything). Only with report. I see that code and wanna modify, but can't even just put enter. When compile shown that error.
I mean in sections of report..
If you didnt then the problem should be exising before also..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Thanks
It's same, I can't modify with same error. But I can run it same like before the looping show.
I don't know how to go to RDLC report and delete what mention on the error message. Can you explain the step for me?
Sorry if it is bother you
Thanks
Yes you can, its called training.
It's their job that they are paid to do.
But now I still stuck with can't modify the code report.
Please anyone can help....
according to the error message a control with the property DataSetFieldName set to "Transfer_Shipment_Line_Item_No_Caption" is missing. Because NAV generates these DataSetFieldNames based on the DataItem Name, field caption and the fact if its a title or not. I can tell that probably the Title of the "Item No."-column has been deleted.
If your customer doesn't use RTC i'd think about deleting the rdlc layout because you won't be able to delete any control on the classic section designer anymore if you don't adjust the rdlc layout every time. Even though it would be absolutely unnecessary if noone is using RTC on that database anyway. I must warn you though that it is a lot of work to recreate it the way it looked before. And i won't take any responsibility. So better make a backup ;-)
There are two other ways to fix the problem:
a) re-insert the control for the "Item No."-title back into the classic design and set its DataSetFieldName property to "Transfer_Shipment_Line_Item_No_Caption" (it's the last property in the property window).
b) go into the rdlc layout designer. Find the field that is supposed to print this title and delete the value of that field. (or adjust the layout so you can delete the whole field).
Back to your opening question: it opens up the question if you are concerned about the rtc layout or the classic layout. on the rtc, there could be just an issue with some properties... on the classic: i'd work with the CurrReport.SHOWOUTPUT(Boolean) command. A Report that is made for printing purposes should never edit the data its Processing in my opinion.
but just for a guess: try this code here instead of skipping or editing (this should allow you to keep the comment lines printed ;-) (i colored the line i edited from your code to red)
onaftergetrecord()
PostedDocDim2.SETRANGE("Table ID",DATABASE::"Transfer Shipment Line");
PostedDocDim2.SETRANGE("Document No.","Transfer Shipment Line"."Document No.");
PostedDocDim2.SETRANGE("Line No.","Transfer Shipment Line"."Line No.");
//this part I guess for looping
vUnitPrice := 0;
vTotalAmt := 0;
vPartNo := '';
IF vItem.GET("Transfer Shipment Line"."Item No.") THEN BEGIN
vUnitPrice := vItem."Unit Price";
vPartNo := vItem."Search Description";
// even user input just a comment and no part no, on the report still shown looping and take the 1st part no and on the description there's //show the comment
END;
vTotalAmt := vUnitPrice * "Transfer Shipment Line".Quantity;
It's really help me. I will try this. 1st sure with the rdl data that missing. I hope I can find out it fast.
Once again, thanks guys
Trying next step.
The Part No show blank but for unit Price & Total Amount still show 0. How do I convert decimal to string? I try format, but it doesn't work
1 with full data, and the other only descriptions. But I don't know hoe to do it.
I am newbie (sorry). Could anyone help me step by step, please???
Thx all