[]
        
(Showing Draft Content)

Load Documents

FlexViewer allows you to load different types of documents such as PDF files, FlexReport and SSRS reports. This guide will show how to view various documents in FlexViewer.

View FlexReport

Create an object of the FlexReport class and load the report into it using the Load method. Then, define the datasource and assign the object of the FlexReport class to the DocumentSource property of the FlexViewer class. In this example, the report, productreport.flxr, is stored in the system within a folder named WinUI_FlexViewer.

C1.Report.FlexReport flexReport = new C1.Report.FlexReport();
flexReport.Load(@"D:\WinUI_FlexViewer\productreport.flxr", "Product Report");
flexReport.DataSource.Recordset = _products;
fv.DocumentSource = flexReport;

View PDF

Create an object of C1PdfDocumentSource class and fetch the location of the PDF file using DocumentLocation property. Then, assign the object of the C1PdfDocumentSource class to the DocumentSource property of the FlexViewer class. In this example, the PDF file named ProductsReport.pdf is stored in the system.

C1PdfDocumentSource pds = new C1PdfDocumentSource();
pds.DocumentLocation = "D:\\ProductsReport.pdf";
fv.DocumentSource = pds; 

View SSRS Report

Create an object of C1SSRSDocumentSource class and set the language and credentials for the object. Then, fetch the location of the SSRS report using DocumentLocation property and assign it to the object of C1SSRSDocumentSource class. Finally, generate the report by using the Generate method and assign the object of C1SSRSDocumentSource class to the DocumentSource property of the FlexViewer class. In this example, the SSRS report is fetched from a report server location by providing the required credentials.

C1SSRSDocumentSource sds = new C1SSRSDocumentSource();
sds.Language = new System.Globalization.CultureInfo("en-US");
sds.Credential = new NetworkCredential("ssrs_****", "***********", "");
sds.DocumentLocation = new SSRSReportLocation(http://ssrs.componentone.com**:**/**********, "/*************/Employee Sales Summary Detail");
sds.Generate();
fv.DocumentSource = sds;

Known Issues:

Users may experience lag when scrolling through large or complex documents, particularly those with high-resolution graphics or hundreds of pages. This is more likely to occur on devices with limited memory or processing power, where the viewer may temporarily become unresponsive.