Evo na
http://www.datadynamics.com/He...kSavingandLoadingRPXFiles.html sve pise.
Code:
Saving and Loading RPX Files
To write the code to save a report as an RPX file in Visual Basic
Right-click in any section of the Windows Form, and click on View Code to display the code view for the Windows Form. Add the following code to create the saveRPX event.
To write the code to save a report as an RPX file in C#
Double-click on the Windows Form to see the code view for the Windows form. Add the following code to create the saveRPX event.
The following example shows what the code for the method looks like.
' Visual Basic
Dim rpt As New ActiveReport1()
Private Sub saveRPX()
rpt.Run()
rpt.SaveLayout(Application.StartupPath + "\\NewRPX.RPX")
End Sub
Note: The SaveLayout method uses utf-16 encoding when you save to a stream, and utf-8 encoding when you save to a file.
To write the code to load the saved RPX into the ActiveReports viewer in Visual Basic
Right-click in any section of the Windows Form, and click on View Code to display the code view for the Windows Form. Add the following code to create the loadRPX event.
To write the code to load the saved RPX into the ActiveReports viewer in C#
Double-click on the Windows Form to see the code view for the Windows form. Add the following code to create the loadRPX event.
The following example shows what the code for the method looks like.
' Visual Basic
Dim rpt As New ActiveReport1()
Private Sub loadRPX()
rpt.LoadLayout(Application.StartupPath + "\\NewRPX.RPX")
Viewer1.Document = rpt.Document
rpt.Run()
End Sub
Note: When saving to an RPX file, be sure to save the report before it runs. Saving the layout after the report runs will cause any dynamic changes made to properties or sections to be saved in the layout. When calling SaveLayout inside the report's code, use the ReportStart event. Also note that when saving a report layout, only the code in the script editor will be saved to the file. Any code behind the report in the .cs or .vb file will not be saved to the RPX file.