how to save an report as xml file?

ganesh
Member Posts: 32
hi everyone..
i'm facing problem in saving an report as xml file..
i wrote
if(currreport.saveasxml('c:\myxml.xml')) then begin
message('done');
end else begin
message('notdone');
end;
when i give the above code in OnInitReport() it gives an error message stating that "please enter date"(since date is an mandatary to run the report).
when i give in it OnPreReport() it give error message "report 0 does not exit"
when i give it in OnPostReport() it gives the same error..
please help me by giving some tips--where to write the code...
and also is there any provision to pass parameter to report when called through codeunit..(like date which is mandatory to run the report)
thank you
bye
Ganesh
i'm facing problem in saving an report as xml file..
i wrote
if(currreport.saveasxml('c:\myxml.xml')) then begin
message('done');
end else begin
message('notdone');
end;
when i give the above code in OnInitReport() it gives an error message stating that "please enter date"(since date is an mandatary to run the report).
when i give in it OnPreReport() it give error message "report 0 does not exit"
when i give it in OnPostReport() it gives the same error..
please help me by giving some tips--where to write the code...
and also is there any provision to pass parameter to report when called through codeunit..(like date which is mandatory to run the report)
thank you
bye
Ganesh
if (better is possible)
{
good is not enough
}
{
good is not enough
}
0
Comments
-
Create a function on the report which will take the date as a parameter and set a global variable to that date.
something like:
var_SomeDate := parameter_SomeDate;
Now, when you code and call that report, pass the parameter to the function first and then set the XML parameters. This is all you have to do:
report_SomeReport.function_DateSet(090903D);
report_SomeReport.SaveAsXML('c:\SomeXMLFile.xml);
Remember, SaveAsXML implies a RUN command.0 -
hi wonmo..
thanks for the reply and your solution is working properly..thank you once again...
can you please give a solution to save the report as xml file using the fuction
currreport.saveasxml(filename);
for report where date is mandatory..
thank you
bye
Ganesh.if (better is possible)
{
good is not enough
}0 -
Any answer on that 'currreport.saveasxml(filename)' question from Ganesh? (His last question).Roelof de Jonghttp://www.wye.com0
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