Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all 7205 articles
Browse latest View live

How to dynamically generate a master-detail report in a WinForms application

$
0
0

This example illustrates how to create a master-detail report in code.

The following steps are essential to create a report layout:

1. Create a report instance and bind it to data.

2. Add required bands to the report.

3. Add required controls to the created bands and provide data to them.

After the report layout is complete, you can generate the report document and display it in a Print Preview.


See also
:
How to dynamically generate a report and bind it to a DataSet in a WinForms application
How to dynamically generate a report and bind it to a collection of objects in a WinForms application
How to create a report dynamically


How to dynamically generate a report and bind it to a DataSet in a WinForms application

$
0
0

This example illustrates how to create a report in code.

The following steps are essential to create a report layout:

1. Create a report instance and bind it to data.

2. Add required bands to the report.

3. Add required controls to the created bands and provide data to them.

After the report layout is complete, you can generate the report document and display it in a Print Preview.

 

See also:
How to dynamically generate a master-detail report in a WinForms application
How to dynamically generate a report and bind it to a collection of objects in a WinForms application
How to create a report dynamically

Question Comments

Added By: Daniel Kaminski at: 7/7/2015 8:52:01 AM    

Please update this project to .NET 4.0. It will not compile in .NET 3.5

Added By: Jannet (DevExpress Support) at: 7/8/2015 3:38:29 AM    Hello Daniel,
Thanks for pointing this out. I have updated the example solution for the 13.1.4 — 15.2.2 builds. Feel free to let me know if I can be of further help.

How to dynamically generate a report and bind it to a collection of objects in a WinForms application

$
0
0

This example illustrates how to create a report in code.

The following steps are essential to create a report layout:

1. Create a report instance and bind it to data.

2. Add required bands to the report.

3. Add required controls to the created bands and provide data to them.

After the report layout is complete, you can generate the report document and display it in a Print Preview.

See also:
How to dynamically generate a master-detail report in a WinForms application
How to dynamically generate a report and bind it to a DataSet in a WinForms application
How to create a report dynamically

How to dynamically generate a report in an ASP.NET Web Forms application (with a SQL query as a data source)

$
0
0

Description:
 I need to implement a generic kind of web report viewer to display the result of my SQL query, which accepts some parameters.

Solution:
 This can be done by creating an XRTable control dynamically.

To pass a table name (which is a query parameter), you can use a query string variable. As a result, you can pass the "TableName" parameter as follows:
http://hostname/PassSQLQuery/ReportViewer.aspx?TableName=Customers.

Then, the XtraReport code-behind methods will populate data using the SQL query, which returns all the table rows from the table.
In the final step, an XRTable control is created, and gets bound to the column names of the data table.

Question Comments

Added By: Krishna Raj 1 at: 8/27/2015 12:06:02 AM    

I have tried the below sample to my current project using dataset as the binding source but got the blank report at the end.

Added By: Vasily (DevExpress Support) at: 8/27/2015 1:56:13 AM    

Hello Krishna,

To process your recent post more efficiently, I created a separate ticket on your behalf: T282890: How to dynamically create a report in an ASP.NET Web Forms application. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: Basil Kadara at: 11/4/2015 9:52:24 PM    

Hi ,

i want to deign the report and bind only the values at run time , because it is difficult to align the controls during run time.

is there a way to place the controls during design time and just bind the values at run time in asp.net web application.

Added By: Jannet (DevExpress Support) at: 11/4/2015 11:21:43 PM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T308234: How to place the controls during design time and just bind the values at run time in asp.net web application. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

How to dynamically generate a report in an ASP.NET MVC application

$
0
0

This example illustrates how to create a report in code in an ASP.NET MVC application.

The following steps are essential to create a report layout:

1. Create a report instance and bind it to data.

2. Add required bands to the report.

3. Add required controls to the created bands and provide data to them.

After the report layout is complete, you can generate the report document and display it in a Print Preview.


See also:
How to use XtraReports in an ASP.NET MVC application
How to link the Document Viewer with an external Ribbon control

Question Comments

Added By: vkr at: 11/14/2013 7:37:25 AM    

Where are we assigning the report with data here ? I see creating a report and returning it only!!

Added By: saeed dalvand at: 12/4/2015 8:11:31 AM    

that not work for me in asp.net mvc
i can use xtrareport in devexpress Application mvc but no in mvc Asp.net application

Added By: Vasily (DevExpress Support) at: 12/4/2015 10:31:47 AM    

Hello Saeed,

To process your recent post more efficiently, I created a separate ticket on your behalf: T320953: XtraReport is not working in ASP.NET MVC Application. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Export ASPxPivotGrid with additional text captions in header or footer

$
0
0

This example illustrates how to export the ASPxPivotGrid with additional text captions in a header area to the same print document. It is also possible to add a report footer below the pivot grid in the same way.

See Also:
T355654: Data Aware Export - How to add custom header and footer to an exported Excel document

Question Comments

Added By: Brian Banaszynski at: 6/4/2012 1:43:37 PM    

When we add a header/footer in this fashion, their is an extra page getting added in the end. Is there anyway to avoid that? Also when the document is opened its prompting us to save which is unwarranted. Can that be avoided as well?

Let me know.

Added By: softboy99 at: 10/25/2012 4:48:55 AM    

If we want to CreatePageForEachLink function, how can we add the text captions?

Added By: Daniel Kaminski at: 4/2/2013 7:56:02 AM    

Run Online link seems to be broken.... could this be fix?

Added By: Daniel Kaminski at: 4/2/2013 8:08:30 AM    

Is there a way to add header and footers when using ExportPdfToResponse or ExportCsvToResponse

Added By: Daniel Kaminski at: 10/21/2013 3:00:42 PM    

Is it possible to do this or something similar using the WinForms pivotgrid? I would like to add some headererr notes when the pivot grid is exported to excel

Added By: Alex (DevExpress Support) at: 10/14/2015 12:18:21 PM    Hi Daniel,

We apologize for missing your comments in this thread.
A note for everybody looking for a solution related to the PIvotGridControl (WinForms): it is possible to use the approach shown in the How to print a grid with an additional header and footer? example to add custom header/footer information when printing the PivotGridControl data.

How to create drill-down reports in a web application

$
0
0

This example illustrates how to implement the drill-down feature for XtraReports in a web application. This feature allows end-users to be able to collapse/expand some of the detail report bands in master-detail reports.

Starting with the 15.1 version, XtraReports supports automatic drill-down, so writing any code is no longer required to accomplish this task.

How to create a drill-down report

$
0
0

This example demonstrates how to create a drill-down report. In this example, a master-detail report is created, in which the detail section for each category can be expanded or collapsed within the same preview window by clicking the appropriate link.

Starting with the 15.1 version, XtraReports supports automatic drill-down, so writing any code is no longer required to accomplish this task.


How to dynamically send a report via e-mail as a PDF

$
0
0

Thшы example illustrates how to automatically send a report via e-mail. To do this, a report should first be exported into one of the available formats. In this example, a report is exported to PDF, since this format provides the best output quality (the PDF result is as close to a report's print result as possible).

See also:
How to send a report as HTML in an email body

Question Comments

Added By: MohammedFarooq at: 10/20/2015 1:11:44 PM    

Hi,
I am getting the following error when the button is clicked. For your information, i am executing this logic in XAF viewcontroller SimpleAction button execute event

Error sending a report.
System.Exception: Null object cannot be converted to a value type. ---> System.Exception: Null object cannot be converted to a value type. ---> System.InvalidCastException: Null object cannot be converted to a value type.
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType)
at DevExpress.XtraReports.UI.XRSubreport.ApplyParameterBindings()
at DevExpress.XtraReports.UI.XRSubreport.OnBeforePrint(PrintEventArgs e)
at DevExpress.XtraReports.UI.XRControl.GetPrintableBrick(XRWriteInfo writeInfo)
at DevExpress.XtraReports.UI.XRControl.WriteContentTo(XRWriteInfo writeInfo)
at DevExpress.XtraReports.UI.Band.GenerateContent(DocumentBand docBand, Int32 rowIndex, Boolean fireBeforePrint)
at DevExpress.XtraReports.UI.Band.GenerateContentAndDecompose(DocumentBand docBand, Int32 rowIndex, Boolean fireBeforePrint)
at DevExpress.XtraReports.UI.Band.CreateDocumentBand(Int32 rowIndex, RootDocumentBand rootDocBand, PageBuildInfo pageBuildInfo)
at DevExpress.XtraReports.UI.DetailBand.CreateDocumentBand(Int32 rowIndex, Int32 rowCount, RootDocumentBand rootDocBand, PageBuildInfo pageBuildInfo)
at DevExpress.XtraReports.Native.Printing.DetailWriterBase.WriteDetailCore(PageBuildInfo pageBuildInfo)
at DevExpress.XtraReports.Native.Printing.DetailWriterBase.Write(DocumentBand rootBand, PageBuildInfo pageBuildInfo)
at DevExpress.XtraReports.Native.Printing.DocumentBuilder.GetBand(DocumentBand rootBand, PageBuildInfo pageBuildInfo)
at DevExpress.XtraPrinting.Native.DocumentBand.GetBand(PageBuildInfo pageBuildInfo)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.CanProcessDetail(DocumentBand rootBand, PageBuildInfo pageBuildInfo)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBands(DocumentBand rootBand, RectangleF bounds, ProcessBandsDelegate process)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillReportDetails(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.FillReportDetailsAndFooter(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPage(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageRecursive(DocumentBand rootBand, DocumentBand docBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.FillPageRecursive(DocumentBand rootBand, DocumentBand docBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBandCore(DocumentBand rootBand, RectangleF bounds, RectangleF newBounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBand(DocumentBand rootBand, RectangleF bounds, RectangleF newBounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBands(DocumentBand rootBand, RectangleF bounds, ProcessBandsDelegate process)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillReportDetails(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.FillReportDetailsAndFooter(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPage(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageRecursive(DocumentBand rootBand, DocumentBand docBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.FillPageRecursive(DocumentBand rootBand, DocumentBand docBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBandCore(DocumentBand rootBand, RectangleF bounds, RectangleF newBounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBand(DocumentBand rootBand, RectangleF bounds, RectangleF newBounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBands(DocumentBand rootBand, RectangleF bounds, ProcessBandsDelegate process)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillReportDetails(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.FillReportDetailsAndFooter(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPage(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageRecursive(DocumentBand rootBand, DocumentBand docBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.FillPageRecursive(DocumentBand rootBand, DocumentBand docBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBandCore(DocumentBand rootBand, RectangleF bounds, RectangleF newBounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBand(DocumentBand rootBand, RectangleF bounds, RectangleF newBounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBands(DocumentBand rootBand, RectangleF bounds, ProcessBandsDelegate process)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillReportDetails(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.FillReportDetailsAndFooter(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPage(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageRecursive(DocumentBand rootBand, DocumentBand docBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.FillPageRecursive(DocumentBand rootBand, DocumentBand docBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBandCore(DocumentBand rootBand, RectangleF bounds, RectangleF newBounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBand(DocumentBand rootBand, RectangleF bounds, RectangleF newBounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPageForBands(DocumentBand rootBand, RectangleF bounds, ProcessBandsDelegate process)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillReportDetails(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageHeaderFooterRowBuilderBase.FillReportDetailsAndFooter(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageRowBuilderBase.FillPage(DocumentBand rootBand, RectangleF bounds)
at DevExpress.XtraPrinting.Native.PageBuildEngine.Build()
at DevExpress.XtraPrinting.Native.PageBuildEngine.BuildPages(DocumentBand rootBand, Boolean clearGroupingInfo)
--- End of inner exception stack trace ---
at DevExpress.XtraPrinting.PrintingSystemBase.OnCreateDocumentException(ExceptionEventArgs args)
at DevExpress.XtraPrinting.Native.PageBuildEngine.RaiseCreateDocumentException(Exception exception)
at DevExpress.XtraPrinting.Native.PageBuildEngine.BuildPages(DocumentBand rootBand, Boolean clearGroupingInfo)
at DevExpress.XtraPrinting.Native.DocumentHelper.BuildPagesCore()
at DevExpress.XtraPrinting.Native.DocumentHelper.BuildPages()
at DevExpress.XtraPrinting.Native.PrintingDocument.BuildPages()
at DevExpress.XtraPrinting.Native.PrintingDocument.End(Boolean buildPagesInBackground)
at DevExpress.XtraPrinting.PrintingSystemBase.End(Boolean buildPagesInBackground)
at DevExpress.XtraReports.UI.XtraReport.CreateDocumentCore(PrintingSystemBase ps, Single progressRange, Boolean buildPagesInBackground)
at DevExpress.XtraReports.UI.XtraReport.CreateDocument(Single progressRange, Boolean buildPagesInBackground, Boolean suppressClearDataContext)
at DevExpress.XtraReports.UI.XtraReport.TryCreateDocument(Single progressRange, Boolean buildPagesInBackground, Boolean suppressClearDataContext)
--- End of inner exception stack trace ---
at DevExpress.XtraPrinting.PrintingSystemBase.OnCreateDocumentException(ExceptionEventArgs args)
at DevExpress.XtraReports.UI.XtraReport.TryCreateDocument(Single progressRange, Boolean buildPagesInBackground, Boolean suppressClearDataContext)
at DevExpress.XtraReports.UI.XtraReport.CreateIfEmpty(Single progressRange, Boolean buildPagesInBackground)
at DevExpress.XtraReports.UI.XtraReport.ExportToPdf(Stream stream, PdfExportOptions options)
at DevExpress.XtraReports.UI.XtraReport.ExportToPdf(Stream stream)
at Solution6.Module.vcPayroll.SimpleAction1_Execute(Object sender, SimpleActionExecuteEventArgs e) in E:\My Docs\Projects\Solution6\Code\Solution6.Module\BusinessObjects\10 Payroll\Payroll Run\vcPayroll.vb:line 179

Added By: MohammedFarooq at: 10/20/2015 1:12:27 PM    

The error happens at this line

report.ExportToPdf(mem)

Added By: Ingvar (DevExpress Support) at: 10/21/2015 1:28:10 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T302655: NullReferenceException when trying to apply solution described in E16. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Building a mail application with the RichEditControl

$
0
0

This example illustrates how the built-in document export functionality of the XtraRichEdit can be used to construct a simple application allowing you to send the document via email. A document, loaded into the RichEditControl, is sent in HTML email format.

To accomplish the task, we have to transform the document into the HTML formatted stream. Inline pictures will form a collection of linked resources (System.Net.Mail.LinkedResourceCollection ) for the email attachment. Common methods of the System.Net.Mail.MailMessage class are used to create a message. The message is sent with the help of the System.Net.Mail.SmtpClient class instance.

Let's elaborate a document export process further. To gain a control over RichEdit export, we construct a RichEditMailMessageExporter class, which implements the IUriProvider interface. This interface contains two methods - CreateCssUri and CreateImageUri. We use default CSS handling, so the CreateCssUri method always returns null. The CreateImageUri method is used to transform each document image into an object of the helper class - the AttachmentInfo class instance. An instance of this class contains an image's name, type and the data stream. An image is identified by its name, so this method returns a CID (Content-ID) URL containing the image name, to include a link to the image in the message body.
The CreateHtmlView method of the RichEditMailMessageExporter gets the content of the RichEdit document using the GetHtmlText method, handles the BeforeExport event to specify encoding and creates the System.Net.Mail.AlternateView object required for HTML email format. Note that the document's HTML code contains CID URIs constructed using the CreateImageUri method in place of images. Then a collection of AttachmentInfo objects, representing document images, is used to fill a collection of embedded resources for the message.
The Export method of the RichEditMailMessageExporter class calls the CreateHtmlView method to accomplish the major task, and adjusts the message parameters as required.
Now, when the main functionality is incorporated into the RichEditMailMessageExporter class, the code for creating and sending the message looks simple and straightforward. Create a message, fill in 'from' and 'to' fields, create an exporter and call its 'Export' method, create an smtp client instance, specify the E-mail account settings and call the 'Send' method to send a message.

Question Comments

Added By: Darrin Lynn at: 11/1/2012 9:28:49 AM    

Very useful sample and works well with Outlook. However when sent to my iPhone with an image in the body it is not rendered correctly. Do you have any experience of this?

Added By: Panayiotis Anastasiou at: 12/13/2012 1:23:42 AM    

Dear sirs i have also faced that problem and tried it.
It works but when sent to android device i have problems rendering images.
Any solutions for that?

Added By: George H. at: 9/16/2013 7:00:11 AM    

I need to do this same thing too but I am using Exchange Web Services to send the email. In this example MailMessage is being used but I am using the object EmailMessage from Microsoft.Exchange.Webservices. Can this be done with the object EmailMessage?

Added By: Brendon Muck [DevExpress MVP] at: 3/11/2016 7:17:40 AM    There are several documentation links in this ticket that no longer resolve correctly to their respective documentation topics:

IUriProvider
CreateCssUri
CreateImageUri.
GetHtmlText


How to print DetailBand multiple times regardless of the number of records in a report data source

$
0
0

Sometimes, it is necessary to print a detail section a particular number of times even if the underlying DataSource contains a less number of records. The current version of XtraReports does not allow one to print this section more times than the number of records.

As a solution for this task, you can clear the report's DataSource and DataMember properties, set the DetailPrintCountOnEmptyDataSource property to the necessary number, and then populate the detail section data manually using the DetailBand's BeforePrint event.

This example demonstrates this approach in action.

See also:
How to repeat the Detail report band multiple times (a data-bound report)

How to integrate the Web Report Designer into a web application

$
0
0

This example demonstrates how you can integrate the Web Report Designer into your web application. The application contains a simple report catalog, allowing you to add, delete, and edit reports whose layout data is stored in a custom data storage (i.e., an MDB database).

 Additionally, this example demonstrates how you can add custom commands to the report designer menu at runtime to provide better integration with your application. In the example, the custom Close menu command is introduced, which redirects you to the catalog page.

 
See also:
T190370: How to integrate the Web Report Designer into an MVC web application
T227679: ASPxReportDesigner - How to create an ASP.NET End-User reporting application with the filesystem report storage managed by the ASPxFileManager control

Question Comments

Added By: Baykov Roman at: 7/10/2015 6:41:00 AM    

Can't understand. Where u take report.save()? what is report and what is method save()? Is any reference of JS objects and methods?

Added By: Vasily (DevExpress Support) at: 7/10/2015 7:54:31 AM    Hello Ruslan ,

To process your recent post more efficiently, I created a separate ticket on your behalf: T265741: How to integrate the Web Report Designer into a web application. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.Added By: Subhash Makkena at: 10/22/2015 8:38:15 AM    

Is there a way i can implement a custom drag and drop to canvas tool in the left hand side?
My requirement is, instead of drag and drop Chart into canvas, i want to provide 4 types of chart icons in the toolbox. And be able to drag and drop each kind of chart individually.

Added By: Jannet (DevExpress Support) at: 10/22/2015 8:53:30 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T303410: Web Report Designer - Is there a way i can implement a custom drag and drop to canvas tool in the left hand side. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

Added By: gopi matsa at: 3/11/2016 9:07:30 PM    I am Not Able to Find the Definition for the 
SimpleWebReportCatalog.CatalogDataTableAdapters;

Please Provide me the Information Regarding this
Added By: gopi matsa at: 3/11/2016 9:09:49 PM    Otherwise Please Provide me the Code For this.

WinForms End-User Designer - How to implement a Control Template Gallery to provide the capability to create reusable control sets

$
0
0
This example demonstrates how to add the capability to save selected controls and reuse them in this or other reports like UserControls in standard Windows Forms application.

Implementation Details:
In the scope of this example, we add a custom End-User Designer DockPanel and fill it from the predefined storage (if this storage is not empty), which can be passed to the constructor or Storage property of a custom ReportDesignTool descendant. The storage should implement the IControlTemplateStorage interface, which declares the following members:

- GetCategoryNames. This method should return string representations of all template categories in your storage.
- GetTemplateNamesForCategory. This method returns template names for the specified category.
- GetData. This method returns a byte array containing stored controls.
- SetData. This method allows you to save a byte array representing saved controls.
- DeleteTemplate. Use this method to delete the specified template from your storage.
- DeleteCategory. Use this method to delete the specified category and inner templates.

In this Code example, you can find two sample implementations of this interface. The first one (ControlTemplateStorage) demonstrates how to create an in-memory storage, and the second one uses a DataSet instance for storing templates.

UI for Template Gallery:
As stated above, we added a custom Dock Panel that has two buttons (Add and Delete) for operating with templates and a TreeList instance that displays existing categories and templates. To create a new template, select the required controls in your report and click the Add button. You will see a new dialog requesting the Category and Template name.

To create controls from a template, select the required template in the TreeList and drag-and-drop it to a report design surface at the required location.

To delete a template or category, select it in the TreeList and click the Delete button.

WinForms End-User Designer - How to override commands (implement custom saving)

$
0
0

This example demonstrates how to override and customize saving in the End-User Designer. This can be useful, for example, if all the reports in a project should be stored in a database, and are retrieved from the database via a stream, and all of this should be done automatically, without forcing an end-user to do anything but click the Save (or Save As) toolbar button.

For a more complex approach on saving reports in an End-User Designer, see Report Storage for the End-User Report Designer.

In this example, a report will also be automatically saved using the custom saving procedure when an end-user closes the Report Designer.

To implement this task, handle the ReportCommand.SaveFile and ReportCommand.SaveFileAs commands. Note that to prevent the standard saving procedure from being called, you just need to enable the handled property.

Question Comments

Added By: Gerard D'Rozario at: 1/31/2014 1:52:51 PM    

Why is this project only compatible with VS 2012+ ?

Added By: Jairo Marques at: 1/7/2016 5:21:21 PM    

Is there a sample project to do the same thing using ASP.Net? I would like to change some behavior for commands and hide others.

Added By: Vasily (DevExpress Support) at: 1/8/2016 2:30:06 AM    

Hello Jairo,

To process your recent post more efficiently, I created a separate ticket on your behalf: T331919: Web Report Designer - How to override/hide commands. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

WinForms End-User Designer - How to customize a Subreport once it has been created by double-clicking the XRSubreport control

$
0
0
This example illustrates how to invoke a Sub-Report designer once an end-user double-clicks the XRSubreport component on the design surface (in the End-User Designer).

Override the OpenSubreport designer command to accomplish this task. Use the following approach: How to: Override Commands in the End-User Designer.

WinForms End-User Designer - How to programmatically invoke the smart tag once an XRControl is added to a report

$
0
0
This example illustrates how to immediately invoke a control's smart tag once it is placed onto the XtraReport design surface (in the End-User Designer). The main idea is to handle the XRDesignPanel.ComponentAdded event and call the postponed XRSmartTagService.ShowPopup method in the event handler.

See also:
End-User Designer - How to customize the control's Smart Tag menu

WinForms End-User Designer - How to customize the Smart Tag menu of a control

$
0
0

This example demonstrates how to customize the XRLabel's Smart Tag menu to make the following properties available: TextData Binding (the Text property)WidthFHeightFLocationF.XLocationF.Y.
To achieve this, we do the following:
1. Implement a DevExpress.XtraReports.Design.XRControlDesigner descendant and override XRControlDesigner.RegisterActionLists to provide a custom action list.
2. Create a custom report control by subclassing a required control (Creating Custom Controls) and register the custom control on the toolbox by using the design-time IToolboxService service. 
For more information on adding custom controls to the Toolbox and removing standard ones from it, check the following articles:
How to: Register a Custom Control in the End-User Designer's Toolbox.
How to: Make a Custom Control be Available Only for a Specific Report Instance 
3. Link this designer to the custom XRControl by using the XRDesigner attribute. 

See also:
How to create custom report controls
How to programatically invoke the smart tag once an XRControl is added to report in the WinForms End-User Designer

WinForms End-User Designer - How to hide a property in the Properties window

$
0
0
This example demonstrates how to hide connection (ConnectionName and ConnectionParameter) properties of the SqlDataSource component set as a a report's data source.

You can customize the Properties window for the report's End-User Designer, so only required properties are displayed.
The How to: Hide Properties from End-Users in the Report Designer example illustrates how to implement this. The idea is to handle the static XtraReport.FilterComponentProperties event and hide (or remove) an unnecessary property from the entire control's properties collection.
Please note that this approach is applicable for a report, its bands and XRControls (XRControl class descendants).

If you want to hide properties for a non-XRControl descendant, for instance, for the report's data source, we recommend the following. 
In the XRDesignMdiController.DesignPanelLoaded event handler, substitute the default ITypeDescriptorFilterService object with your custom one. In this custom ITypeDescriptorFilterService class, override the FilterProperties method to remove unnecessary properties.

See also:
Customize an End-User Report Designer


WPF: WPF Report Designer - How to hide a property in the Properties window

WinForms End-User Designer - How to create a custom script editor

$
0
0
This example demonstrates how  to create a custom script editor in the End-User Designer.

WinForms End-User Designer - How to hide toolbar buttons in the Preview tab

$
0
0

This example demonstrates how to hide printing system commands when an end-user opens the Preview tab on the End-User Designer with the Ribbon interface.

Viewing all 7205 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>