| |
Data Dynamics Reports Support
Started by Mike_B at 08-13-2009 6:54 AM. Topic has 6 replies.
 
 
 
|
|
Sort Posts:
|
|
|
|
08-13-2009, 6:54 AM
|
Mike_B
Joined on 06-17-2009
Posts 16
|
|
|
How do you export a report to a PDF (or other file type) using the reportPreview.Export function. The documentation (RenderingExtensionInfo Class Members) is not real clear on this considering all it really does is restate the Name properties. Would be nice if it actually explained the names and where they are coming from. Example, AssemblyName, Fully qualified name of the assembly, What Assembly? MenuName, export menu item name for this rendering extension name, Where is the MenuName coming from? then TypeName, Rendering extension implementation class name, what is this?
ms-help://dd.DataDynamicsReports.1033/ddDDR/DataDynamics.Reports~DataDynamics.Reports.Configuration.RenderingExtensionInfo_members.html
|
|
|
|
|
Report
|
|
|
|
08-13-2009, 9:53 PM
|
Sergey
Joined on 08-28-2004
Novosibirsk, Russia
Posts 3,015

|
|
|
Hello, I suppose that you would like to utilize ReportPreview.Export method for the custom toolbar of viewer control. It is the good practice to use AvailableRenderingExtensions property of ReportPreview control for that. The value of that property is the collection of RenderingExtensionInfo instances which reflects all the rendering extensions which can be used by preview control. Here is the example of the code which uses both AvailableRenderingExtensions property and Export method to create the custom "exportation UI": public MainForm() { InitializeComponent(); ReportPreview preview = new ReportPreview(); preview.IsToolbarVisible = false; preview.Location = new Point(0, 30); preview.Size = new Size(this.ClientSize.Width, this.ClientSize.Height - 30); preview.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom; Controls.Add(preview); preview.OpenReport(new FileInfo(@"c:\foo.rdlx")); int x = 0; int width = 100; int height = 20; foreach(RenderingExtensionInfo reInfo in preview.AvailableRenderingExtensions) { Button btn = new Button(); btn.Location = new Point(x, 0); btn.Size = new Size(width, height); btn.Text = "Export to " + reInfo.MenuName; btn.Tag = reInfo; btn.Click += delegate(object sender, EventArgs args) { Button button = sender as Button; if(button==null) { Debug.Fail("button is not the button??"); } preview.Export(button.Tag as RenderingExtensionInfo); }; Controls.Add(btn); x += width; } Another question is how AvailableRenderingExtension property value is set? The brief answer is ReportPreview control reads the list of the available rendering extensions from the DDR configuration file. The name of this file is "datadynamics.reports.config" and it should be located in the same folder as the executable is located. You can find the "standard" configuration file in [DDR Installation folder]\Assemblies directory. As you can see each rendering extension is described by it's fully qualified type name and the display name. The latter becomes MenuName property value, the former becomes AssemblyName and TypeName properties values. Let us know if you need further assistance.
Sergey Abakumoff GrapeCity
|
|
|
|
|
Report
|
|
|
|
08-14-2009, 5:37 AM
|
Mike_B
Joined on 06-17-2009
Posts 16
|
|
|
I want to be able to export a report to a PDF pragmatically (no user interaction or button clicks) using the reportPreview.Export(??????) function (maybe I am not using the right function?). What you have explained is a start but is still not real clear on how you use the RenderingExtensionInfo. I am now trying this:
DataDynamics.Reports.Configuration.RenderingExtensionInfo extension = new DataDynamics.Reports.Configuration.RenderingExtensionInfo("DataDynamics.Reports.Rendering.Pdf","DataDynamics.Reports.Rendering.Pdf.PdfRenderingExtension","PDF");
reportPreview.Export(extension);
However, it is still not working.
Suggestion, why not just make the property an enum or something you pass to it that is the file type (Export(ExportType.PDF))? It would be much clearer this way without having to open the config file to get what the assemblies and extensions should be, which doesn’t appear to be documented. I don’t know, maybe I just am going about this completely wrong and am not understanding it?
|
|
|
|
|
Report
|
|
|
|
08-14-2009, 6:00 AM
|
Mike_B
Joined on 06-17-2009
Posts 16
|
|
|
Okay, I got it to work with this, looks like I had them switched and didnt have the entire assemblyname added.
DataDynamics.Reports.Configuration.RenderingExtensionInfo extension = new DataDynamics.Reports.Configuration.RenderingExtensionInfo("DataDynamics.Reports.Rendering.Pdf", "DataDynamics.Reports.Rendering.Pdf, Version=1.6.1296.0, Culture=neutral, PublicKeyToken=d557f2f30a260da2", "PDF");
reportPreview.Export(extension);
Still seem to me there should be a much easier way of doing this?
|
|
|
|
|
Report
|
|
|
|
03-10-2010, 4:05 PM
|
Scott
Joined on 08-28-2004
Columbus, Ohio
Posts 546

|
|
|
I noticed that the development team is working on the case to make this easier! So in an upcoming release we should see this new functionality.
|
|
|
|
|
Report
|
|
|
|
04-20-2010, 4:36 AM
|
Amit Pal
Joined on 12-11-2008
Posts 855

|
|
|
Hello,
Case 134341 (It is now possible to programmatically render a report loaded in the preview control to another format without displaying a dialog to the user) has been implemented in the latest version of Data Dynamics Reports (1.6.1871.8). You may use the Export method of the Preview control to accomplish the desired scenario.
You may download this build from here: http://www.datadynamics.com/Products/DDRPT/Releases.aspx
Amit Pal GrapeCity- DataDynamics
|
|
|
|
|
Report
|
|
|
|
|
GrapeCity » Product Support » Data Dynamics R... » Export Report
|
|
|
|
|