Upload
dale-gordon
View
213
Download
0
Embed Size (px)
Citation preview
Venelina [email protected]
Converting reports to Silverswitch and running
VFP reports in Silverswitch
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
using System.Windows.Printing;PrintDocument PrintObject = new PrintDocument();
PrintObject.Print("my print job");
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
Silverswitch reports
* 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
* 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
* 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");
}
ComparisonSilverlight FRX
Image X X
Text X
* Silverlight* 600 DPI* Text cannot be copied
* FRX* Output in text mode like Reportbehavior 80 or
as image like Reportbehavior 90