This walkthrough illustrates how to use the settings available to the various Rendering Extensions to change properties of a report rendered to one of the Rendering Extensions. The method below uses the PDF Rendering Extension, a similar technique is used for each of the other Rendering Extensions.
This walkthrough uses the MovieRatings.rdlx report created in the Basic Report walkthrough, so be sure to complete that walkthrough first.
The walkthrough is split up into the following activities:
- Creating a new Visual Studio project
- Adding Data Dynamics Reports references to the project
- Adding code to render the report
- Viewing the rendered report
When you have finished this report, you will have a rendered report that looks similar to the following.
Creating a new Visual Studio project
To create the Visual Studio project
- Open Visual Studio.
- From the File menu, select New > Project.
- Select the project type and click on Windows Application.
- Change the name of your project and click OK.
- Add a Button control from the Visual Studio Toolbox to the design surface of the newly created Windows Form.
Adding Data Dynamics Reports references to the project
To add Data Dynamics Reports references to the project
- In the Solution Explorer of Visual Studio, right-click the References folder for C#, or the project name for Visual Basic .NET, and select Add Reference.
- Click on the Browse tab in the Add Reference dialog.
- Browse to your C:\Program Files\Data Dynamics\Reports\build number\Assemblies\ directory, or whichever directory you installed Data Dynamics Reports in.
- Press the CTRL key and click on each of the following assemblies:
- DataDynamics.Reports.dll
- DataDynamics.Reports.Extensibility.dll
- DataDynamics.Reports.Rendering.Pdf.dll
- Click OK to add the references to your project.
Adding code to render the report
To add the code to render the report
- Double-click the Button control on the Windows form to create an event-handling method for the button click event. Add code to:
- Render the report to PDF
The following example shows what the code for the method looks like.
'Visual Basic.NET Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim _reportDef As New DataDynamics.Reports.ReportDefinition(New System.IO.FileInfo("C:\MovieRatings.rdlx")) Dim _reportRuntime As New DataDynamics.Reports.ReportRuntime(_reportDef) Dim exportFile As String = System.IO.Path.GetTempFileName() + ".pdf" Dim myFile As New System.IO.FileInfo(exportFile) Dim settings As New System.Collections.Specialized.NameValueCollection() settings.Add("hideToolbar", "True") settings.Add("hideMenubar", "True") settings.Add("hideWindowUI", "True") Dim _renderingExtension As New DataDynamics.Reports.Rendering.Pdf.PdfRenderingExtension() Dim _provider As New DataDynamics.Reports.Rendering.IO.FileStreamProvider(myFile.Directory, Path.GetFileNameWithoutExtension(myFile.Name)) _reportRuntime.Render(_renderingExtension, _provider, settings) System.Diagnostics.Process.Start(exportFile) End Sub //C# private void button1_Click(object sender, EventArgs e) { DataDynamics.Reports.ReportDefinition _reportDef = new DataDynamics.Reports.ReportDefinition(new System.IO.FileInfo(@"C:\MovieRatings.rdlx")); DataDynamics.Reports.ReportRuntime _reportRuntime = new DataDynamics.Reports.ReportRuntime(_reportDef); string exportFile = System.IO.Path.GetTempFileName() + ".pdf"; System.IO.FileInfo myFile = new System.IO.FileInfo(exportFile); System.Collections.Specialized.NameValueCollection settings = new System.Collections.Specialized.NameValueCollection(); settings.Add("hideToolbar", "True"); settings.Add("hideMenubar", "True"); settings.Add("hideWindowUI", "True"); _renderingExtension = new DataDynamics.Reports.Rendering.Pdf.PdfRenderingExtension(); _provider = new DataDynamics.Reports.Rendering.IO.FileStreamProvider(myFile.Directory, Path.GetFileNameWithoutExtension(myFile.Name)); _reportRuntime.Render(_renderingExtension, _provider, settings); System.Diagnostics.Process.Start(exportFile); }
![]() |
Tip: Be sure to change the code to point to the location of the report file you wish to render. |
![]() |
Tip: This sample code uses just a few of the available settings, check the Class Library section of the documentation for the Rendering Extension you are using to see the full list of available settings. |
Viewing the report
To view the report with the settings applied
- In Visual Studio, select Build from the menu, then Build Solution.
- Press F5 to run the project.
- Click the button control on the Windows form to render the report to PDF.

Since the settings we chose hid the Toolbar, Menu bar, and Window UI, all that displays is the report without the typical Adobe Acrobat user interface.
