Dear All,
Suppose i have 2 Dataitems on report say D1 and D2 with D2 indented under D1. I set the property PrintOnlyIfDetail of D1.
With Report output Its working fine. Only those records of D1 are printing which have data in D2.But while exporting to excel all D1 receords are printing irrespective they have corresponding data in D2.How come?
Am i missing something while writing Export to Excel code?
Waiting for your Valuable Comments
Comments
I tried the same thing as u have asked for.....It worked fine.
IF NOT(CREATE(xlApp)) THEN
ERROR('Error creating excel file');
xlWorkBook := xlApp.Workbooks.Add(-4167);
xlWorkSheet := xlApp.ActiveSheet;
xlWorkSheet.Name := 'Name';
Row:=1;
try this code.........
regards,
Sophia
Move your code in the onaftergetrecord trigger of D2, and call it only the first time you enter the trigger (a simple boolean condition).
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
My problem is that i Have Group Header for D1, and i m writing code on the OnPreSection for export to excel the data in this Section. Lets take an example of Item Ledger Entry Table and Lot Information Table. I have indented Lot Information Table under ILE. ILE is grouped on Source No. Now, If Lot Information table has Data based on the filters with ILE Then only it will Print Source No. But for export to excel it is printing all the source No.
](*,)
and On PostReport
xlApp.Visible :=TRUE;//write it
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
change this to this
This makes it easier to insert a new column between "A" and "B" for example...and some customers ask it :?
anyway, i don't have a lot of data to process and i got only the bold lines in excel...i'll look through the code...maybe a screenshot of your excel file can help...
OK, first of all, you can change this
to this
as you don't need the value of the first record...it's a little faster for SQL.
to solve your problem, try to change this
to this
Check this on all your sections
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Attached is the two report output. The Second file have Navision report Data. This is correct because it is printing only those Source No. From Item Ledger Entry Table which has some data in Lot No. Information Table.
The otherone Excel Output is showing all the Source No. from Item Ledger Entry Table whther they have data in Lot No. Information Table.
My Query is That if i put Printonlydetail property yes it works fine for navision report print, but when i export this data to excel how can i use this property in code to export only those records which have details in indented dataitem.
CurrReport.SKIP(ISEMPTY)
Excuse me, it's totally wrong, what i meant was :oops:
It was friday, afterall... #-o
anyway, doesn't the "currreport.showoutput = true" do the trick for you?
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
In the top data items OnAfterGetRecord trigger do the folowing: