I can do this in code through various formatting objects, but wondered (and expect) there is an easier way of achieving what I require and wondered if you could point me in the right direction.
I'm trying to find the most flexible (and painless) way of producing a report according to end-user specifications. We have many companies which use our software and they all require different design schema's/templates for their reports. For example - for a single report, depending on who logs on (we know what company they belong to) at runtime, apply the template the report should use.
As an example, some of the requirements (per end-user/company) include:
their own logo (positioned in the correct place),
Margins being of specific size
their own fonts (or font choice)
alternating colours schemes
Specific rows / columns being particular colours (both permanently and based on value)
Formatting of values, for example a european user would get euro, a uk user gets pounds on certain columns/cells/rows.
I understand you have an End-User Report Designer so end users can design reports, however this isn't what we require - I must create the schema/template design for a report then apply it at runtime.
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hi Dan,
You can create different reports and save it to the repx format via the XtraReport.SaveLayout method and use these repx files as template. Hope this helps.
Thanks,
Elliot
Thanks for the quick reply, that sounds like what I require. Can you point me in the direction of any articles/how-to's/examples on this.
I've found the link below, but are there any example projects or more detailed explainations?
http://documentation.devexpress.com/#XtraReports/DevExpressXtraReportsUIXtraReport_SaveLayouttopic142
I can't make this non-active, but I think I have found what I require: http://documentation.devexpress.com/#XtraReports/CustomDocument2592
Thanks for your help.
Hi Dan,
I am glad to hear that this approach solves your issue. Please contact us in case of any difficulty.
Thanks,
Elliot
Looking into this, it isn't really quite what I need - what I would like to do is set up a report, then specify values to apply to the design at runtime, e.g. margin is 10mm,
rather than create many report designs. Is there an alternative way to achieve this?
… so for example, if a report changed, I wouldn't have to go through each repx 'version' and make the change multiple times.
Hi Dan,
Thank you for your feedback.
Unfortunately, there is no general approach to accomplish this task.
Styles in the XtraReport can be saved into separate files (*.repss) and you can have a separate styles pack for each of your customers.
Please review the "Odd/Even demo in the XtraReport demos".This demo illustrates how it can be done.
I suggest that you create a separate table in your database in which to store the margins (and other required information) for each of your customers. Then, when instancing a new report, adjust the margins according to logged customer.
XtraReport uses thread's culture to format currency (DateTime) fields. So, you can override the Page.InitializeCulture method to create the report in the culture you need (Please see thelocalize date thread).
I suggest that you store the Logo in the database (#2). In XtraReport create a public Parameter and bind it to the XRPictureBox control. At runtime, when instancing new report, simply set it.
To represent Customer Specific Formatting, I suggest that you use FormattingRules: Create a parameter in XtraReport with "CustomerID" and use it in the Rules.(See #4).
Thanks,
Andrew
Thanks. Have you considered having some layout abstraction object? Just so that if anything in the future changed regarding layout of a report, you could guarantee nothing would break. (if there was a possibility that a report property may change in the future)