200 likes | 351 Views
Converting reports to Silverswitch and running VFP reports in Silverswitch. Venelina Jordanova Venelina@VandU.eu. Uwe Habermann Uwe@VandU.eu. Silverlight Printing API. Similar to Reportbehavior 90 in VFP Whole page gets printed as an image Resolution 600 dpi Page description in XAML.
E N D
Converting reports to Silverswitch and running VFP reports in Silverswitch VenelinaJordanova Venelina@VandU.eu Uwe Habermann Uwe@VandU.eu
Silverlight Printing API • Similar to Reportbehavior 90 in VFP • Whole page gets printed as an image • Resolution 600 dpi • Page description in XAML
Silverlight Printing API • Example • Drag Button from Visual Studio Toolbox • Add event handler to Click event
Silverlight Printing API • Class PrintDocument usingSystem.Windows.Printing; PrintDocumentPrintObject= newPrintDocument(); PrintObject.Print("myprintjob");
Silverlight Printing API PrintObject.PrintPage += new System.EventHandler<PrintPageEventArgs>( PrintObject_PrintPage); void PrintObject_PrintPage(object sender, PrintPageEventArgs e) { e.PageVisual = this.LayoutRoot; }
Silverlight Printing API • Print must be started by a user interaction • Printer selection dialog is shown in any case • So always similar to … TO PRINTER PROMPT • Migration of VFP reports possible
Silverswitchreports • ProductsTemplate.frx • Migrated to: • ProductTemplate.xaml • DataGrid reports
FRX with VFP COM server • Print processing at the server side • FRX execution in VFP COM server • Creation of a PDF file • Using reportlistener • Create PDF with freeware DLL Libhpdf.dll
FRX with VFP COM server • PDF output at the client side • Output in text mode like Reportbehavior 80 or as image like Reportbehavior 90
FRX with VFP COM server • VFP COM server must be EXE file • DLL does not work!
FRX with VFP COM server • Registration at target server • ComPdfCreator.exe /regserver • Un- Registration at target server • ComPdfCreator.exe /unregserver
FRX with VFP COM server • Bericht should work autonomously • Tables in dataenvironment • Private data session
FRX with VFP COM server • Function returns PDF file name
FRX with VFP COM server • Call from ActionButton Name="vfxCreatePDFActionButton" ProcedureName= "cexample.createpdf" ProcedureParameter="customers.frx" OperationName= "CreatePDFFromFRX" OperationResultLoaded= "vfxCreatePDFActionButton_ OperationResultLoaded"
FRX with VFP COM server • Determine URL of running application private void vfxCreatePDFActionButton_OperationResultLoaded (object sender, EventArgs e) { string applicationUrl = string.Format("{0}/", Application.Current.Host.Source.AbsoluteUri. Replace("/ClientBin/VfxLoader.xap", ""));
FRX with VFP COM server • Create URL of PDF file string pdfPageURL = applicationUrl+ "UploadedFiles/" + vfxCreatePDFActionButton.OperationResult.result;
FRX with VFP COM server • Open PDF in new browser window System.Windows.Browser.HtmlPage.Window.Navigate( new Uri(pdfPageURL, UriKind.RelativeOrAbsolute), "_blank", "toolbar=no, location=no, status=no, menubar=no, resizable=yes"); }
Comparison • Silverlight • 600 DPI • Text cannot be copied • FRX • Output in text mode like Reportbehavior 80 or as image like Reportbehavior 90
ThankyouverymuchandhavefunwithSilverswitch Venelina & Uwe