I know there are many here who use FlexReport library so I hope somebody
here can help with this.  I am loading reports into a tab navigator, the
reports do not show content until i switch tabs, then come back to that
one.  I suspect the 'show' event being dispatched does something to the
content to make it re-appear but I'm not sure.

When I load a report, I do it with the following lines in my function

//CODE//
var viewer:ReportViewer = new ReportViewer();
            viewer.reportLabel = item.label;
            viewer.reportClass = item.data;
            viewer.label = item.label;

            reportsTabNavigator.addChild(DisplayObject(viewer));

//END CODE//

ReportViewer just loads reports dynamically like so

//CODE//
private function generateDocument():void
            {
                var productivityReport:ProductivityReport;
                var productivityReportDP:ProductivityReportModel;
//it's only setup for 1 report now, the ProductivityReport
                //get the names of the report and dataprovider classes
                var
reportClass:String="com.winn.view.reports."+this.reportClass;
                var
dpClass:String="com.winn.model.reports."+this.reportClass+"Model";
                // create class references
                var ReportClassReference:Class =
getDefinitionByName(reportClass) as Class;
                var DPClassReference:Class = getDefinitionByName(dpClass) as
Class;
                DPClassReference.projectDSN = global.projectDSN;
                // instantiate report and dataprovider classes
                var report:Report = new ReportClassReference();
                var source:Object = new DPClassReference();
                // create the report document
                 doc = new Document(report, source, PaperFormat.A4);
                 doc.pdfScript = "";
                 doc.pdfEnabled = true;
                //doc.title = "Productivity Report";
                printPreview.doc = doc;
            }

Reply via email to