How To Save A Report as HTML file when i run the report.

lakshman
Member Posts: 44
Hi All,
i want to save a report in html while running the report .i used the code like below
REPORT.SAVEHTML(currentreportid,'filepath' ); in report 'on post report' trigger.
it gives an error like 'insufficient Memory in disk'. if i give any other integer .it gives html file of
a report ,what i given number . but i want the same report as html file ,when i run a report.
is it possible please give me suggestions.
Thanks & Regards:
lakshman
i want to save a report in html while running the report .i used the code like below
REPORT.SAVEHTML(currentreportid,'filepath' ); in report 'on post report' trigger.
it gives an error like 'insufficient Memory in disk'. if i give any other integer .it gives html file of
a report ,what i given number . but i want the same report as html file ,when i run a report.
is it possible please give me suggestions.
Thanks & Regards:
lakshman
0
Comments
-
I believe you are not supposed to use this from INSIDE the report, but as a replacement for REPORT.RUN, hence the memory error caused by the infinitely nested call.0
-
Hope this would solve your problem.
ok,SystemPrinter...booleab type variables.
RecItemLedger..record type variable.ok:= Report.SAVEASHTML(reportid, 'filename',SystemPrinter,RecItemLedger)
Write it OnPost Section of Report
Regards
Mrigya0 -
lakshman wrote:Hi All,
i want to save a report in html while running the report .i used the code like below
REPORT.SAVEHTML(currentreportid,'filepath' ); in report 'on post report' trigger.
it gives an error like 'insufficient Memory in disk'. if i give any other integer .it gives html file of
a report ,what i given number . but i want the same report as html file ,when i run a report.
is it possible please give me suggestions.
Thanks & Regards:
lakshman
Cannot be done in this way, because you are in neverending loop of saving this report as HTML (SAVEHTML will run the report, which inside call SAVEHTML which run the report..).0 -
You can only use
REPORT.SAVEASHTML(Number, FileName [, SystemPrinter] [, Record])
before you run the report.
An other method is, to select a printerdriver that creates a HTML (Like a PDF printer)Do you make it right, it works too!0 -
I solved the problem to avoid the deeper recursion:
Report - OnInitReport() // Initialisation of options in request form GboolSimulationMode := TRUE; // not neccessary for save as html GtxtSavePathName := 'C:\Report70321_Suppliers_Declaration.HTML'; Report - OnPreReport() // Here switch GboolRun first/second call of report in recursion // in root GboolRun ist false and lines in IF will executed IF (NOT GboolRun) AND GboolSaveAsHTML THEN BEGIN // Say the second recursion that no more recursion is required LrepMySelf.SetSaveAsHTML; // pass all option-parameters from request form to second recursion LrepMySelf.SetGlobalParameters(GboolSimulationMode); // start the recursion to save as html LrepMySelf.SAVEASHTML(GtxtSavePathName); // all done CurrReport.QUIT; END; SetGlobalParameters(PboolSimulationMode : Boolean) GboolSimulationMode := PboolSimulationMode; // not neccessary for save as html SetSaveAsHTML() GboolRun := TRUE; // here we say we are in second recursion GboolSaveAsHTML := FALSE; // turn off the option flag from request form to save as html
names of variables:
first letter: G=global, L=local, P=parameter, R=returnvalue, V=variable parameter
next less letters: bool=boolean, txt=text, rep=report, ...
rest of name free to describe
But i can't see how the filter from request form can be passed simple for all dataitems.1
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