Hi all,
i have one requirement form my client, that they want to print 8 different section for an item as per the setting in Sales confirmation report in Ax 2012.
Example if item one satisfy 3 condition it will print those 3 sections and if item 2 satisfy 5 condition it will print 5 section after print of line details in sales confirmation report.
In ax 2009 we were creating 8 programmable section and we were exuting all acording to the condition.
My pain is how to achive that in ax 2012 Sales confirmation SSRS report.
If any one having any idea that will be a great help for me.
Thanks in advance
Nihar
Hi.
The easiest way is to keep on using the same temporary table structure (which is already being used for this report) - SalesConfirmDetailsTmp and simply to save those extra information lines additionally for each confirmation line. In order to achieve this:
-
If the information of all 8 kinds of extra info lines is of a similar structure then all you need is some kind of flag, to distinguish if the confirmation line is a normal item line or your new type - the extra info line. You could create a YesNo enum type field called, let’s say, “ExtraInfoLine” in SalesConfirmDetailsTmp . If those info lines have totally different information structure (like more fields etc, wider or narrower fields) than you will need an enum flag field (values like “Info1”, “Info2” etc) to specifically distinguish which type of info the current SalesConfirmDetailsTmp record contains.
-
After this you will have to modify the SalesConfirmDP class to fill those extra lines with this extra information into SalesConfirmDetailsTmp table. Check method processReport() in this class. There you have a loop where class goes through all lines that are to be printed on report and inside this loop you have to add your loop which looks for those extra conditional info lines.
while (tradeLoopTrans.next())
{
// …
this.setSalesConfirmDetailsTmp(true); // here the actual info line is being inserted with standard code
while select extraInfoTable // this is your new sub-loop where you insert your extra info lines
{
this.setInfoDetailsTmp(true); // this is your method - similar to setSalesConfirmDetailsTmp() but which saves your kind of info
}
}
You can create new extra information fields in In the table SalesConfirmDetailsTmp and fill those with data in the method which I named setInfoDetailsTmp() in the example above. Keep in mind, you still have to save at least itemId or the last created line number as well, so that you can somehow distinguish later on to which confirmation line those newly added info lines belong to.
- When all necessary data is stored in the SalesConfirmDetailsTmp table and there is a clear mark along with those records which allow you to understand if the line is standard confirmation line or extra info line (and you’ve got that flag field for this reason) then you are ready to do some minor changes to the design as well. Open the report in Visual Studio, locate the lines grid in design, add extra line (or 8 lines per each info type (or even more) in case if every info line has different field count and appearance) in details part of the grid. Set the right fields to be printed in the new details lines. Set the visibility for existing details row and extra lines row so that you print the particular line only when the right type of info is to be printed. You can set the row visibility by right-clicking on the row header and choosing the option “Row Visibility…”. For the row visibility you write an expression something like this: “=IIF(Fields!ExtraInfoLine1.Value = “Yes”, false, true)”. And to avoid duplicate confirmation item line printing, you write a similar, but vice-versa expression for item line: “=IIF(Fields!ExtraInfoLine1.Value = “Yes”, true, false)”.
Hope you got the idea. I could implement this in 2-4 hours (of course, depending on what type of extra info fields are to be printed in those new sections).
Janis.
Thanks Janis for your quick response. Let me try and see the success.
Hi Janis
in my case i want to print Specification in one of the section. the specification is n to 1 relation to sales line i wrote the code in the dp class and inserting the SalesConfirmDetailsTmp table with item id and my related data and one enum type to distinguish my line from the main sales line record.
suppose sales line 1 having 3 specification i am creating 4 record in SalesConfirmDetailsTmp but unable to write the expression ( my field is expressionname (string 15 char))how to show my 3 lines below to main sales line record.
could you please help me in this.
thanks
nihar