☰
Current Page
Main Menu
Home
Home
Editing setting-defaults-for-report-designer
Edit
Preview
H1
H2
H3
default
Set your preferred keybinding
default
vim
emacs
markdown
Set this page's format to
AsciiDoc
Creole
Markdown
MediaWiki
Org-mode
Plain Text
RDoc
Textile
Rendering unavailable for
BibTeX
Pod
reStructuredText
Help 1
Help 1
Help 1
Help 2
Help 3
Help 4
Help 5
Help 6
Help 7
Help 8
Autosaved text is available. Click the button to restore it.
Restore Text
#Setting Defaults for the Report Designer [[_TOC_]] ##Question How can I set default report designer options that are not standard with Izenda for my customers? If I want the report designer to initialize with certain datasources already selected or certain report options enabled, how would I do that? ##Answer In order to change the default report designer options, such as datasources, fields, filters, or other options, the underlying CurrentReportSet must be modified. The CurrentReportSet controls which report is currently loaded, and exists even when the report designer initializes a new ReportSet. In order to detect that the ReportSet contained within CurrentReportSet is new, simply check the ReportName property in the OnPreLoad() method of the ReportDesigner.aspx.cs file. An example of this can be seen below. ```csharp protected override void OnPreLoad(EventArgs e) { try { string name = AdHocContext.CurrentReportSet.ReportName; } catch // this is new report { //Perform any report designer behavior changes in here } } ``` ###Adding datasources You may want to start all users who navigate to the report designer with a default datasource. In order to accomplish this, insert the code template below into your code. ```csharp if(AdHocContext.CurrentReportSet.JoinedTables.Count == 0) AdHocContext.CurrentReportSet.JoinedTables.Add(new JoinedTable { TableName = "[dbo].[Orders]" }); ``` Adding multiple tables with relationships is accomplished by performing the above step, plus adding additional tables with valid join relationships. Izenda will automatically check to ensure the tables and columns exist at runtime. ###Adding fields In order to add any fields, you will need to access the underlying "Detail" report within the CurrentReportSet object and a valid datasource must be added as discussed above. ```csharp AdHocContext.CurrentReportSet.Detail.Fields.Add(new Field("[dbo].[Orders].[ShipCountry]")); ``` ###Changing default report options You may want to adjust options that apply to the style of the report, such as the Visual Group style, whether the date and time are displayed in the report header for exports, or whether pagination is turned on by default. To accomplish these and other related actions, use code that accesses the corresponding property on the CurrentReportSet object. ```csharp //Default Visual group style AdHocContext.CurrentReportSet.VisualGroupStyle = VisualGroupStyle.LineDelimited; //Show date and time on exports by default AdHocContext.CurrentReportSet.ShowDateTime = true; //Enable pagination by default AdHocContext.CurrentReportSet.UsePaginationInWebView = true; ```
Uploading file...
Header
 **This documentation is for the legacy Izenda 6 product. Documentation for the new Izenda 7 product can be found at [[https://www.izenda.com/docs/|https://www.izenda.com/docs/]]**
Sidebar
 --- * [[Izenda 7 Series Documentation|https://www.izenda.com/docs/]] * [[Release Notes]] * [[Upgrade Best Practices|FAQ/Izenda-Update-Best-Practices]] * [[FAQ]] * [[Tutorials]] * [[The Izenda API|/API/AdHocConfig]] * [[The AdHocSettings class|/API/AdHocSettings]] * [Developer Links and Guides](/Guides/Developer-Links-and-Guides) * [[Known Issues]] --- * <a href="http://www.izenda.com" rel="nofollow" target="_blank">Izenda Website</a> * [Product Video](https://www.youtube.com/watch?v=X3-yWFq0w5A) * <a href="http://www.izenda.com/blog" rel="nofollow" target="_blank">Izenda Blog</a> * <a href="http://www.izenda.com/company/" rel="nofollow" target="_blank">About Us</a> * <a href="http://www.izenda.com/contact-us/" rel="nofollow" target="_blank">Contact Us</a> --- * [Guide To Report Design](/Guides/ReportDesign) * [Making Custom Forms Video](http://www.youtube.com/watch?v=5b2axJlgdFs) --- * [[Acknowledgements]]
Edit message:
Cancel