# Load Documents

## Content

FlexViewer allows you to load different types of documents such as PDF files, FlexReport and <span data-highlighted="true" data-vc="highlighted-text">SSRS</span> 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](/componentone/api/winui/online-winui/dotnet-api/C1.WinUI.Viewer/C1.WinUI.Viewer.FlexViewer.DocumentSource.html) property of the [FlexViewer](/componentone/api/winui/online-winui/dotnet-api/C1.WinUI.Viewer/C1.WinUI.Viewer.FlexViewer.html) class. In this example, the report, productreport.flxr, is stored in the system within a folder named **WinUI\_FlexViewer**.

```csharp
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.

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

## **View <span data-highlighted="true" data-vc="highlighted-text">SSRS</span> Report**

Create an object of **C1SSRSDocumentSource** class and set the language and credentials for the object. Then, fetch the location of the <span data-highlighted="true" data-vc="highlighted-text">SSRS</span> 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 <span data-highlighted="true" data-vc="highlighted-text">SSRS</span> report is fetched from a report server location by providing the required credentials.

```csharp
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.