Exporting XML with some filters

snyktp
Member Posts: 75
Hello,
I want to export the records . A Xml file must be created for every record. But it doesnt work. I created a function on the XML file(GelAllFilters). Firs I call this function after that I export xml file.. Do you have any suggestion about this ?
Thank you
XLabel.RESET;
XLabel.SETRANGE(Resend,TRUE);
IF XLabel.FINDSET THEN
REPEAT
Xfile.CREATE(Filename);
Xfile.CREATEOUTSTREAM(FXOutStream);
XMLSale.GetAllFilters(XLabel."Lot No.",XLabel."Vendor No.",XLabel."Sales Order No.");
XMLSale.EXPORT(); //XMLPORT.EXPORT(60036,XOutStream,FlorecomLabel);
Xfile.CLOSE;
Mail.NewMessage(mailadd,'',
'' + ' ' + 'Subject Info' + ' ' + FORMAT(FileNo),
'',Filename,FALSE);
UNTIL.......
I want to export the records . A Xml file must be created for every record. But it doesnt work. I created a function on the XML file(GelAllFilters). Firs I call this function after that I export xml file.. Do you have any suggestion about this ?
Thank you
XLabel.RESET;
XLabel.SETRANGE(Resend,TRUE);
IF XLabel.FINDSET THEN
REPEAT
Xfile.CREATE(Filename);
Xfile.CREATEOUTSTREAM(FXOutStream);
XMLSale.GetAllFilters(XLabel."Lot No.",XLabel."Vendor No.",XLabel."Sales Order No.");
XMLSale.EXPORT(); //XMLPORT.EXPORT(60036,XOutStream,FlorecomLabel);
Xfile.CLOSE;
Mail.NewMessage(mailadd,'',
'' + ' ' + 'Subject Info' + ' ' + FORMAT(FileNo),
'',Filename,FALSE);
UNTIL.......
0
Answers
-
what code have you put in GetAllFilters function in the xmlport?0
-
Hello
I sent some parameters to filter.. Like this;
LotNo := CLotNo;
VendorNo := CVendorNo;
SalesOrder := CSalesOrder;
After that I give some filter with these parameters on the table as you see below
X Label - Export::OnPreXMLItem()
XLabel.SETRANGE("Lot No.",LotNo);
XLabel.SETRANGE("Vendor No.",VendorNo);
XLabel.SETRANGE("Sales Order No.",SalesOrder);
Thank you0 -
Here is the code I used the following code.
you were missing
XMLSale.SETDESTINATION( FXOutStream);XLabel.RESET; XLabel.SETRANGE(Resend,TRUE); IF XLabel.FINDSET then REPEAT Xfile.CREATE(Filename); Xfile.CREATEOUTSTREAM(FXOutStream); XMLSale.GetAllFilters(XLabel."Lot No.",XLabel."Vendor No.",XLabel."Sales Order No."); XMLSale.SETDESTINATION( FXOutStream); XMLSale.EXPORT(); Xfile.CLOSE; Mail.NewMessage(mailadd,'','' + ' ' + 'Subject Info' + ' ' + FORMAT(FileNo),'',Filename,FALSE); until XLabel.next = 0;
I'm curios by this line
X Label - Export::OnPreXMLItem()
in xml you cannot have spaces in the xmltags. Your has a space in tag.
Also XLabel is a global variable? or is it declared as data source?
Btw it works for me.0 -
Hello,
First thank you for your answers
TagName DataSource SourceType TagType
PutRequestDetails <X Label Message>(X Label Message) Table Element
GetAllFilters(CLotNo : Code[20];CVendorNo : Code[20];CSalesOrder : Code[20])
LotNo(global variable) := CLotNo;
VendorNo(global variable) := CVendorNo;
SalesOrder (global variable) := CSalesOrder;
PutRequestDetails - Export::OnPreXMLItem()
"X Label Message".SETRANGE("Lot No.",LotNo);
"X Label Message".SETRANGE("Vendor No.",VendorNo);
"X Label Message".SETRANGE("Sales Order No.",SalesOrder);
I think they are clear...
I added destination but it didnt work
Thank you0 -
I've attached an example object that exports sales orders. In this case I'm filtering sales order no.
Take a look at the example and compare to your objects. The fob contains two objects in 50005 report and 50005 xmlport.
\
http://sites.google.com/site/ara3nfiles ... edirects=00 -
Thank you thank you...
This is the problem ; I used CLEARAL on preXMLProt . I didnt notice this
I deleted it.It works correctly..
Thank you for your help0 -
0
-
Dear All,
Is there any way to apply table filter for Multiple dataitem (table) as we do in report/dataport ?
Example :
I have one XMLport with 3 dataitem with no links
Table1
Table2
Table3
I want to apply filters for each of this tables when calling a XMLport.Guna0 -
create functions in the xmlport and pass the table1, table 2, to the xmlport
in those function copy the filters to the local table 1, table 3 and table 3.0 -
Hi Rashed ,
Thanks for the solution, worked well for me.Guna0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions