Mlmebook
Mlmebook
Table of Contents
Part I Introduction 1
1 Technical
...................................................................................................................................
Support 2
2 Trial License
...................................................................................................................................
Limitations 3
3 Information
...................................................................................................................................
in Web and References 3
Part II Data 4
1 Business
...................................................................................................................................
Objects in Net, Web, Silverlight 4
2 Business
...................................................................................................................................
Objects in WinRT 12
3 Working
...................................................................................................................................
with OData Using Business Objects 14
© 2003-2015 Stimulsoft
I
II Stimulsoft Reports
© 2003-2015 Stimulsoft
Contents III
9 Using...................................................................................................................................
Parameters 85
10 Bookmarks
................................................................................................................................... 88
11 Dynamic
...................................................................................................................................
sorting and drill down reports 90
12 Send ...................................................................................................................................
Email 94
13 Helpful
...................................................................................................................................
Methods 97
14 Viewer
...................................................................................................................................
Settings 99
Actions .......................................................................................................................................................... 101
Server .......................................................................................................................................................... 102
Appearance.......................................................................................................................................................... 103
Toolbar .......................................................................................................................................................... 104
.......................................................................................................................................................... 106
Exporting Reports
.......................................................................................................................................................... 109
Sending Email
© 2003-2015 Stimulsoft
III
IV Stimulsoft Reports
2 Dialog
...................................................................................................................................
Options 142
3 User...................................................................................................................................
Interface Settings 142
© 2003-2015 Stimulsoft
Contents V
© 2003-2015 Stimulsoft
V
VI Stimulsoft Reports
© 2003-2015 Stimulsoft
Contents VII
......................................................................................................................................................... 266
Digital Signature
Digital Signature .........................................................................................................................................
from Code 266
Encryption ......................................................................................................................................................... 266
Using Parameters .........................................................................................................................................
of Encryption from Code 267
......................................................................................................................................................... 268
Editable Fields
......................................................................................................................................................... 268
Export Settings
......................................................................................................................................................... 269
Static Options
XPS .......................................................................................................................................................... 270
......................................................................................................................................................... 271
Export Settings
......................................................................................................................................................... 271
Static Options
..........................................................................................................................................................
Microsoft Pow er Point 2007/2010 271
......................................................................................................................................................... 272
Export Settings
......................................................................................................................................................... 272
Static Options
4 Web...................................................................................................................................
Documents 272
HTML .......................................................................................................................................................... 272
......................................................................................................................................................... 273
Export Settings
......................................................................................................................................................... 273
Static Options
MHT .......................................................................................................................................................... 274
.........................................................................................................................................................
Export Settings 274
5 Text...................................................................................................................................
Formats 275
TXT .......................................................................................................................................................... 275
......................................................................................................................................................... 275
Export Settings
......................................................................................................................................................... 276
Static Options
RTF .......................................................................................................................................................... 276
......................................................................................................................................................... 277
Export Settings
......................................................................................................................................................... 277
Static Options
.......................................................................................................................................................... 278
Word 2007/2010
......................................................................................................................................................... 278
Export Settings
......................................................................................................................................................... 278
Static Options
ODT .......................................................................................................................................................... 279
......................................................................................................................................................... 279
Export Settings
......................................................................................................................................................... 280
Static Options
6 Spreadsheets
................................................................................................................................... 280
Excel .......................................................................................................................................................... 280
......................................................................................................................................................... 281
Export Settings
......................................................................................................................................................... 281
Static Options
.......................................................................................................................................................... 282
Excel 2007/2010
......................................................................................................................................................... 282
Export Settings
......................................................................................................................................................... 282
Static Options
ODS .......................................................................................................................................................... 283
......................................................................................................................................................... 283
Export Settings
......................................................................................................................................................... 284
Static Options
7 Data................................................................................................................................... 284
CSV .......................................................................................................................................................... 284
......................................................................................................................................................... 284
Export Settings
......................................................................................................................................................... 285
Static Options
DBF .......................................................................................................................................................... 285
.........................................................................................................................................................
Controlling Exports 285
......................................................................................................................................................... 286
Export Settings
XML .......................................................................................................................................................... 287
.........................................................................................................................................................
Controlling Exports 287
DIF .......................................................................................................................................................... 288
......................................................................................................................................................... 288
Export Settings
© 2003-2015 Stimulsoft
VII
VIII Stimulsoft Reports
© 2003-2015 Stimulsoft
Contents IX
24 Deployment
...................................................................................................................................
in Designer.Web 318
25 Deployment
...................................................................................................................................
Reports as Files 318
26 Reports
...................................................................................................................................
as Source Code 319
27 Reports
...................................................................................................................................
as Assemblies 321
28 Standalone
...................................................................................................................................
Reports 322
Index 0
© 2003-2015 Stimulsoft
IX
1 Stimulsoft Reports
1 Introduction
We are glad to welcome you to the online version of the documentation of Stimulsoft Reports
products. The documentation describes the basics of using the API of our software. Here we will review
how to pass data from code in a report, export reports to various file formats, inherit reports, work
with the components and more:
© 2003-2015 Stimulsoft
Introduction 2
The first part of the documentation contains the description of work with visual parts of Stimulsoft
products.
Registered users and users who are evaluating the software may get technical support.
For technical questions, use the Email address: [email protected]
For licensing, subscription, payment questions, use Email address: [email protected]
For other questions, use Email address: [email protected]
If you have problems with our products, you may contact us through our feedback form at http://
www.stimulsoft.com/support.aspx
It is possible to send questions from the standard UI of the report designer. To do this, select the Help
menu -> Support.
If you are a registered user and you contact us for technical support, use the same Email address you
used when you purchased our product. Otherwise, it will be difficult to identify you as a registered user.
This can slow down our response. Please let us know when your Email address changes.
© 2003-2015 Stimulsoft
3 Stimulsoft Reports
- Your operating system (98, ME, 2000, XP, Vista, Window 7 etc.), its version, and the localization of
established service packs;
- Version of Microsoft .NET Framework or other development environment and installed service packs;
- A name of your development environment and its version;
- Additional information that can help us solve the problem.
Trial Versions
The free trial versions of Stimulsoft Reports are fully functional and will work for an unlimited time.
The only limitation is a DEMO watermark displayed on each report page.
Registered Versions
Developer licenses come with DLL's, which work without license keys. If you have a License for Stimulsoft
products, you only need to ensure that you are using the Registered build. If your reports are
displaying a DEMO watermark, this means that you are using a trial version of the product. Log in to
your account at http://stimulsoft.com/RegisteredUsers.aspx and download the Registered version of
the product. Also, please read the following topics:
1. How to upgrade to a new version?
2. How to upgrade to the prerelease build?
3. I have installed new version but nothing changed. What can I do?
4. How to install registered non Demo version of Stimulsoft Reports?
This topic describes how to get the information about the latest news and announcements about the
software products, as well as information about known problems and issues that users are interested.
The official site of our company can be found at http://www.stimulsoft.com The website has a brief
information of the software products http://www.stimulsoft.com/Products.aspx they can be downloaded
at http://www.stimulsoft.com/Downloads.aspx where you can download a trial version of the software,
as well as weekly minor prerelease builds and various database adapters.
Live demos for testing the products online can be found at:
Stimulsoft Reports.Net http://web.stimulsoft.com
Stimulsoft Reports.Web http://webfx.stimulsoft.com (Flash).
Stimulsoft Reports.Web http://web.stimulsoft.com (Ajax).
Stimulsoft Reports.Silverlight http://websl.stimulsoft.com (Client/Server).
Stimulsoft Reports.Silverlight http://sl.stimulsoft.com (Silverlight).
You may read an information on weekly prerelease builds and major versions on the Forum at the
following link http://forum.stimulsoft.com/Default.aspx?g=forum&c=2 The status of such topics is
© 2003-2015 Stimulsoft
Introduction 4
marked as Announcement and is always shown above all forum topics. Also on the forum, you may
read and discuss various subjects regarding reporting tools.
Short messages on the latest news of our company can be read on Twitter http://twitter.com/Stimulsoft,
Facebook http://www.facebook.com/pages/Stimulsoft/166319983418027 and RSS http://
www.stimulsoft.com/rss/stimulsoft_rss_en.xml
You may subscribe to the newsletters on the Home page of our website.
For getting more information about the product in other online resources, please use the search
engines.
2 Data
Business Object is a data type, which is a set of objects related to each other, using what it is possible
to present data in various structures: tables, lists, arrays, etc. These data can be passed to a reporting
tool based on them the report can be rendered. Business Objects are created, registered and passed
to the report generator from code.
© 2003-2015 Stimulsoft
5 Stimulsoft Reports
Now, you should populate the business object. Below is an example of code to populate a Business
Object is with data:
obj.list[0] = c1;
obj.list[1] = c2;
After that, the business object is created, filled with data, registered and passed to the reporting tool.
In order to create a report in the designer using business objects, you should create a data description
in the report dictionary. To do this, select MyObject (created Business Object) in the report dictionary
in and choose New Business Object... from the context menu or the menu New Item. After selecting
this command, the window will open a New Business Object, in which you should specify the Child
Business Object and select lists of data. The picture below shows the dialog New Business Object.
© 2003-2015 Stimulsoft
Data 6
After you click Ok, you will be shown the second dialog box form of the New Business Object, where
you can change the detail business object. The picture below shows the second dialog box form of the
New Business Object.
© 2003-2015 Stimulsoft
7 Stimulsoft Reports
The field Category displays the category name. When you create a business object the field is not
editable and is purely informative. Also, it may be empty, as in this case.
The field Name is used to specify the name of the business object. This field is always available for
editing, and, in this case, the name List is used.
The field Alias specifies an alias of the business object. This field is always available for editing, and,
in this case, the name List is used.
The button New Column. Pressing it a new data column will be created in the business object. It
should be noted that the data column created this way is a virtual data column and it does not contain
actual data.
The button New Calculated Column is used to insert a new calculated column into the business
object.
The button Delete is used to delete selected data columns. If you select a bookmark Columns, then
all the columns which are in the tab will be deleted.
The button Retrieve Columns is used to get the data column from the business object.
The button Get Columns from Assembly will open the dialog Open Assembly, in which you may
choose an assembly file. After selecting the file, press the button Open and, from this file, data columns
will be extracted, if they are present there.
The panel Columns consists of three fields. In these fields show a list of columns, their properties,
and a description of these properties.
Press the Ok button once the fields are filled and parameters are specified. After that, in the data
dictionary of the report a description of a new business object will be created, which can be used to
create reports. The picture below shows a report built using a business object:
© 2003-2015 Stimulsoft
Data 8
Provide the data to business objects from the data source in .NET
Created business objects that are registered and passed to the report generator, but do not contain
the actual data are called a description of business objects. Using the description of the business
object, you can create a report template (define the structure and design the report), and then, before
building, connect the real data and render a report. This is useful if you want to create reports with the
same structure and design, but with different data. Create a structural description of the business
object first. Below is a sample code to create a business object class:
© 2003-2015 Stimulsoft
9 Stimulsoft Reports
get
{
return list;
}
}
}
You then need to create a new business object class, register and pass it to the report generator.
Below is a sample code to create and register a new business object:
Now with help of the created description of the business object, create a report template in the
designer. The picture below shows a report template created with the description of the business
object:
Once a report template is created, you can save it, for example, to the following path D:\\Report.mrt.
Because the description of the business object does not contain the actual data, in order to render a
report, you will get the real data to business objects, in our example we take the data from the
database Northwind. For a start, create a connection to the database in Visual Studio. After that, put
the code to obtain data for the business object. Getting real data for the business object occurs
immediately before the report. Here is the code to obtain data for the business object:
int busobjLevel = 1;
© 2003-2015 Stimulsoft
Data 10
from c in context.Categories
select new { c.CategoryID, c.CategoryName, c.Description };
report.RegBusinessObject("Categories", categories);
report.Show();
}
After that, the report generator will receive the data for the business object from the specified source,
in this case from the database Northwind. Then, the report will be rendered by the existing template.
The picture below shows the rendered report:
obj.list[0] = c1;
obj.list[1] = c2;
© 2003-2015 Stimulsoft
11 Stimulsoft Reports
int busobjLevel = 1;
Just as in .NET, in Web you can create a description of the business objects first, then the report
template, and then connect the data source with the real data and render a report. Create a description
of the business object. But previously you have to make the class of the business object that is identical
to the class of business object in .NET. Here is an example of writing a business object:
Now with the description created, design a report template identical to .NET. Once a report template is
created, you can save it, for example to the following path D:\\Report.mrt. Since the description of the
business object does not contain the actual data, in order to build a report, you should get the real
data to business objects, in this example, we take the data from the database Northwind. First, create
a connection to the database in Visual Studio. After that, write the code to obtain data for the business
object. Getting real data for the business object occurs immediately before the report. Here is the code
to obtain data for the business object:
int busobjLevel = 1;
report.RegBusinessObject("Categories", categories);
StiWebViewer1.Report = report;
}
© 2003-2015 Stimulsoft
Data 12
if (sf.ShowDialog() == true)
{
Stream file = sf.OpenFile();
report.Load(file);
}
In order to pass the business objects in WinRT, you should use the following methods:
© 2003-2015 Stimulsoft
13 Stimulsoft Reports
{
StiReport report = new StiReport();
report.RegBusinessObject("Categories", "Categories", GetData());
report.Dictionary.SynchronizeBusinessObjects(3);
await report.SaveAsync(storageFile);
}
Next, consider creating a report template with the description of the business objects, filling them with
real data and reporting.
The picture above shows that the report template is created. Since it was created with a description of
the business object that does not contain the actual data, the report can not be rendered. For
rendering a report, a business object should be filled with real data. This can be done manually by
specifying values for the fields, or to connect the data source from which the data will be delivered.
Created report template should be saved, for example, in the folder "My Documents" with the name
Report.mrt.
Xaml:
<Page>
<viewerRT:StiViewerControl x:Name="viewerControl" />
</Page>
C#:
© 2003-2015 Stimulsoft
Data 14
report.RegBusinessObject("Categories", categories);
await report.RenderAsync();
viewerControl.Report = report;
}
After that, the report generator fills the business object with data from the specified data source, in this
case from the database Northwind, the table Categories. Then, the report will be rendered by the
existing template. The picture below shows the rendered report:
The protocol Open Data (OData) is used to access from different sources, including relational
databases, file systems, content management systems and ordinary web sites. OData realizes the
CRUD conception (Create, Read, Update, Delete) in relation to data. In Visual Studio 2010 and .NET
Framework 4.0 was simplified with support of OData using the access technology Entity Framework.
On the basis of received (using OData protocol) data, it is possible for a user to create reports. Passing
data to the report goes through business objects. Let’s have an example of retrieving data from the
report and passing data to the report:
1. Connect the Stimulsoft assemblies;
© 2003-2015 Stimulsoft
15 Stimulsoft Reports
2. Add Service Reference specifying the address of the entry point to OData-Service. In this case the
address is http://services.odata.org/V3/OData/OData.svc;
3. Use following code:
3 WinForms Viewer
The StiViewerControl component is used to view reports in the WinForms. The component can show a
report, zoom, save rendered reports to various formats, print reports, send them to a recipient via
Email.
C#
VB.NET
If the report was not rendered before showing, the Show method will render a report using the Render
method.
© 2003-2015 Stimulsoft
WinForms Viewer 16
The Dot-Matrix viewer is designed to preview the report before printing it on dot matrix printer. The
Dot matrix printer is used to print only the text and characters of pseudographics. Accordingly the
viewer displays only the text and borders of objects as pseudographics characters. The picture below
shows the Dot-matrix viewer dialog box:
The Dot-Matrix viewer can be configured from code using static properties. Depending on the value of
the static properties in the Dot-matrix viewer, these or that parameters will be specified. For example,
the AutoRefresh property. The picture below shows the Dot-Matrix viewer dialog box:
© 2003-2015 Stimulsoft
17 Stimulsoft Reports
As can be seen on the picture above, the Auto Refresh property is enabled. This means that the
AutoRefresh static property of the Dot-Matrix viewer is set to true. If the AutoRefresh static property
is set to false, then the AutoRefresh property in the Dot-Matrix viewer is disabled. Add the following
code into the project code:
StiOptions.Viewer.DotMatrix.AutoRefresh = false;
Thus, the AutoRefresh property will be disabled. The picture below shows the Dot-Matrix viewer
dialog box with disabled auto refresh function:
© 2003-2015 Stimulsoft
WinForms Viewer 18
For inserting the escape sequence to text the commands that may look like <#command> should be
used as seen in the code sample below:
Normal text <#b> Bold text <#/b><#i> Italic text <#/i> Again normal text
Also commands of selecting bold, italic or underlined text are automatically inserted depending on the
style of the text box font. When printing to matrix printer and exporting to text format these commands
are changed on appropriate escape sequences.
The StiEscapeCodesCollection is used for this process. It is inherited from the Hashtable class. This is a
collection of "key-value" pairs where the key is the command and value is the escape-sequence. For
different types of printers different collections with different set of command can be defined.
Collections are stored in the StiOptions.Export.Txt.EscapeCodesCollectionList static variable. By
default, the following collections will be created: "None", "EpsonFX", "Oki ML92/93". The "None"
collection is empty and used to output the text without escape codes.
b ESC E ESC T
© 2003-2015 Stimulsoft
19 Stimulsoft Reports
/b ESC F ESC I
i ESC 4
/i ESC 5
u ESC -1 ESC H
/u ESC -0 ESC D
It is possible to add new collections of change the existing ones. The selection of the required
collection is done by the name. If the collection with the name is not found then the "None" collection is
used. The collection name can be selected from the DotMatrixViewer settings and passed as an option
to the exporting and printing methods.
4 WPF Viewer
The StiWpfViewerControl component is used to view reports in Reports.Wpf. The component can
show a report, zoom, save rendered reports to various formats, print reports, send them to a recipient
via Email.
C#
© 2003-2015 Stimulsoft
WPF Viewer 20
report.ShowWithWpf();
VB.NET
If the report was not rendered before showing, the ShowWithWpf method will render a report using
the RenderWithWpf method.
The Dot-matrix viewer is designed to preview the report before printing it on dot matrix printer. The
Dot matrix printer is used to print only the text and characters of pseudographics. Accordingly the
viewer displays only the text and borders of objects as pseudographics characters. The picture below
shows the Dot-matrix viewer dialog box:
The Dot-Matrix viewer can be configured from code using static properties. Depending on the value of
the static properties in the Dot-matrix viewer, these or that parameters will be specified. For example,
© 2003-2015 Stimulsoft
21 Stimulsoft Reports
the AutoRefresh property. The picture below shows the Dot-matrix viewer dialog box:
As can be seen on the picture above, the AutoRefresh property is enabled. This means that the
AutoRefresh static property of the Dot-matrix viewer is set to true. If the AutoRefresh static property is
set to false, then the AutoRefresh property in the Dot-matrix viewer is disabled. Add the following code
into the project code:
StiOptions.Viewer.DotMatrix.AutoRefresh = false;
Thus, the AutoRefresh property will be disabled. The picture below shows the Dot-matrix viewer
dialog box with disabled auto refresh function:
© 2003-2015 Stimulsoft
WPF Viewer 22
For inserting the escape sequence to text the commands that may look like <#command> should be
used as seen in the code sample below:
Normal text <#b> Bold text <#/b><#i> Italic text <#/i> Again normal text
Also commands of selecting bold, italic or underlined text are automatically inserted depending on the
style of the text box font. When printing to matrix printer and exporting to text format these commands
are changed on appropriate escape sequences.
The StiEscapeCodesCollection is used for this process. It is inherited from the Hashtable class. This is a
collection of "key-value" pairs where the key is the command and value is the escape-sequence. For
different types of printers different collections with different set of command can be defined.
Collections are stored in the StiOptions.Export.Txt.EscapeCodesCollectionList static variable. By
default, the following collections will be created: "None", "EpsonFX", "Oki ML92/93". The "None"
collection is empty and used to output the text without escape codes.
b ESC E ESC T
/b ESC F ESC I
i ESC 4
© 2003-2015 Stimulsoft
23 Stimulsoft Reports
/i ESC 5
u ESC -1 ESC H
/u ESC -0 ESC D
It is possible to add new collections of change the existing ones. The selection of the required
collection is done by the name. If the collection with the name is not found then the "None" collection is
used. The collection name can be selected from the DotMatrixViewer settings and passed as an option
to the exporting and printing methods.
5 Web Designer
The StiWebDesigner component is used to edit reports in the window of a browser. And there is no
need to install the .NET Framework, ActiveX components and other special plug-ins on the client
machine. The only requirements are a web browser and the Flash player. Using StiWebDesigner it is
possible to create, edit, save, view, and print reports on any computer, on any OS, where there is an
internet connection, and where there is the installed web browser and Flash Player 11.1 and higher.
StiWebDesigner is non visual ASP.NET component. It can be divided in two parts: client and server.
The client side is the graphic wrapping of the designer that is realized on Flex. The server side is the
report generator engine and, also, a module that has functions to get queries and send data on the
client side. These two parts are collected into one DLL library and represented as a non visual
component.
To run the web report designer, it is required to put the StiWebDesigner component on the ASP.NET
page and call the Design method of this component. When running the Web report designer the
© 2003-2015 Stimulsoft
Web Designer 24
For running the Web report designer it is necessary to put non visual StiWebDesigner component on
the form and, in the event handler of a control, to call the Design() method:
C#:
VB.NET:
For loading a report in the Web designer, the method of calling can be slightly modified:
C#:
VB.NET:
© 2003-2015 Stimulsoft
25 Stimulsoft Reports
StiWebDesigner1.Design(report)
End Sub
It requires a bit more complicated code to call the report designer automatically when loading a page.
It is necessary to exclude service messages which are sent by the client part of the designer to the
server part:
C#:
VB.NET:
One of the following methods can be used to load a report to the Web designer:
Loading a report before loading the designer;
Loading a report after loading the designer;
Loading a report from the main menu of the designer.
© 2003-2015 Stimulsoft
Web Designer 26
Loading a report before loading the designer. In this way the report (for example, from a file) is
loaded first and then the designer is loaded. The previously loaded report is specified as a parameter of
a method of calling the designer. A code below is a sample for loading a report before loading the
designer:
or, as a way, the previously loaded report is assigned to the designer. In this case designer loading is
done with this report. See the code below:
Loading a report after loading the designer is done using the GetReport event. After adding the
handler to this event, it will occur each time when a report is required for the designer. In other words,
after loading the Web designer requests a report from the server and, if the handler is added to the
GetReport event, then in this event a report can be assigned to the designer. See the code below how
to use the GetReport event:
If the designer is set to the Visual mode, then the report should be loaded with way specified below:
© 2003-2015 Stimulsoft
27 Stimulsoft Reports
The preview function of the edited report, in the Web designer, has two modes: HTML (preview as
HTML file) and PDF (preview as PDF file). After selecting one of two modes, a report will be shown is
the browser window. If, when report rendering, the errors occur, then alert messages will be shown in
the separate browser window. To preview a report in the web designer window can be done by
switching the Preview tab in the designer. To preview the report data are required. By default, data are
taken from the Dictionary of the edited report. If necessary, they can be overridden. There is a sample
code below using what data can be overridden:
C#:
VB.NET:
As seen from code, data are taken from XML and XSD files. The same way exists for other data
sources. If any connections to the database are specified in the report, they have a higher priority than
the data specified in the GetPreviewDataSet event. In order specified data be applied when rendering
the report, you should clear the list of connections:
© 2003-2015 Stimulsoft
Web Designer 28
If it is necessary before the report rendering to change the report parameters or user settings in the
report, you can add a handler to the ProcessReportBeforeRender event. This event occurs immediately
before the report rendering. For example, it is necessary to change the Report Name before report
rendering. To do this, add the handler to the ProcessReportBeforeRender event, define the value of
the ReportName property, where the value of the property is the name of the report. For example,
add the following code to the code project:
Now, before report rendering, the name will be changed from the existing one to Report 2010. Thus,
using the ProcessReportBeforeRender event, the user can change custom options before rendering.
Two events are used for the processing of a saved report in the Web-designer. These are SaveReport
and SaveReportAs. The SaveReport event occurs when you click on the Save Report button or when
you click on the Save Report item of the main menu in the designer. The SaveReportAs event occurs
when you select the Save As item of the main menu in the designer. When the user is not signed to this
event, then, by default, a built-in Web-designer dialog box to save the report is called. If the user is
assigned to this event, then the dialog box will not appear but the event will appear, i.e. saving is done
by the server. See the code below:
C#:
VB.NET:
After that, the ways and place to save the report are identified by the user. For example, the report can
be saved to a string in the database. Below is the code to save a report to the string:
© 2003-2015 Stimulsoft
29 Stimulsoft Reports
C#:
VB.NET:
Subscription to the SaveReportAs event is made by analogy with the SaveReport event. In the event of
saving a report you can use the ErrorCode property of the event argument. The ErrorCode property
can take numeric values. By default, this property is set to -1. This means that, when saving a report, the
report event occurs, but nothing will be output in the Web-designer. If this property is set to 0, then the
user will be notified about that the report is saved successfully. The picture below shows a notification
window which indicates successful report saving:
If the ErrorCode property will be greater than 0, then the error message is displayed with its source
code where the error is the value of the ErrorCode. The picture below shows a window with the error
code 1:
Report saving occurs in the background mode, i.e. visually it will not be displayed. If you need to
visually manage the process of saving the report, you may change the SaveMode property of the
StiWebDesigner component on one of two values: Visible or NewWindow:
© 2003-2015 Stimulsoft
Web Designer 30
If the SaveMode property is set to Visible, the process of saving the report will be displayed in the
current browser window. If the property is set to NewWindow, then the process of saving the report
will be displayed in a new browser window. By default, this property is set to Hidden, i.e. the process of
saving the report is not displayed.
Setting the Web designer can be done using the static properties, which are described in the
Stimulsoft.Report.Web.StiWebDesignerOptions class. Static properties of the Web designer can be
divided into following groups: Connection, Main menu, Zooming, Viewer, Additional.
5.7.1 Connection
The static properties described below belong to the StiWebDesignerOptions.Connection group and
responsible for option of connection the client and server sides:
Name Description
ClientRequestTimeout property sets time (in seconds) that the client part will wait the response
from the server side. The default value is 10 seconds.
ClientRepeatCount property sets the number of repeats of requests of the server side to the
client side, when getting errors of obtaining data. The default value is 2
repeats.
RelativeUrls property allows using the relative Url. If the RelativeUrls is set to false,
then the absolute Url is used. If the RelativeUrls is set to true, then the
relative Url is used. By default, the value is set to false. A sample of the
absolute and relative Urls is shown below:
http://localhost:4444/WebDesignerDemo/WebDesigner.aspx is an
absolute Url, the RelativeUrls property is set to false;
/WebDesignerDemo/WebDesigner.aspx is a relative Url, the RelativeUrls
property is set to true.
The main menu of the Web designer can be setup according to user's requirements. This group of
static properties StiWebDesignerOptions.Menu allows enabling/disabling main menu or submenu
items.
Name Description
© 2003-2015 Stimulsoft
31 Stimulsoft Reports
NewEnabled property is used to enable/disable the New menu item. If the NewEnabled
property is set to true, then this menu item is enabled and available for a
user. If this property is set to false then this submenu item is disabled and
not available for a user. By default, this property is set to true. The New
menu contains submenus such as: New Report, New Report With Wizard,
New Page.
NewReport property is used to enable/disable the New Report submenu item. If the
NewReport property is set to true, then this submenu item is enabled and
available for a user. If this property is set to false then this submenu item is
disabled and not available for a user. By default, this property is set to
true;
NewReportWithWizar property is used to enable/disable the New Report With Wizard submenu
d item. If the NewReportWithWizard property is set to true, then this
submenu item is enabled and available for a user. If this property is set to
false then this submenu item is disabled and not available for a user. By
default, this property is set to true;
NewPage property is used to enable/disable the New Page submenu item. If the
NewPage property is set to true, then this submenu item is enabled and
available for a user. If this property is set to false then this submenu item is
disabled and not available for a user. By default, this property is set to
true;
OpenReport property is used to enable/disable the Open Report menu item. If the
OpenReport property is set to true, then this menu item is enabled and
available for a user. If this property is set to false then this submenu item is
disabled and not available for a user. By default, this property is set to
true;
SaveReport property is used to enable/disable the Save Report menu item. If the
SaveReport property is set to true, then this menu item is enabled and
available for a user. If this property is set to false then this submenu item is
disabled and not available for a user. By default, this property is set to
true;
SaveAs property is used to enable/disable the Save As menu item. If the SaveAs
property is set to true, then this menu item is enabled and available for a
user. If this property is set to false then this submenu item is disabled and
not available for a user. By default, this property is set to true;
DeletePage property is used to enable/disable the Delete Page menu item. If the
DeletePage property is set to true, then this menu item is enabled and
available for a user. If this property is set to false then this submenu item is
disabled and not available for a user. By default, this property is set to
true;
Preview property is used to enable/disable the Preview menu item. If the Preview
property is set to true, then this menu item is enabled and available for a
user. If this property is set to false then this submenu item is disabled and
not available for a user. By default, this property is set to true. The Preview
© 2003-2015 Stimulsoft
Web Designer 32
menu item contains a submenu which contains the following items: Preview
As Pdf, Preview As Html.
The Zoom group of static properties has one static property: StiZoomMode. Depending on the values
of this property it is possible to set options of report template zoom. This property has the following
values: PageWidth, PageHeight, OnePage, Zoom25, Zoom50, Zoom75, Zoom100, Zoom150,
Zoom200.
Name Description
PageWidth Sets zoom by Page Width. So the width of the report template matches
the width of the window of the web designer.
PageHeight Sets zoom by Page Height. So the height of the report template matches
the height of the window of the web designer.
OnePage Sets zoom by One Page. So the entire page of the report template fits in
the window of the web designer.
Zoom25, Zoom50, Set zoom level of the report template which is 25%, 50%, 75%, 100%,
Zoom75, Zoom100, 150%, 200%.
Zoom150, Zoom200
Name Description
ShowZoom Property is used to show/hide the zoom panel. If the ShowZoom property
is set to true, then the zoom panel will be shown. If the ShowZoom
property is set to false, then the zoom panel will be hidden. By default this
property is set to true.
© 2003-2015 Stimulsoft
33 Stimulsoft Reports
© 2003-2015 Stimulsoft
Web Designer 34
© 2003-2015 Stimulsoft
35 Stimulsoft Reports
Name Description
ExitButtonVisible Property is used to show/hide the Exit button in the main menu. If the
ExitButtonVisible property is set to true, then the button tab will be
shown. If the ExitButtonVisible property is set to false, then the button
tab will be hidden. By default this property is set to true.
© 2003-2015 Stimulsoft
Web Designer 36
Name Description
BrowserTitle property is used to change titles of a browser. This property may get string
values. By default, the title of a browser is Report Alias, and if it is absent, it is a
Report Name.
SaveMode If you need to show the process of saving a report, you need to set the
SaveMode property of the StiWebDesigner component to one of the following
values: Visible or NewWindow. If the SaveMode property is set to Visible,
then process will be displayed in the current window of the designer. If the
SaveMode property is set to NewWindow, then the saving process will be
shown in a new window of the browser. By defauly this property is set to Hidden,
the process of saving is not shown.
SaveAsMode The difference of this property is that, it works when the SaveReportAs event
occurs, and the SaveMode property when the SaveReport event occurs.
UseCache property allows using caching on the server when loading a report. If the
UseCache property is set to true, then caching is used when loading a report,
i.e. a report is loaded to the Web designer from the server cache. If the
UseCache property is set to false, then caching is not used when loading a
report. In this case for loading the report in the Web designer the GetReport
event should be used. By default, this property is set to true.
ServerTimeout property is used to define the time of a report in the report cache. By default,
this property is set to "00:10:00", this means that the report is stored 10 minutes
in the server cache and then it is removed.
ExitUrl property is used to assign Url, to what user will be redirected when closing the
Web designer via clicking the Exit button of the main menu. By default, a user
will be redirected on a page from what the Web designer is run.
ShowWizardOnSt property is used to show the report rendering wizard window when running the
artup Web designer. If the ShowWizardOnStartup property is set to false, then, when
running the Web designer, the report rendering wizard window will not be
shown. If the ShowWizardOnStartup property is set to true, then, when running
the Web designer, the report rendering wizard window will be shown. By
default, this property is set to false.
© 2003-2015 Stimulsoft
37 Stimulsoft Reports
AppCacheDirecto property is used to define the path to the directory on the server, in what,
ry caching files of the Flash-application will occur. For this, you should set full
access of the ASP.NET application to this directory.
ShowSelectLangu Shows/hides the button to invoke the menu of selecting the localization. If this
age property is set to true, the button is displayed. If the property is set to false, the
menu button is hidden. By default, this property is set to true.
The PreInit event is used to change Web designer properties. This event occurs before initialization of
the designer, i.e. before passing Web designer properties to the client part of an application. In other
words, to change the Web designer properties from code in it necessary to add the handler to the
PreInit event. The code below shows how to add the handler to the PreInit event and set the
Localization property to en:
Now, when running the Web designer, it will be localized in English. For example, we need to change
the browser title. By default, the browser title is the value of the Report Alias property. If the value is
not set then the Report Name is taken. To change the browser title it is necessary to add the code
below to the event:
Now, when running the Web designer, Stimulsoft word will be shown as a report title.
The Web report designer interface can be localized in any of 24 available languages. It is necessary to
create the Localization folder in the root catalogue of your Web-project and copy all necessary .xml
localization files. After loading the web report designer, the list of languages will be available in its
menu. The path to the Localization folder can be changed. The DirectoryLocalization property is used
for this:
© 2003-2015 Stimulsoft
Web Designer 38
Also, it is possible to specify which language can be used right after the web report designer (default
localization). The following code shows how to do this. (it is necessary to specify the .xml file in the
Localization property):
If the designer is in visual mode, then the report should be loaded with the following method:
If to call the Design () method in the visual mode of the designer, then loaded report is displayed on
the full screen in the browser.
6 Web Viewer
Stimulsoft Reports contains full set of tools to create reports and show them in Web. Basic tools are:
StiWebViewer and the StiReportResponse class. The StiWebViewer is used to show a report on a
page of browser. The StiReportResponse contains a method to render a report to the specified
format.
6.1 Caching
The StiWebViewer component can output reports in two modes: 1. Using the caching and 2. Without
caching. If the cashing is not used then it is necessary, when every page refreshing, to get data from a
report and render a report again. When using caching the rendered report is saved in cache on the
© 2003-2015 Stimulsoft
39 Stimulsoft Reports
server. The next time when the page is refreshed, the previously rendered report is loaded from cache
and its re-rendering is not required. It is important to remember that every report saved in cache takes
the server memory and, if there are a lot of queries to reports, it can be a critical factor. Therefore, one
should choose choose either low requirements to the memory but high requirements to performance
or high requirements to the memory but low requirements to speed. Caching should not be used if the
end user needs a report with actual data when every refreshing. The caching process can be controlled
using the RenderMode, CacheMode, and ServerTimeOut properties.
If the caching of a report is not used then the report that was rendered using the last data when page
refreshing will be printed but not the report that is shown on the current moment. If it is necessary to
get the exact copy of a report form the browser, then it is necessary to use caching.
Notice. It should be borne in mind that if the report caching is not used, then not the report that is
shown currently will be printed, but one that will be rendered using the latest data when refreshing a
page. If it is important to get an exact copy of the report from the browser, you should use caching.
The RenderMode property indicates how and when a report should be rendered. All modes of the
StiWebViewer component can be divided in two categories: using the caching of a rendered report,
and without using caching of the rendered report. The modes without caching
Standard
In this mode, the report should be re-rendered every time when the page is refreshed. In addition, this
mode does not use Ajax to display the controls of the StiWebViewer and any report refresh with help
of controls of the StiWebViewer component leads to the page refresh on what the report is output.
RenderOnlyCurrentPage
Very interesting mode of the report output. In this mode, the report is rendered only to the page that is
currently displayed in the StiWebViewer component. For example, if the report consists of 100 pages
(this is a big report to be output in the web), and the current page is the page number 5, the report will
be rendered only up to the page number 5. The sever memory is saved in this mode.
Ajax
This mode uses Ajax to output a report and to update the content of the StiWebViewer component.
For example, if a user goes to the next page of a report then not the whole page of the browser on
what the StiWebViewer component is placed will be refreshed but only the next page of a report will be
sent to the browser using the post-back query. This increases the convenience of working with the
StiWebViewer component.
AjaxWithCache
This mode as well as the Ajax mode uses the Ajax technology to output a report and also is used for
refreshing operations of the StiWebViewer component. However, unlike the Ajax mode, this
AjaxWithCache mode does not re-render the report after each information request on the server. The
report that was earlier saved in cache is used.
© 2003-2015 Stimulsoft
Web Viewer 40
The CacheMode property indicates what cache should be used to store reports, images, and service
information. There are two ways:
Page
A page cache will be used.
Session
A session cache will be used.
The ServerTimeout property indicates the amount of time on what it is necessary to save a report,
pictures of a report, or other data in the cache. Do not use too much time or too little time. If the time
is too large, then the used cache will be overflowed and will be automatically cleared by the server. As
a result, the report (or images of a report) will not be cached, and incorrect result of the report output
in the StiWebViewer component will occur. If the time is too small, then by the time of request to the
cache, there some necessary data may not be found. It is recommended to set the time equal to 10
minutes. But the exact time can be found experimentally, considering the parameters of the server,
users activity, etc.
It is difficult to print a report from the browser. Stimulsoft Reports has three methods of printing:
Converting a report to the PDF file and passing it to the end-user for printing.
Printing a report with preview in the pop-up window.
Printing without preview.
The first method is the best way. It allows printing a report more precisely. But it is required to have
installed Adobe Acrobat to print a report to the PDF format. Often this requirement is a big
disadvantage. When printing reports with preview the report generator creates a new pop-up window.
A report in the HTML format is output in this window. The end-user may format this report and print it.
In printing report without preview the report generator prints a report without preview. When choosing
the method of printing characteristics of each method should be considered.
Notice: The StiWebViewer component cannot control page parameters (page size, page
orientation, page margins) when printing using the 2 and 3 method. All parameters are controlled with
the browser.
A report can be shown without using the StiWebViewer component. The special
© 2003-2015 Stimulsoft
41 Stimulsoft Reports
Stimulsoft.Report.Web.StiReportResponse class is used in this case. This class is a set of methods for
saving a rendered report in different formats to the stream of a page. It is possible to assign a lot of
input parameters which allows controlling the saving format of a report. For example, the following
code can be used to save a report to the PDF format to the stream of a page:
In this code the report will be loaded first. Then this report will be rendered. Then the result of the
report rendering will be saved to the stream of a page. The following code saves a report to the Excel
2007 format.
The StiWebViewer component can show reports with dialogs, but some conditions should be fulfilled:
The AjaxWithCache mode should be used or the UseCache in the RenderMode property;
If data are not received from the server then it is necessary to connect with other data using the
ReportConnect event of the StiWebViewer component and also to disconnect from data using the
ReportDisconnect event;
Besides it is impossible to run a report for rendering in the Load event of a page;
It is possible to use only one dialog form in a report.
By default, images for the toolbar of the StiWebViewer component are saved in cache before report
viewing. Then images are output using cache. This result in additional requests to the server for
extracting images from cache and sending them to the client. This problem can be solved using the
ButtonImagesPath property of the StiWebViewer component. The first thing that should be done is to
place a folder with toolbar images on the server (they can be taken from the standard delivery of the
product). Then it is necessary to specify the path to this folder using the ButtonImagesPath property.
To make the StiWebViewer component "speak" another language it is necessary to copy a localization
file of the standard delivery to the sever. For example, select the "de.xml" file. Then define the path to
this file in the GlobalizationFile property of the component. For example, "Localization\de.xml".
© 2003-2015 Stimulsoft
Web Viewer 42
7 MVC Designer Fx
The MVC DesignerFx (StiMvcDesignerFx) component is used for editing reports in the web browser.
You do not need to install the .NET Framework, ActiveX components, or any special plug-ins on the
client side. All you need is a web browser and Flash Player. With MVC DesignerFx you can create,
edit, save, view, and print reports on any computer with any operating system, where there is access to
the Internet and there is a web browser with support for Flash Player version 11.1 or higher. The MVC
DesignerFx component can be divided into two parts - client and server. The client side is a graphical
front-end wrap of the designer developed on base of the Flash technology. The server side is the
report engine, as well as a module that performs the functions of receiving requests, processing and
passing data arranged on the client side. These two parts are assembled into a single library and
represented as the ASP.NET MVC component.
The MVC DesignerFx component is located in the StiMvcDesignerFx class. The minimum required set
of libraries for components is
Stimulsoft.Base.dll
Stimulsoft.Report.dll
Stimulsoft.Report.Mvc.dll
To run the designer it is required to place the MVC DesignerFx component on the view page, set the
necessary options, and, in the view controller, to determine the appropriate action. When you run the
report designer the following actions occur:
The .NET component generates HTML and Javascript code needed to display reports and work with
the report designer.
When the component is output the Flash application runs. This requests a report template on the
server side and displays it in the edit window.
Various actions such as previewing the report, saving the report template, exporting it, using
parameters, sorting and drill down, cause a specific action on the server side, where you can perform
the necessary manipulations with the report.
For editing a report template, you must add the MVC DesignerFx component on a report page and
set the minimum required options, and in the view controller to determine the appropriate action. The
GetReportTemplate action returns the report template to the designer.
ASPX:
© 2003-2015 Stimulsoft
43 Stimulsoft Reports
}
})%>
Razor:
@Html.Stimulsoft().StiMvcDesignerFx(new StiMvcDesignerFxOptions() {
Actions =
{
GetReportTemplate = "GetReportTemplate"
}
})
Controller:
return StiMvcDesignerFx.GetReportTemplateResult(report);
}
© 2003-2015 Stimulsoft
MVC Designer Fx 44
This action is automatically called after the report designer is loaded. It is also possible to return the
report template when creating a new report by the relevant item of the main menu of the designer.
The CreateReportTemplate action is used for this.
ASPX:
© 2003-2015 Stimulsoft
45 Stimulsoft Reports
Razor:
@Html.Stimulsoft().StiMvcDesignerFx(new StiMvcDesignerFxOptions() {
Actions =
{
CreateReportTemplate = "CreateReportTemplate"
}
})
Controller:
return StiMvcDesignerFx.GetReportTemplateResult(report);
}
The MVC DesignerFx component has a preview mode of edited reports. To preview the report, you
should simply navigate to the appropriate tab in the designer. The report template will be transferred
to the server side, rendered and displayed in the embedded viewer. To preview the report, you should
define a special action - GetReportSnapshot.
ASPX:
Razor:
@Html.Stimulsoft().StiMvcDesignerFx(new StiMvcDesignerFxOptions() {
Actions =
{
GetReportTemplate = "GetReportTemplate",
GetReportSnapshot = "GetReportSnapshot"
© 2003-2015 Stimulsoft
MVC Designer Fx 46
}
})
Controller:
Also, before previewing the report it is possible to carry out any manipulation with it (for example,
connect the data). To do this, you should use the method - GetReportObject(), which returns the
© 2003-2015 Stimulsoft
47 Stimulsoft Reports
Controller:
return StiMvcDesignerFx.GetReportShapshotResult(report);
}
The preview window of the MVC DesignerFx report component is an interactive report viewer that can
print and export reports, and also supports sending data via Email. For working with the built-in report
viewer it is necessary to determine the following.
ASPX:
Razor:
@Html.Stimulsoft().StiMvcDesignerFx(new StiMvcDesignerFxOptions() {
Actions =
{
ExportReport = "ExportReport",
EmailReport = "EmailReport",
DesignerEvent = "DesignerEvent"
}
})
Controller:
© 2003-2015 Stimulsoft
MVC Designer Fx 48
return StiMvcDesignerFx.ExportReportResult();
}
return StiMvcDesignerFx.EmailReportResult(options);
}
© 2003-2015 Stimulsoft
49 Stimulsoft Reports
In any of the above mentioned actions it is accepted to modify a report template, if required. If one of
these actions is absent, then the corresponding one will not be available in the preview window.
The MVC DesignerFx component has the ability to view C#/VB.NET code of the editable report
template. By default, this option is disabled. In order to enable it you should set the ShowCodeTab
option to true. The special action - DesignerEvent should be defined.
ASPX:
© 2003-2015 Stimulsoft
MVC Designer Fx 50
Actions =
{
DesignerEvent = "DesignerEvent"
},
Toolbar =
{
ShowCodeTab = true
}
})%>
Razor:
@Html.Stimulsoft().StiMvcDesignerFx(new StiMvcDesignerFxOptions() {
Actions =
{
DesignerEvent = "DesignerEvent"
},
Toolbar =
{
ShowCodeTab = true
}
})
Controller:
Also, the window with the code of the report will be displayed in case of an error compiling the report.
For this it is necessary to select one of the errors in the proposed list.
To process the saved report in the MVC DesignerFx component two special actions are used -
SaveReportTemplate and SaveReportTemplateAs. The SaveReportTemplate action is triggered by
clicking the Save Report button on the quick access toolbar, or by selecting the Save Report of the main
menu in the designer. The SaveReportTemplateAs action is called when you select Save As of the main
menu in the designer. If the second action is not defined in the settings of the report designer, the
default command is invoked dialog box to save the report on the local computer. If the action is
specified, the dialog box does not appear. Below is an example of the action code to save a report -
SaveReportTemplate (action code SaveReportTemplateAs will be similar).
ASPX:
© 2003-2015 Stimulsoft
51 Stimulsoft Reports
Razor:
@Html.Stimulsoft().StiMvcDesignerFx(new StiMvcDesignerFxOptions() {
Actions =
{
SaveReportTemplate = "SaveReportTemplate",
SaveReportTemplateAs = "SaveReportTemplateAs"
}
})
Controller:
return StiMvcDesignerFx.SaveReportResult();
}
© 2003-2015 Stimulsoft
MVC Designer Fx 52
The user identifies options and the location to save the report in the action to save a report. For
example, the report can be saved in the database or as a file on the server side. This action should
return a response to the designer of the result of saving the report. The answer may be of several
types - standard, Boolean, integer, and string.
No action will occur when there will be a standard reply (without parameters). After saving the user will
continue to work with the report template.
If the action returns true, then after saving the web designer window displays the successful saving of
the report
© 2003-2015 Stimulsoft
53 Stimulsoft Reports
When returning a string value, you will see a dialog box indicating that the report error occurred. As
the error text the transmitted string value will be displayed.
When returning an integer value, the user sees an error message of saving the report and an error
code, where the error code is a passed integer value.
Saving a report goes in the background mode, without reloading the page in a browser window. If you
need some way to visually manage the process of saving the report, you should change the value of
the SaveReportTemplateMode option of the designer on one of three values - Hidden, Visible or
NewWindow.
ASPX:
Behavior =
{
SaveReportTemplateMode = StiSaveMode.Visible
}
})%>
Razor:
© 2003-2015 Stimulsoft
MVC Designer Fx 54
@Html.Stimulsoft().StiMvcDesignerFx(new StiMvcDesignerFxOptions() {
Actions =
{
SaveReportTemplate = "SaveReportTemplate"
},
Behavior =
{
SaveReportTemplateMode = StiSaveMode.Visible
}
})
If the SaveReportTemplateMode option is set to Visible, then the action of saving the report will be
called in the current browser window in the visible mode. If the SaveReportTemplateMode option is
set to NewWindow, the action of saving the report will be called in the new browser window. By
default, this option is set to Hidden, i.e. the action to save a report is called in the AJAX mode and does
not appear in the browser window. For the SaveReportTemplateAsMode option the same values and
behavior can be applied.
You should use the additional GetNewReportFlag() method if you need to know whether the previously
loaded report or a new report created in the designer is saved.
Controller:
if (isNewReport)
{
// Here the save new report code
}
else
{
// Here the save edited report code
}
return StiMvcDesignerFx.SaveReportResult();
}
To localize the interface of the MVC DesignerFx component, you should use the Localization option, as
well as a special action - GetLocalization.
© 2003-2015 Stimulsoft
55 Stimulsoft Reports
ASPX:
Localization = "~/Content/Localization/en.xml"
})%>
Razor:
@Html.Stimulsoft().StiMvcDesignerFx(new StiMvcDesignerFxOptions() {
Actions =
{
GetLocalization = "GetLocalization"
},
Localization = "~/Content/Localization/en.xml"
})
Controller:
© 2003-2015 Stimulsoft
MVC Designer Fx 56
The user interface of the report designer allows you to select the desired location from the available
list. Use the LocalizationDirectory option to specify the location where you stored the localization files.
ASPX:
LocalizationDirectory = "~/Content/Localization"
})%>
© 2003-2015 Stimulsoft
57 Stimulsoft Reports
Razor:
@Html.Stimulsoft().StiMvcDesignerFx(new StiMvcDesignerFxOptions() {
Actions =
{
GetLocalization = "GetLocalization"
},
LocalizationDirectory = "~/Content/Localization"
})
If the Localization option is set then when you run the report designer the specified localization option
will be applied. If the option is not specified, then the localization selected from a list of available ones
on the panel of the report designer will be loaded.
There are some additional actions of the of the MVC DesignerFx component. These are the actions -
DesignerEvent and Exit.
ASPX:
Razor:
@Html.Stimulsoft().StiMvcDesignerFx(new StiMvcDesignerFxOptions() {
Actions =
{
DesignerEvent = "DesignerEvent",
Exit = "Exit"
}
})
The DesignerEvent action is used to process the data requested by the designer on the server side.
These data are processing queries associated with testing database connections, obtaining the data
source columns, obtaining images for some components of the report, work with the Google Docs
cloud storage, as well as for the preparation of the report code. If this action is not specified, the
above functionality will not be available. This action is defined in the view controller as follows.
Controller:
© 2003-2015 Stimulsoft
MVC Designer Fx 58
The Exit action is called when you click the Exit button in the main menu of the designer. If this action is
not specified, pressing the button will switch to the URL address specified in the ExitUrl option of the
designer. If this option is not specified, then the Exit button will be hidden.
Controller:
ASPX:
Behavior =
{
ExitUrl = "http://www.stimulsoft.com"
}
})%>
Razor:
@Html.Stimulsoft().StiMvcDesignerFx(new StiMvcDesignerFxOptions() {
Actions =
{
DesignerEvent = "DesignerEvent"
},
Behavior =
{
ExitUrl = "http://www.stimulsoft.com"
}
})
© 2003-2015 Stimulsoft
59 Stimulsoft Reports
There are several helper methods for working with the report designer. Additional methods of the MVC
DesignerFx component include the following methods.
GetReportObject()
Returns a report object with which the designer is currently working. It is allowed to make the necessary
actions with this - register new data sets, change report properties, assign parameters or load another
report into the object.
return StiMvcDesignerFx.ExportReportResult(report);
}
GetRouteValues()
Returns the value for the URL, with which the page of the designer was opened. So, it is possible to
obtain a collection of page parameters of running in any action of the designer.
return StiMvcDesignerFx.ExportReportResult(report);
}
Also, the URL value can be obtained by the name parameter, specifying it in the called action of the
designer.
The difference between this method of obtaining the parameter values from the additional method
GetRouteValues() is that the name of the controller and action will depend on the settings of the
designer and the called action.
GetNewReportFlag()
Gets a value indicating whether the previously loaded report or a new report created in the designer is
saved. This method is used in the action to save a report.
Controller:
© 2003-2015 Stimulsoft
MVC Designer Fx 60
if (isNewReport)
{
// Here the save new report code
}
else
{
// Here the save edited report code
}
return StiMvcDesignerFx.SaveReportResult();
}
Setting the MVC DesignerFx is performed with the options that are in the StiMvcDesignerFxOptions
class. Options are divided into the following groups - Actions, Server, Appearance, Data Dictionary,
Main Menu, Toolbar, Preview Panel, Behavior, Exporting, Send Email, Printing.
ASPX:
Actions =
{
GetReportTemplate = "GetReportTemplate",
GetReportSnapshot = "GetReportSnapshot",
ExportReport = "ExportReport"
},
Exports =
{
ShowExportDialog = true,
ShowExportToDbf = false,
ShowExportToDif = false
},
Print =
{
© 2003-2015 Stimulsoft
61 Stimulsoft Reports
AutoPageOrientation = true,
AutoPageScale = true
}
})%>
Razor:
@Html.Stimulsoft().StiMvcDesignerFx(new StiMvcDesignerFxOptions() {
Theme = StiTheme.Office2013,
Localization = "~/Content/Localization/en.xml",
LocalizationDirectory = "~/Content/Localization",
Actions =
{
GetReportTemplate = "GetReportTemplate",
GetReportSnapshot = "GetReportSnapshot",
ExportReport = "ExportReport"
},
Exports =
{
ShowExportDialog = true,
ShowExportToDbf = false,
ShowExportToDif = false
},
Print =
{
AutoPageOrientation = true,
AutoPageScale = true
}
})
Main settings.
Name Description
Theme Changes the theme of the designer. The list of available themes is in the
StiThemeFx class.
Localization Sets the path to the localization XML file. The path can be absolute or
relative. If the option is not specified, then the localization will be
loaded, selected from a list of available locations on the panel of the
report designer.
LocalizationDirectory Specifies the path to the directory with the localization XML files.
Localization files will be loaded in the selection list of the localization on
the designer panel.
Width Specifies the width of the component to the required units that are
defined in the Unit class. Available values are - Unit.Pixel(),
© 2003-2015 Stimulsoft
MVC Designer Fx 62
Height Specifies the height of a component in the required units that are
defined in the Unit class. Available values are - Unit.Pixel(),
Unit.Point() and Unit.Percentage(). By default, the height is 800 pixels.
7.10.1 Actions
Name Description
GetReportTemplate Specifies the name of the action method for preparing the report
template when loading the designer.
CreateReportTemplate Specifies the name of the action method for preparing the report
template when creating a new report in the designer.
SaveReportTemplate Specifies the name of the action method for saving the report template
on the server side.
SaveReportTemplateAs Specifies the name of the action method for saving the report template
on the server side, when you select Save As. If the action is not specified,
the built-in method of saving a report template to a local disk will be
used.
GetReportSnapshot Specifies the name of the action method for preparing the rendered
report in the preview window.
ExportReport Specifies the name of the action method to export the report to the
required format.
EmailReport Specifies the name of the action method to send the report by Email.
GetLocalization Specifies the name of the action method for loading a localization XML
file of the designer. If the action is not specified, the English localization
will be set.
DesignerEvent Specifies the name of the action method of the report designer that will
process requested data on the server side.
Exit Specifies the name of the action method to navigate to the presentation
by clicking the Exit button in the main menu of the designer.
7.10.2 Server
Name Description
Controller Specifies the name of the controller to process queries of the report
designer. If this option is not specified, then the query will be used by
© 2003-2015 Stimulsoft
63 Stimulsoft Reports
RequestTimeout Waiting time for the response from the server in seconds, after which an
error is thrown. The default setting is 20 seconds. For large reports it is
recommended to increase this value.
RepeatCount Sets the number of repeats of the request when any error of connection
with the server occur. The default value is 1.
UseRelativeUrls Sets the mode of the designer, in which relative links are used for
queries on the server. By default, this option is set to false.
7.10.3 Appearance
Name Description
AutoHideScrollbars Hides the scroll bar in the preview window if the entire page fits on
the screen. By default, this option is set to false.
OpenLinksTarget The target window to open the link contained in the rendered report.
By default, this option is set to "_blank" (new window).
OpenExportedReportTarget The target window to open the export file from the designer. By
default, this option is set to "_blank" (new window).
ShowTooltipsHelp Displays links to online help for controls of the designer on mouse
over. By default, this option is set to true.
ShowFormsHint Shows hints when you hover on elements of the interface in dialogs
windows of the designer. By default, this option is set to true.
ParametersPanelColumnsC Sets the number of columns to display the report. The default
ount partition is made on 2 columns.
ParametersPanelEditorWid Sets the width of the elements of the parameters panel in pixels. The
th default width is 200 pixels.
DateFormat Sets the format of date and time for the designer dialogs, as well as
for the variables of the appropriate type in the parameters panel. The
default date and time format set on the server is used.
© 2003-2015 Stimulsoft
MVC Designer Fx 64
AboutDialogTextLine1 Specifies your own text to display in the About box. The given text will
be displayed in the first line of the box.
AboutDialogTextLine2 Specifies your own text to display in the About box. The given text will
be displayed in the second line of the box.
AboutDialogUrlText Specifies the text for a URL to display in the About box.
ShowCancelButton Shows/hides the Cancel button in the load data window from the
server side. By default, this option is set to false.
GridSizeInCentimetres Sets the size of the grid on a report page in centimeters. The default
value is set to 0.2 inches.
GridSizeInHundredthsOfInc Sets the size of the grid on a report page in hundredths of an inch.
hes The default value is 10 hundredths of an inch.
GridSizeInInches Sets the size of the grid on a report page in inches. The default value
is 0.1 inches.
GridSizeInMillimeters Sets the size of the grid on a report page in millimeters. The default
value is 2 millimeters.
BrowserTitle Sets the text of the title of the current browser window.
Name Description
ShowActionsMenu Shows/hides the menu Actions in the data dictionary of the designer. By
default this option is set to true.
ShowTestConnectionButt Shows/hides the button Test in the dialog window of editing the
© 2003-2015 Stimulsoft
65 Stimulsoft Reports
ShowOnlyAliasForBusine Shows/hides aliases for business objects in the designer. By default this
ssObjects option is set to true.
ShowOnlyAliasForDataSo Shows/hides aliases for data sources in the designer. By default this
urces option is set to true.
ShowOnlyAliasForDataCo Shows/hides aliases for data columns in the designer. By default this
lumns option is set to true.
ShowOnlyAliasForVariabl Shows/hides aliases for variables in the designer. By default this option
es is set to true.
Name Description
ShowNew Shows/hides the main menu item New. By default this option is set to
true.
ShowNewReport Shows/hides the main menu item New Report. By default this option is
set to true.
ShowNewReportWithWiz Shows/hides the main menu item New Report With Wizard. By default
ard this option is set to true.
ShowNewPage Shows/hides the main menu item New Page. By default this option is set
to true.
ShowOpenReportFromGo Shows/hides the main menu item Open Report from Google Docs. By
ogleDocs default this option is set to true.
ShowOpenReport Shows/hides the main menu item Open Report. By default this option is
set to true.
ShowSaveReport Shows/hides the main menu item Save Report. By default this option is
set to true.
ShowSaveAs Shows/hides the main menu item Save Report As. By default this option
is set to true.
ShowSaveAsToGoogleDo Shows/hides the main menu item Save Report As to Google Docs. By
cs default this option is set to true.
ShowDeletePage Shows/hides the main menu item Delete Page. By default this option is
set to true.
© 2003-2015 Stimulsoft
MVC Designer Fx 66
ShowPreview Shows/hides the main menu item Preview. By default this option is set
to true.
ShowPreviewAsPdf Shows/hides the main menu item Preview as PDF. By default this option
is set to true.
ShowPreviewAsHtml Shows/hides the main menu item Preview as HTML. By default this
option is set to true.
ShowPreviewAsXps Shows/hides the main menu item Preview as XPS. By default this option
is set to true.
ShowClose Shows/hides the main menu item Close. By default this option is set to
true.
ShowAbout Shows/hides the main menu item About. By default this option is set to
true.
ShowExitButton Shows/hides the main menu item Exit. By default this option is set to
true.
Caption Sets the text of the main menu title in the designer.
7.10.6 Toolbar
Name Description
ShowEventsTab Shows/hides the tab of the report events on the panel of the
property editor. By default this option is set to true.
© 2003-2015 Stimulsoft
67 Stimulsoft Reports
Name Description
© 2003-2015 Stimulsoft
MVC Designer Fx 68
7.10.8 Behavior
Name Description
ShowSaveFileDialog Shows/hides the dialog to enter the name of the report when it
is saved. By default this option is set to false.
AutoSaveInterval Sets time (in minutes) after which the designer will
automatically call the action to save a report. If the interval is 0
minutes, the autosave is disabled. The default value is 0
minutes.
SaveReportTemplateMode Controls the process of saving the report. It can take one of
SaveReportTemplateAsMode three values:
StiSaveMode.Hidden - the action to save a report is called in
the AJAX mode and does not appear in the browser window
(default).
StiSaveMode.Visible - the action to save a report will be
called in the current browser window in the visible mode.
StiSaveMode.NewWindow - the action to save a report will
be called in a new window (tab) of the browser.
RunWizardAfterLoad Displays the report wizard when you run the report designer.
By default this option is set to false.
© 2003-2015 Stimulsoft
69 Stimulsoft Reports
ExitUrl Sets the URL for the transition when you click the Exit button in
the main menu of the designer.
7.10.9 Exporting
Name Description
ShowExportToPdf Shows/hides the menu item Adobe PDF File. By default this
option is set to true.
ShowExportToXps Shows/hides the menu item Microsoft XPS File. By default this
option is set to true.
ShowExportToHtml Shows/hides the menu item HMTL File. By default this option is
set to true.
ShowExportToHtml5 Shows/hides the menu item HMTL5 File. By default this option is
set to true.
ShowExportToMht Shows/hides the menu item MHT Web Archive. By default this
option is set to true.
ShowExportToText Shows/hides the menu item Text File. By default this option is set
to true.
ShowExportToRtf Shows/hides the menu item Rich Text File. By default this option
is set to true.
ShowExportToExcel Shows/hides the menu item Microsoft Excel File. By default this
option is set to true.
© 2003-2015 Stimulsoft
MVC Designer Fx 70
ShowExportToExcelXml Shows/hides the menu item Microsoft Excel Xml File. By default
this option is set to true.
ShowExportToCsv Shows/hides the menu item CSV File. By default this option is set
to true.
ShowExportToDbf Shows/hides the menu item DBF File. By default this option is set
to true.
ShowExportToXml Shows/hides the menu item XML File. By default this option is set
to true.
ShowExportToDif Shows/hides the menu item Data Interchange Format (DIF) File.
By default this option is set to true.
ShowExportToImageBmp Shows/hides the menu item BMP Image. By default this option is
set to true.
ShowExportToImageGif Shows/hides the menu item GIF Image. By default this option is
set to true.
ShowExportToImageJpeg Shows/hides the menu item JPEG Image. By default this option is
set to true.
ShowExportToImagePcx Shows/hides the menu item PCX Image. By default this option is
set to true.
ShowExportToImagePng Shows/hides the menu item PNG Image. By default this option is
set to true.
ShowExportToImageTiff Shows/hides the menu item TIFF Image. By default this option is
set to true.
ShowExportToImageSvg Shows/hides the menu item Scalable Vector Graphics (SVG) File.
By default this option is set to true.
© 2003-2015 Stimulsoft
71 Stimulsoft Reports
Name Description
ShowEmailDialog Shows/hides the options dialog box to send the report by Email. If the
dialog box is disabled, then sending it by Email will be made with
settings on the server side in the EmailReport action. By default, this
option is set to true.
ShowExportDialog Shows/hides the export options dialog boxes when sending Email. If this
option is disabled, the export will be carried out with the default
settings. By default, this option is set to true.
DefaultEmailAddress Defines the Email recipient, i.e. an address to which an email with an
attached report will be sent.
7.10.11 Printing
Name Description
ShowPrintDialog Shows/hides the options dialog box to print a report. If the dialog box
is disabled, printing will be done with the default settings. By default this
option is set to true.
AutoPageOrientation Enables automatic page orientation when printing a report, if the correct
format is set in the printer settings. By default this option is set to true.
AutoPageScale Enables automatic scaling of the page when printing a report, if wrong
size is set in the printer settings. By default this option is set to true.
AllowDefaultPrint Shows/hides the Default item in the print dialog of the report. By
default this option is set to true.
AllowPrintToPdf Shows/hides the Print as PDF item in the print dialog of the report. By
default this option is set to true.
AllowPrintToHtml Shows/hides the Print as HTML item in the print dialog of the report. By
default this option is set to true.
8 MVC Viewer
The MVC Viewer (StiMvcViewer) component is designed to view reports in the web browser. You do
not need to install .NET Framework, ActiveX components or other special plug-ins on the client side. All
you need is a web browser. With help of the StiMvcViewer one can view, print, and export reports on
any computer with any operating system. Since the StiMvcViewer uses only HTML and Javascript, it can
be run on devices that do not support Flash or Silverlight - tablet PC's, smartphones.
© 2003-2015 Stimulsoft
MVC Viewer 72
The StiMvcViewer component uses AJAX for executing all actions (loading reports, scrolling pages,
zooming, interactivity etc.), that allows you to get rid of reloading the whole page and saves web
traffic. The StiMvcViewer supports themes, beautiful menu with animation, full screen mode etc.
The MVC Viewer component is located in the StiMvcViewer class. The minimum required set of
libraries for components is
Stimulsoft.Base.dll
Stimulsoft.Report.dll
Stimulsoft.Report.Mvc.dll
To run the viewer you need to place the StiMvcViewer component on the view page. Set the necessary
properties to the StiMvcViewer component, and, in the view controller, define the necessary actions.
The following actions occur when running the viewer:
The .NET component generates HTML and Javascript code that is necessary for showing and
working the viewer.
When the viewer component is output, the Javascript method is running. It requests the first report
page or the entire report (depending on the selected mode) on the server side.
Each action in the viewer (for example, scrolling pages or printing) calls the action on the server side
in which one can execute certain manipulations with the report.
For faster work the viewer saves the report in the cache or a server session that allows you to
remove the excess report rendering.
In order to preview the report it is necessary to add the component StiMvcViewer on the view page
and set to it the minimum required properties, and set the appropriate action in the view controller. In
order to preview the report it is necessary to add the component StiMvcViewer on the view page and
set to it the minimum required properties, and set the appropriate action in the view controller:
<system.web>
<pages>
<namespaces>
<add namespace="Stimulsoft.Report.Mvc" />
</namespaces>
</pages>
</system.web>
The action GetReportSnapshot returns the report prepared for the viewer and the action ViewerEvent
handles the viewer events.
ASPX:
© 2003-2015 Stimulsoft
73 Stimulsoft Reports
<%= Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Actions =
{
GetReportSnapshot = "GetReportSnapshot",
ViewerEvent = "ViewerEvent"
}
})%>
Razor:
@Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Actions =
{
GetReportSnapshot = "GetReportSnapshot",
ViewerEvent = "ViewerEvent"
}
})
Controller:
return StiMvcViewer.GetReportSnapshotResult(report);
}
Notice: These actions are mandatory. The viewer will not work correctly without them.
If the report was not rendered before being displayed, the StiMvcViewer component will build it
automatically. Thus, to display the report, it is allowed to use report templates, rendered reports and
report classes.
Controller:
© 2003-2015 Stimulsoft
MVC Viewer 74
return StiMvcViewer.GetReportSnapshotResult(report);
}
Controller:
return StiMvcViewer.GetReportSnapshotResult(report);
}
© 2003-2015 Stimulsoft
75 Stimulsoft Reports
Also before showing the report it is allowed to change its properties, assign parameters and register
data sets, for example:
Controller:
© 2003-2015 Stimulsoft
MVC Viewer 76
return StiMvcViewer.GetReportSnapshotResult(report);
}
In order to localize the interface of the report viewer the Localization property is used. The value of
this property should point the path to the localization XML file (relative or absolute):
ASPX:
<%= Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Localization = "~/Content/Localization/en.xml"
})%>
Razor:
@Html.Stimulsoft().StiMvcViewerFx(
"MvcViewer1", new StiMvcViewerOptions() {
Localization = "~/Content/Localization/en.xml"
})
When the report viewer is loaded the localization file will be loaded automatically.
The StiMvcViewer component has the ability to change the theme of visual controls. The Theme
property is used to change the theme, which can take one of the enumeration values - StiTheme:
ASPX:
Razor:
@Html.Stimulsoft().StiMvcViewerFx(new StiMvcViewerFxOptions() {
Theme = StiTheme.Office2013
© 2003-2015 Stimulsoft
77 Stimulsoft Reports
})
© 2003-2015 Stimulsoft
MVC Viewer 78
© 2003-2015 Stimulsoft
79 Stimulsoft Reports
It is possible to set color parameters of basic viewer items. Below is a list of available options and their
values by default.
ASPX:
Razor:
@Html.Stimulsoft().StiMvcViewerFx(new StiMvcViewerFxOptions() {
Appearance =
{
BackgroundColor = Color.White,
PageBorderColor = Color.Blue
},
Toolbar =
{
BackgroundColor = Color.White,
BorderColor = Color.Gray,
FontColor = Color.Black,
FontFamily = "Arial"
}
})
The main features of the report viewer are switching between report pages, report zooming, displaying
modes of reports. All these operations are performed in the AJAX-mode without restarting the
browser page. For correct work of the operations it is necessary to define a specific action -
ViewerEvent.
ASPX:
<%= Html.Stimulsoft().StiMvcViewer(
© 2003-2015 Stimulsoft
MVC Viewer 80
Razor:
@Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Actions =
{
ViewerEvent = "ViewerEvent"
}
})
Controller:
Notice: These actions are mandatory. The viewer will not work correctly without them.
The ViewerEvent action returns the HTML report page (or a set of HTML pages), rendered with the
new settings on the viewer panel. In case of exporting the report, the action returns FileResult with the
file in the format selected in the Export menu of the report viewer.
8.6 Printing
Print to PDF
Printing will be done by exporting the report to the PDF format. The advantages include more accurate
location and printing of report components compared to other printing options. Disadvantages -
required installed browser plug-in to view the PDF.
© 2003-2015 Stimulsoft
81 Stimulsoft Reports
Important: When printing to the HTML format, make sure that report page parameters and
page setup of the printer (paper size, orientation, margins, padding), and check the print settings of
the browser - margins, headers and footers, background images printing.
To work correctly of the printing function it is necessary to define a special action PrintReport:
ASPX:
<%= Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Actions =
{
PrintReport = "PrintReport"
}
})%>
Razor:
@Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Actions =
{
PrintReport = "PrintReport"
}
})
Controller:
StiMvcViewer allows you to export reports to about 30 different formats - PDF, Microsoft Word,
© 2003-2015 Stimulsoft
MVC Viewer 82
Excel, XPS, RTF, image formats, and many others. No additional configuration for the viewer is
required to work with exports. If you want to spend some actions before exporting the report, you can
define a special action ExportReport.
ASPX:
<%= Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Actions =
{
ExportReport = "ExportReport"
}
})%>
Razor:
@Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Actions =
{
ExportReport = "ExportReport"
}
})
Controller:
© 2003-2015 Stimulsoft
83 Stimulsoft Reports
The StiMvcViewer component has two modes of displaying reports: with scrollbars and without
scrollbars. The ScrollbarsMode option operates this and can take values True or False.
ASPX:
<%= Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Appearance =
{
ScrollbarsMode = true
© 2003-2015 Stimulsoft
MVC Viewer 84
}
})%>
Razor:
@Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Appearance =
{
ScrollbarsMode = true
}
})
Without scrollbars (this mode is set by default), the viewer displays the page or the whole report,
automatically stretching the viewing area. If you specify width and height, then the viewer will cut
everything that goes out of the page. In the second mode, unlike the first, when the page goes our of
the viewer size, nothing is cut off but the scrollbar appear.
Information: When viewing a report with scrollbars it is necessary to set the height of the viewer,
otherwise the default height of 600 pixels will be set.
In the MVC Viewer component you can find a full screen mode of displaying reports. The
FullScreenMode option is used for this. It takes the value true or false.
ASPX:
<%= Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Appearance =
{
FullScreenMode = true
}
})%>
Razor:
@Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Appearance =
{
FullScreenMode = true
}
})
Also to enable or disable the full screen mode, you can use the corresponding button on the control
panel of the viewer.
© 2003-2015 Stimulsoft
85 Stimulsoft Reports
The MVC Viewer component supports work with mobile devices. When you switch to the mobile mode,
the control mode from the mouse to the touch was switched in the viewer. The size of interface items
increased to facilitate control using the touch screen. To manage this mode the InterfaceType option is
used. It takes the following values.
StiInterfaceType.Auto - the type of the viewer interface is automatically selected depending on the
device used (set by default).
StiInterfaceType.Mouse - force use of the interface to manage the viewer using the mouse.
StiInterfaceType.Touch - force use of the touch interface to manage the viewer using the touch
screen.
ASPX:
<%= Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Appearance =
{
InterfaceType = StiInterfaceType.Auto
}
})%>
Razor:
@Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Appearance =
{
InterfaceType = StiInterfaceType.Auto
}
})
A special Parameters panel is implemented for working with report parameters in StiMvcViewer. To
add a parameter to the panel you need to define a variable requested by the user in a report. When
previewing a report in the viewer, such a variable will be automatically added to the Parameters panel.
It supports all types of report variables (normal variables, date and time, borders, lists, and so on). No
additional viewer settings are required. To work correctly with parameters you need to define the
specific action Interaction.
ASPX:
<%= Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Actions =
{
Interaction = "Interaction"
© 2003-2015 Stimulsoft
MVC Viewer 86
}
})%>
Razor:
@Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Actions =
{
Interaction = "Interaction"
}
})
Controller:
© 2003-2015 Stimulsoft
87 Stimulsoft Reports
If work with parameters is not required, you can disable this feature. The ShowParametersButton
option from the Toolbar section is used for this. Set this option to false.
ASPX:
<%= Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Toolbar =
{
ShowParametersButton = false
}
})%>
© 2003-2015 Stimulsoft
MVC Viewer 88
Razor:
@Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Toolbar =
{
ShowParametersButton = false
}
})
In this case, the settings panel will not be shown, even if the parameters are present in the displayed
report.
8.10 Bookmarks
The MVC Viewer component supports bookmarks in reports. When displaying such a report on the left
side of the page the panel with tabs will be displayed. When you select report bookmark the viewer will
open the desired page, and the report item with a bookmark will be highlighted:
© 2003-2015 Stimulsoft
89 Stimulsoft Reports
If work with bookmarks report is not required, you can disable this function. The
ShowBookmarksButton option from the Toolbar section of options is sued for this. Set this option to
false.
ASPX:
<%= Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Toolbar =
{
ShowBookmarksButton = false
}
})%>
© 2003-2015 Stimulsoft
MVC Viewer 90
Razor:
@Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Toolbar =
{
ShowBookmarksButton = false
}
})
In this case, report bookmarks will not be displayed, even if they are present in the displayed report.
When printing a report with bookmarks, the tree of bookmarks will be hidden. If, in addition to the
report, you need to print bookmarks as well, you need to set the BookmarksPrint option from the
Appearance section of options to true.
ASPX:
<%= Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Appearance =
{
BookmarksPrint = true
}
})%>
Razor:
@Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Appearance =
{
BookmarksPrint = true
}
})
The MVC Viewer component supports dynamic sorting, collapsing and detailed reports. Dynamic
sorting provides the ability to change the sorting direction in the rendered report. To do this, click the
component in which was dynamic sorting is set. Dynamic sorting can be done in the following directions
- Ascending and Descending. Each time you click the component the direction is reversed.
The multilevel sorting in the report is allowed. To do this, hold down the Ctrl key and click sequentially
sorted components of the report. To reset the sorting you can click on any component sorted without
holding down the Ctrl key.
© 2003-2015 Stimulsoft
91 Stimulsoft Reports
The report with dynamic collapsing is an interactive report that looks like blocks which can collapse/
expand its contents by clicking on the block header. Report items that can expanded/collapsed, marked
with a special icon sign -/+.
© 2003-2015 Stimulsoft
MVC Viewer 92
When you drill down data in your report you will see report tabs. The currently displayed report will be
highlighted.
© 2003-2015 Stimulsoft
93 Stimulsoft Reports
No additional viewer settings required for the dynamic sorting, folding and drill down reports work
properly. If you want to carry out any action before sorting, folding etc, you can define a special action
- Interaction.
ASPX:
<%= Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Actions =
{
Interaction = "Interaction"
}
})%>
© 2003-2015 Stimulsoft
MVC Viewer 94
Razor:
@Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Actions =
{
Interaction = "Interaction"
}
})
Controller:
The MVC Viewer component provides the ability to send a report by Email. To activate this feature, you
should set the ShowSendEmailButton option of the viewer to true and define the EmailReport action.
ASPX:
<%= Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Actions =
{
EmailReport = "EmailReport"
},
Toolbar =
{
ShowSendEmailButton = true
}
})%>
Razor:
@Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Actions =
{
EmailReport = "EmailReport"
},
© 2003-2015 Stimulsoft
95 Stimulsoft Reports
Toolbar =
{
ShowSendEmailButton = true
}
})
Controller:
return StiMvcViewer.EmailReportResult(options);
}
After selecting the report format to be sent by Email, the dialog displays the input options for sending
such as Email recipient, subject and message.
© 2003-2015 Stimulsoft
MVC Viewer 96
For sending a report by Email it is necessary to fill sending options such as address which will be used
to send Email, as well as the sending server settings. If necessary, you can check and correct the form
options to send Email specified in the viewer. The exported file will be automatically attached to the
Email. Also it is allowed to set default values for the form to send Email. For this purpose you can use
the following options.
ASPX:
<%= Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Email =
{
DefaultEmailAddress = "[email protected]",
© 2003-2015 Stimulsoft
97 Stimulsoft Reports
Razor:
@Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Email =
{
DefaultEmailAddress = "[email protected]",
DefaultEmailSubject = "New Invoice",
DefaultEmailMessage = "Please check the new invoice in
the attachment"
}
})
There are several helpful methods to work with the report viewer. Applying the methods will be
reviewed on the example of the Interaction action, but they can be used in any other actions of the MVC
Viewer component. These methods are
GetReportObject()
Gets the report object with which the viewer is currently running. It is allowed to make necessary
manipulations with it - register new data sets, modify report properties, assign parameters or load
another report into the object. Then the report can be returned to the viewer by specifying it as a
parameter in the resulting action method.
return StiMvcViewer.InteractionResult(report);
}
GetRouteValues()
Returns the value for the URL with which the page viewer is open. So there is an opportunity to get a
collection of page parameters for running the viewer in any action.
© 2003-2015 Stimulsoft
MVC Viewer 98
{
RouteValueDictionary routeValues = StiMvcViewer.GetRouteValues();
return StiMvcViewer.InteractionResult(report);
}
Also, the URL values can be obtained by the name of the parameter specifying it in the called action of
the viewer
The difference between this method of obtaining the parameter values and the GetRouteValues()
method is that the name of the controller and action will depend on the viewer settings and the action
called.
GetFormValues()
Returns the value of the form, which initiates (opened by POST query) the viewer page. There is an
opportunity to get a collection of form parameters in any action of the viewer.
return StiMvcViewer.InteractionResult(report);
}
By default, this feature is disabled. To activate it, set the PassFormValues option yo true.
ASPX:
<%= Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Server =
{
PassFormValues = true
}
})%>
Razor:
@Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
© 2003-2015 Stimulsoft
99 Stimulsoft Reports
Server =
{
PassFormValues = true
}
})
GetViewerParameters()
Returns all the parameters required to prepare a report (view, export, print, interactive actions, etc.)
passed by the report viewer to the server side. Returned parameters are read-only. They can be useful
for determining the parameters of the action that is currently performing the viewer - for example, to
determine the type of export.
return StiMvcViewer.ExportReportResult();
}
Setting the StiMvcViewer is performed with properties that are in the StiMvcViewerOptions class.
Properties of this class can be divided into the following categories: Action, Working with the server,
Interface, Toolbar, Buttons, Export. A sample of setting viewer options.
ASPX:
<%= Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Theme = StiTheme.Office2013WhiteTeal,
Localization = "~/Content/Localization/en.xml",
Actions =
{
GetReportSnapshot = "GetReportSnapshot",
ViewerEvent = "ViewerEvent"
},
Appearance =
{
InterfaceType = StiInterfaceType.Auto,
ScrollbarsMode = true,
© 2003-2015 Stimulsoft
MVC Viewer 100
ShowTooltips = false
},
Exports =
{
DefaultSettings =
{
ExportToPdf =
{
CreatorString = "Company Name"
}
},
ShowExportToDbf = false,
ShowExportToDif = false
}
})%>
Razor:
@Html.Stimulsoft().StiMvcViewer(
"MvcViewer1", new StiMvcViewerOptions() {
Theme = StiTheme.Office2013WhiteTeal,
Localization = "~/Content/Localization/en.xml",
Actions =
{
GetReportSnapshot = "GetReportSnapshot",
ViewerEvent = "ViewerEvent"
},
Appearance =
{
InterfaceType = StiInterfaceType.Auto,
ScrollbarsMode = true,
ShowTooltips = false
},
Exports =
{
DefaultSettings =
{
ExportToPdf =
{
CreatorString = "Company Name"
}
},
ShowExportToDbf = false,
ShowExportToDif = false
}
})
Name Description
© 2003-2015 Stimulsoft
101 Stimulsoft Reports
Theme Changes the viewer theme. The list of available themes is located in the
StiTheme class.
Localization Sets the path to the XML file of the localization. The path can be absolute
and relative.
Width Specifies the width of the component to the required units that are defined
in the Unit class. Values are available in pixels – Unit.Pixel(), points –
Unit.Point() and percentage – Unit.Percentage(). By default, the width is
100%.
Height Specifies the height of the component to the required units that are defined
in the Unit class. Values are available in pixels – Unit.Pixel(), points –
Unit.Point() and percentage – Unit.Percentage(). By default, the automatic
height is set depending on the size of the report page, or 600 pixels in the
display mode of the viewer with scroll bars.
8.14.1 Actions
This group includes properties that define the names of actions in the view controller, which will cause
the client side report viewer using the appropriate functions.
Name Description
ViewerEvent Specifies the name of the action method of major viewer events, such as
flipping through pages of the report, scaling, change the display mode of
pages, printing and exporting the report, working with parameters and
interactivity. This action is mandatory.
PrintReport Specifies the name of the action method of the report printing.
ExportReport Specifies the name of the action method of the report export into the
required format.
EmailReport Specifies the name of the action method to send the report by Email.
© 2003-2015 Stimulsoft
MVC Viewer 102
Interaction Specifies the name of the action method for working the viewer with
interactive operations such as the use of parameters, dynamic sorting, drill
down and detailing the report.
8.14.2 Server
This group includes the properties that are responsible for the connecting parameters of the client and
server sides.
Name Description
Controller Specifies the name of the controller for processing report viewer queries. If
this option is not specified, then the query will be used by the current
controller.
RequestTimeout Waiting for the response from the server in seconds, after which an error is
thrown. By default it is set to 20 seconds. For big reports it is recommended
to increase this value.
CacheTimeout Sets time in minutes the rendered report will be stored on the server since
the last action of the viewer. By default value is set to 20 minutes.
CacheMode Sets the cache mode of the report. It can have one of the following values:
StiServerCacheMode.None – caching is disabled, the report will be loaded
again using the GetReportSnapshot action.
StiServerCacheMode.ObjectCache – the server cache is used as a
repository (by default). The report is stored as an object.
StiServerCacheMode.ObjectSession – the session is used as a repository.
The report is stored as an object.
StiServerCacheMode.StringCache – the server cache is used as a
repository. The report is serialized into the packed string.
StiServerCacheMode.StringSession – the session is used as a repository.
The report is serialized into the packed string.
GlobalReportCache Sets the mode of the common report cache for all clients, otherwise a
separate object cache will be kept for each client. It must be disabled, if the
same report uses different data bases. By default the cache is set to
common.
CacheItemPriority Sets the priority of the report stored in the server cache. This option affects
the automatic cleaning of the server's memory in case of lack of it. The lower
the priority is, the greater is the chance of removing information from
memory.
UseRelativeUrls Sets the viewer mode, in which the server uses relative links for AJAX
requests. By default it is set to false.
PassFormValues Enables sending values of the POST form to the client side, if these values
are required to be used in the actions of the viewer. When you enable this
© 2003-2015 Stimulsoft
103 Stimulsoft Reports
8.14.3 Appearance
This group includes properties that affect the appearance of the viewer.
Name Description
PageBorderColor Sets the border color of report pages. By default it is set to Color.Gray.
RightToLeft Sets the Right to Left mode for viewer controls. By default it is set to false.
FullScreenMode Sets the full screen mode of the report viewer. By default it is set to false.
ScrollbarsMode Sets the mode of displaying the report viewer without scroll bars or with
them. By default it is set to false.
OpenLinksTarget Target window to open the link contained in the report. By default it is set to
"_self" (current window).
OpenExportedReport Target window to open the export file from the viewer. By default it is set to
Target "_blank" (new window).
ShowTooltips Displays tips for the viewer controls when hovering the mouse. By default it
is set to true.
PageAlignment Sets the position of the report page in the viewer window.
StiContentAlignment.Left – the page is aligned by the left side of the
viewer.
StiContentAlignment.Center – the page is aligned by the center (by
default);
StiContentAlignment.Right – the page will be aligned by the right side of
the viewer.
BookmarksPrint Prints report bookmarks on the printer (in addition to the report). By default
it is set to false.
BookmarksTreeWidt Sets the width of the bookmark panel in pixels. By default the width is 180
h pixels.
ParametersPanelMax Sets the maximum height of the parameter panel in pixels. By default the
Height maximum height is set to 300 pixels.
ParametersPanelColu Sets the number of columns for showing report parameters. By default
mnsCount partition is made on 2 columns.
ParametersPanelDat Sets the date format and time for variables of the corresponding type on the
© 2003-2015 Stimulsoft
MVC Viewer 104
eFormat parameters panel. By default the date and time format set by the browser is
used.
InterfaceType Sets the type of the interface viewer. Can take the following values:
StiInterfaceType.Auto – the interface type of the report viewer is selected
automatically depending on the device used (by default).
StiInterfaceType.Mouse – forced use of the interface to manage viewer
using the mouse device.
StiInterfaceType.Touch – force the use of the touch interface to manage
viewer using the touch screen (mobile devices).
ChartRenderType Sets the type of drawing charts on the report page. It has the following
values:
StiChartRenderType.AnimatedVector – charts are drawn in the vector
mode with animation (default);
StiChartRenderType.Vector – charts are drawn as vector images;
StiChartRenderType.Image – charts are drawn as images.
8.14.4 Toolbar
This group includes properties that affect displaying the toolbar and its elements.
Name Description
Visible Shows/hides the toolbar of the report viewer. By default the option is set to
true.
BackgroundColor Changes the toolbar color. By default, the color palette of the selected
theme is used.
BorderColor Changes the color of the toolbar borders. By default, the color palette of the
selected theme is used.
FontColor Changes the font color for the toolbar and menu. By default, the color
palette of the selected theme is used.
FontFamily Changes the font family for the toolbar and menu. By default, the font of
selected theme is used.
ShowButtonCaptions Shows/hides the buttons of the viewer toolbar. By default the option is set
to true.
© 2003-2015 Stimulsoft
105 Stimulsoft Reports
ShowPrintButton Shows/hides the button Print on the toolbar of the report viewer. By default
the option is set to true.
ShowSaveButton Shows/hides the button Save on the toolbar of the report viewer. By default
the option is set to true.
ShowSendEmailButto Shows/hides the button Send Email on the toolbar of the report viewer. By
n default the option is set to false.
ShowBookmarksButt Shows/hides the button Bookmarks on the toolbar of the report viewer. By
on default the option is set to true. If this button is hidden then the toolbar
panel will not be shown even if bookmarks are present in the report.
ShowParametersButt Shows/hides the button Parameters on the toolbar of the report viewer. By
on default the option is set to true. If this button is hidden then the toolbar
panel will not be shown even if bookmarks are present in the report.
ShowEditorButton Shows/hides the Editor button on the report viewer toolbar. By default, this
option is set to true. If the report does not have editable components, the
button will be hidden regardless of the property value.
ShowFullScreenButto Shows/hides the button Full Screen on the toolbar of the report viewer. By
n default the option is set to true.
ShowFirstPageButto Shows/hides the button First Page on the toolbar of the report viewer. By
n default the option is set to true.
ShowPreviousPageB Shows/hides the button Previous Page on the toolbar of the report viewer.
utton By default the option is set to true.
ShowCurrentPageCo Shows/hides the indicator of the current report page. By default the option is
ntrol set to true.
ShowNextPageButto Shows/hides the button Next Page on the toolbar of the report viewer. By
n default the option is set to true.
ShowLastPageButton Shows/hides the button Last Page on the toolbar of the report viewer. By
default the option is set to true.
ShowZoomButton Shows/hides the button for selecting the report zoom. By default the option
is set to true.
© 2003-2015 Stimulsoft
MVC Viewer 106
ShowViewModeButt Shows/hides the button for selecting viewing modes of report pages. By
on default the option is set to true.
ShowDesignButton Shows/hides the button Design on the toolbar of the report viewer. By
default the option is set to false.
ShowAboutButton Shows/hides the button About on the toolbar of the report viewer. By
default the option is set to true.
Zoom Sets zoom of report pages. By default, it is 100 percent. Values vary from 10
to 500 percent.
StiZoomMode.PageWidth – when you run the viewer the zoom will be set
to display the report by the page width.
StiZoomMode.PageHeight – when you run the viewer the zoom will be set
to display the report by the page height.
MenuAnimation Disables animation when showing/hiding the menu of the report viewer. By
default the option is set to true.
With this group of properties, you can configure the menu to exporting reports.
Name Description
DefaultSettings Sets default export settings for each export type. These settings will be
applied to dialog windows of exports when calling them or to reports in
© 2003-2015 Stimulsoft
107 Stimulsoft Reports
ShowExportDialog Shows/hides the export parameters dialog. If the dialog window is disabled
then exporting will be processed with the standard settings. It is enabled by
default.
ShowExportToDocu Shows/hides the menu item Document File. By default the option is set to
ment true.
ShowExportToPdf Shows/hides the menu item Adobe PDF File. By default the option is set to
true.
ShowExportToXps Shows/hides the menu item Microsoft XPS File. By default the option is set
to true.
ShowExportToHtml Shows/hides the menu item HMTL File. By default the option is set to true.
ShowExportToHtml5 Shows/hides the menu item HMTL5 File. By default the option is set to true.
ShowExportToMht Shows/hides the menu item MHT Web Archive. By default the option is set
to true.
ShowExportToText Shows/hides the menu item Text File. By default the option is set to true.
ShowExportToRtf Shows/hides the menu item Rich Text File. By default the option is set to
true.
ShowExportToWord2 Shows/hides the menu item Microsoft Word 2007/2010 File. By default the
007 option is set to true.
ShowExportToOpen Shows/hides the menu item OpenDocument Writer File. By default the
DocumentWriter option is set to true.
ShowExportToExcel Shows/hides the menu item Microsoft Excel File. By default the option is set
to true.
ShowExportToExcelX Shows/hides the menu item Microsoft Excel Xml File. By default the option
ml is set to true.
© 2003-2015 Stimulsoft
MVC Viewer 108
ShowExportToExcel2 Shows/hides the menu item Microsoft Excel 2007/2010 File. By default the
007 option is set to true.
ShowExportToOpen Shows/hides the menu item OpenDocument Calc File. By default the option
DocumentCalc is set to true.
ShowExportToCsv Shows/hides the menu item CSV File. By default the option is set to true.
ShowExportToDbf Shows/hides the menu item DBF File. By default the option is set to true.
ShowExportToXml Shows/hides the menu item XML File. By default the option is set to true.
ShowExportToDif Shows/hides the menu item Data Interchange Format (DIF) File. By default
the option is set to true.
ShowExportToSylk Shows/hides the menu item Symbolic Link (SYLK) File. By default the option
is set to true.
ShowExportToImage Shows/hides the menu item BMP Image. By default the option is set to true.
Bmp
ShowExportToImage Shows/hides the menu item GIF Image. By default the option is set to true.
Gif
ShowExportToImage Shows/hides the menu item JPEG Image. By default the option is set to true.
Jpeg
ShowExportToImage Shows/hides the menu item PCX Image. By default the option is set to true.
Pcx
ShowExportToImage Shows/hides the menu item PNG Image. By default the option is set to true.
Png
ShowExportToImage Shows/hides the menu item TIFF Image. By default the option is set to true.
Tiff
ShowExportToImage Shows/hides the menu item Windows Metafile. By default the option is set
Metafile to true.
ShowExportToImage Shows/hides the menu item Scalable Vector Graphics (SVG) File. By default
Svg the option is set to true.
ShowExportToImage Shows/hides the menu item Compressed SVG (SVGZ) File. By default the
Svgz option is set to true.
© 2003-2015 Stimulsoft
109 Stimulsoft Reports
This group includes properties responsible for the default values for the send Email dialog form.
Name Description
ShowEmailDialog Shows/hides the dialog box options for sending the report by Email. If the
dialog box is disabled, then sending by Email will be made by the settings
set on the server side in the EmailReport action. By default the option is set
to true.
ShowExportDialog Shows/hides dialog boxes of export parameters when sending Email. If this
option is disabled, the export will be carried out with the default settings. By
default the option is set to true.
DefaultEmailAddress Defines the recipient Email, the address which an email with an attached
report will be sent to.
DefaultEmailSubject Defines the e-mail subject, the value of this option will be a subject of this
Email.
9 MVC ViewerFx
The StiMvcViewerFx component is used to edit reports in the window of a browser. And there is no
need to install the .NET Framework, ActiveX components and other special plug-ins on the client
machine. The only requirements are a web browser and the Flash player. Using StiMvcViewerFx it is
possible to create, edit, save, view, and print reports on any computer, on any OS, where there is an
internet connection, and where there is the installed web browser and Flash Player 10.2 and higher.
The StiMvcViewerFx component can be divided in two parts: client and server. The client side is the
graphic wrapping of the designer that is realized on Flex. The server side is the report generator
engine and, also, a module that has functions to get queries and send data on the client side. These
two parts are collected into one DLL library and represented as a non visual ASP.NET MVC
component.
The MVC ViewerFx component is located in the StiMvcViewerFx class. The minimum required set of
libraries for components is
Stimulsoft.Base.dll
Stimulsoft.Report.dll
Stimulsoft.Report.Mvc.dll
To run the web report designer, it is required to put the StiMvcViewerFx component on the view page,
© 2003-2015 Stimulsoft
MVC ViewerFx 110
set the required properties, and define necessary actions in the view controller. When running the
report viewer the following actions occur:
The .NET component generates HTML and Javascript code for displaying and working the
report viewer.
When it is loaded, the Flash application is run. It requests the whole report on the server side
and displays it.
Interactive actions, such as exporting reports, applying parameters, sorting and drill down of
reports, cause a specific action on the server side, where you can perform the necessary manipulations
with the report.
In order to display reports, you must add the MVC ViewerFx component on a page and set the
minimum required options to it. In the view controller you should determine appropriate actions. The
GetReportSnapshot action returns the prepared report to the report viewer.
ASPX:
Razor:
@Html.Stimulsoft().StiMvcViewerFx(new StiMvcViewerFxOptions() {
Actions =
{
GetReportSnapshot = "GetReportSnapshot"
}
})
Controller:
return StiMvcViewerFx.GetReportSnapshotResult(report);
}
© 2003-2015 Stimulsoft
111 Stimulsoft Reports
If the report was not rendered before being displayed, the MVC ViewerFx component will build it
automatically. Thus, to display the report it is allowed to use report templates, rendered reports and
reports as classes.
Controller:
return StiMvcViewerFx.GetReportSnapshotResult(report);
}
Controller:
return StiMvcViewerFx.GetReportSnapshotResult(report);
}
© 2003-2015 Stimulsoft
MVC ViewerFx 112
Also, before displaying the report it is allowed to change its properties, assigning parameters and
registering data sets. For example:
Controller:
© 2003-2015 Stimulsoft
113 Stimulsoft Reports
report.RegData("Demo", ds);
return StiMvcViewerFx.GetReportSnapshotResult(report);
}
The special Localization option is used in order to localize the interface of the report viewer to the
required language. The value of this option will be a path (relative or absolute) to the XML localization
file.
ASPX:
Razor:
@Html.Stimulsoft().StiMvcViewerFx(new StiMvcViewerFxOptions() {
Localization = "~/Content/Localization/en.xml"
})
When you load the report viewer the localization file will be loaded automatically.
The MVC ViewerFx component has the ability to change the appearance of visual controls. The Theme
option is used to change the theme of the report viewer. The option can be one of the enumeration
values of StiThemeFx.
ASPX:
Razor:
@Html.Stimulsoft().StiMvcViewerFx(new StiMvcViewerFxOptions() {
Theme = StiThemeFx.Office2013
})
© 2003-2015 Stimulsoft
MVC ViewerFx 114
The MVC ViewerFx component allows you to export the displayed report to three dozen different
formats such as PDF, Microsoft Word, Excel, XPS, RTF, image formats and many others.
No additional configuration is required for the viewer to operate the export function. If you want to
carry out any action before exporting the report, you can define a special action ExportReport.
© 2003-2015 Stimulsoft
115 Stimulsoft Reports
ASPX:
Razor:
@Html.Stimulsoft().StiMvcViewerFx(new StiMvcViewerFxOptions() {
Actions =
{
ExportReport = "ExportReport"
}
})
Controller:
© 2003-2015 Stimulsoft
MVC ViewerFx 116
The MVC ViewerFx component supports working with interactive reports, such as reports with
parameters, dynamic sorting and drill down. For adding a parameter to the panel you should define
the variable requested by the user. When viewing a report in the viewer such a variable is automatically
added to the panel of parameters. All types of report variables (normal variables, date and time,
borders, lists, etc.) are supported. Dynamic sorting provides the ability to change the sorting direction
in the rendered report. Reports with drill down below the main panel of the viewer will be displayed.
The currently displayed report will be highlighted.
Interactive reports do not require additional configuration of the viewer. If it is necessary to apply
report settings, do some sorting or drill down, the GetReportSnapshot action will be called. In this
© 2003-2015 Stimulsoft
117 Stimulsoft Reports
action the required report template will be loaded again. The parameters passed from the client side
will be automatically applied to the report.
ASPX:
Razor:
@Html.Stimulsoft().StiMvcViewerFx(new StiMvcViewerFxOptions() {
Actions =
{
GetReportSnapshot = "GetReportSnapshot"
}
})
Controller:
return StiMvcViewerFx.GetReportSnapshotResult(report);
}
© 2003-2015 Stimulsoft
MVC ViewerFx 118
The MVC ViewerFx component provides the ability to send a report by Email. Set the
ShowSendEmailButton option of the viewer to true and define the EmailReport action to activate this
ability.
ASPX:
© 2003-2015 Stimulsoft
119 Stimulsoft Reports
EmailReport = "EmailReport"
},
Toolbar =
{
ShowSendEmailButton = true
}
})%>
Razor:
@Html.Stimulsoft().StiMvcViewerFx(new StiMvcViewerFxOptions() {
Actions =
{
EmailReport = "EmailReport"
},
Toolbar =
{
ShowSendEmailButton = true
}
})
Controller:
return StiMvcViewerFx.EmailReportResult(options);
}
After selecting the report format to be sent by Email, the opened dialog displays the input parameters
for sending Email such as recipient, subject and message text.
© 2003-2015 Stimulsoft
MVC ViewerFx 120
Fill the sending options such as an Email address and server settings. If necessary, you can check and
adjust the options of the form to send Email, specified in the viewer. The exported file will be
automatically attached to the letter.
There are several additional methods for working with the report viewer. The methods of the MVC
ViewerFx component are following:
GetReportObject()
Returns an object of the report, with which the viewer is currently working. It is allowed to make
necessary manipulations with it - register new data sets, change report properties, assign parameters
© 2003-2015 Stimulsoft
121 Stimulsoft Reports
return StiMvcViewerFx.ExportReportResult(report);
}
GetRouteValues()
Returns values for the URL with which the viewer page is opened. Thus, it is possible to obtain a
collection of parameters of the running page in any action of the viewer.
return StiMvcViewerFx.ExportReportResult(report);
}
Also, URL values can be obtained by the name of the parameter specifying it in the called action of the
viewer.
The difference between this method of obtaining the parameter of values and the additional method
GetRouteValues() is that the name of the controller and action will depend on the settings of the
viewer and the called action.
Configuring the MVC ViewerFx component is performed using the options that are located in the
StiMvcViewerFxOptions class. Options are divided into eight groups - no groups, Actions, Server,
Appearance, Toolbar, Export, Email, Print. Here is an example below of setting options viewer:
ASPX:
© 2003-2015 Stimulsoft
MVC ViewerFx 122
ExportReport = "ExportReport"
},
Exports =
{
ShowExportDialog = true,
ShowExportToDbf = false,
ShowExportToDif = false
},
Print =
{
AutoPageOrientation = true,
AutoPageScale = true
}
})%>
Razor:
@Html.Stimulsoft().StiMvcViewerFx(new StiMvcViewerFxOptions() {
Theme = StiTheme.Office2013,
Localization = "~/Content/Localization/en.xml",
Actions =
{
GetReportSnapshot = "GetReportSnapshot",
ExportReport = "ExportReport"
},
Exports =
{
ShowExportDialog = true,
ShowExportToDbf = false,
ShowExportToDif = false
},
Print =
{
AutoPageOrientation = true,
AutoPageScale = true
}
})
Name Description
Theme Changes the viewer theme. The list of available themes can found in the
StiThemeFx class.
© 2003-2015 Stimulsoft
123 Stimulsoft Reports
Localization Sets the path to the XML file of the localization. The path can be absolute
and relative.
Width Specifies the width of the component to the required units that are defined
in the Unit class. Values are available in pixels – Unit.Pixel(), points –
Unit.Point() and percentage – Unit.Percentage(). By default, the width is
100%.
Height Sets the height of the component to the required units that are defined in
the Unit class. Values are available in pixels – Unit.Pixel(), points –
Unit.Point() and percentage – Unit.Percentage(). By default, the automatic
height is set to 600 pixels.
9.9.1 Actions
This group includes properties that define the name of actions in the view controller, which will call the
client side report viewer using the appropriate functions.
Name Description
GetReportSnapshot Defines the action method name of preparing the rendered report.
GetLocalization Defines the action method name of loading the XML file with the viewer
localization. If this action is not defined the English localization is set by
default.
ExportReport Defines the action method name of exporting a report to the required
format.
DesignReport Defines the action method name to navigate to the desired view by pressing
the Design button on the viewer panel.
EmailReport Defines the action method name of sending the report by Email.
Exit Defines the action method name to navigate to the desired view by pressing
the Exit button on the viewer panel.
© 2003-2015 Stimulsoft
MVC ViewerFx 124
9.9.2 Server
This group includes properties that define parameters of working with server.
Name Description
Controller Specifies the name of the controller to process queries of the report viewer.
If this option is not specified then the current controller will be used to
process queries.
RequestTimeout The waiting time of the report from the server in seconds after which an
error is thrown. The default setting is 20 seconds. For big reports it is
recommended to increase this value.
RepeatCount Sets the number of repeats of the request in the event of any error of
connection with the server. The default value is 1.
UseRelativeUrls Sets the mode of the viewer in which relative links are used for requests to
the server. By default, this option is set to false.
9.9.3 Appearance
Name Description
AutoHideScrollbars Hides scrollbars in the viewer if the page does not entirely fit the page. By
default, this property is set to false.
OpenLinksTarget Target window to open links contained in the report. By default, this
property is set to "_blank" (new window).
OpenExportedReport Target window to open an export file from the viewer. By default, this
Target property is set to "_blank" (new windows).
ShowTooltipsHelp Showing a link to the online help in pop-up hints when hovering a mouse
over viewer controls. By default, this property is set to true.
ShowFormsHelp Showing links to the online help in the header of the viewer dialogs. By
default, this property is set to true.
© 2003-2015 Stimulsoft
125 Stimulsoft Reports
ShowFormsHint Showing a hint when hovering over the interface items in dialogs of the
viewer. By default, this property is set to true.
ParametersPanelColu Sets the number of columns for showing report parameters. 2 columns are
mnsCount set by default.
ParametersPanelEdit Sets the width of items of the parameters panel in pixels. By default it is set
orWidth to 200 pixels.
ParametersPanelDate Sets the format of date and time for variables of the corresponding type on
Format the panel of parameters. By default, the data and time format set on the
server is used.
FlashWMode Set the mode of showing a Flash application in the browser page. By default,
this property is set to "window".
AboutDialogTextLine Sets a text for the About box. The text will be shown in the first line of the
1 box.
AboutDialogTextLine Sets a text for the About box. The text will be shown in the second line of
2 the box.
AboutDialogUrl Sets the URL to show it in the About box in the viewer.
AboutDialogUrlText Set the text of the URL to show it in the About box.
ShowCancelButton Shows/hides the Cancel button in the loading data window from the server
side. By default, this property is set to false.
9.9.4 Toolbars
This group includes properties that are used to show or hide the viewer items.
Name Description
Visible Shows/hides the toolbar of the viewer. By default the option is set to true.
ShowNavigatePanel Shows/hides the navigation panel of the viewer. By default the option is set
to true.
ShowViewModePane Shows/hides the viewing mode panel of the viewer. By default the option is
l set to true.
ShowPrintButton Shows/hides the button Print on the toolbar of the report viewer. By default
the option is set to true.
ShowOpenButton Shows/hides the button Open on the toolbar of the report viewer. By default
the option is set to true.
ShowSaveButton Shows/hides the button Save on the toolbar of the report viewer. By default
the option is set to true.
ShowSendEmailButto Shows/hides the button Send Email on the toolbar of the report viewer. By
n default the option is set to false.
© 2003-2015 Stimulsoft
MVC ViewerFx 126
ShowBookmarksButt Shows/hides the button Bookmarks on the toolbar of the report viewer. By
on default the option is set to true.
ShowParametersButt Shows/hides the button Parameters on the toolbar of the report viewer. By
on default the option is set to true.
ShowThumbnailsBut Shows/hides the button Thumbnails on the toolbar of the report viewer. By
ton default the option is set to true.
ShowFindButton Shows/hides the button Find on the toolbar of the report viewer. By default
the option is set to true.
ShowFullScreenButto Shows/hides the button Full Screen on the toolbar of the report viewer. By
n default the option is set to true.
ShowExitButton Shows/hides the button Exit on the toolbar of the report viewer. By default
the option is set to true.
ShowAboutButton Shows/hides the button About on the toolbar of the report viewer. By
default the option is set to true.
ShowDesignButton Shows/hides the button Design on the toolbar of the report viewer. By
default the option is set to true.
ShowFirstPageButto Shows/hides the button First Page on the navigation panel of the report
n viewer. By default the option is set to true.
ShowPreviousPageB Shows/hides the button Previous Page on the navigation panel of the report
utton viewer. By default the option is set to true.
ShowGoToPageButto Shows/hides the button Go To Page on the navigation panel of the report
n viewer. By default the option is set to true.
ShowNextPageButto Shows/hides the button Next Page on the navigation panel of the report
n viewer. By default the option is set to true.
ShowLastPageButton Shows/hides the button Last Page on the navigation panel of the report
viewer. By default the option is set to true.
ShowSinglePageView Shows/hides the button Single Page on the viewing mode panel of the
ModeButton report viewer. By default the option is set to true.
ShowContinuousPag Shows/hides the button Continuous Page on the viewing mode panel of the
eViewModeButton report viewer. By default the option is set to true.
ShowMultiplePageVi Shows/hides the button Multiple Page on the viewing mode panel of the
ewModeButton report viewer. By default the option is set to true.
ShowZoomButtons Shows/hides the zoom buttons. By default the option is set to true.
Zoom Sets zoom for reprt pages. By default, it is 100 percent. Values vary from 10
to 500 percent. The following values are available:
StiZoomModeFx.Default – when you run the viewer the zoom that was
used previously will be set (set by default).
StiZoomModeFx.OnePage – when you run the viewer the zoom will be set
to display a whole page of the report.
© 2003-2015 Stimulsoft
127 Stimulsoft Reports
StiZoomModeFx.TwoPages – when you run the viewer the zoom will be set
to display 2 pages of the report.
StiZoomModeFx.PageWidth – when you run the viewer the zoom will be
set to display the report by the page width.
9.9.5 Exporting
Name Description
ShowExportDialog Shows/hides the exporting dialog. If the property is set to true, the dialog
will be displayed. If it is set to false, then the dialog will be hidden. By
default, this property is set to true.
ShowExportToDocu Shows/hides the menu item Document File. If the property is set to true, the
ment menu item will be displayed. If it is set to false, then the menu item will be
hidden. By default, this property is set to true.
ShowExportToPdf Shows/hides the menu item Adobe PDF File. If the property is set to true, the
menu item will be displayed. If it is set to false, then the menu item will be
hidden. By default, this property is set to true.
ShowExportToXps Shows/hides the menu item Microsoft XPS File. If the property is set to true,
the menu item will be displayed. If it is set to false, then the menu item will
be hidden. By default, this property is set to true.
ShowExportToPower Shows/hides the menu item Microsoft PowerPoint 2007/2010 File. If the
Point property is set to true, the menu item will be displayed. If it is set to false,
then the menu item will be hidden. By default, this property is set to true.
ShowExportToHtml Shows/hides the menu item HMTL File. If the property is set to true, the
menu item will be displayed. If it is set to false, then the menu item will be
hidden. By default, this property is set to true.
ShowExportToHtml5 Shows/hides the menu item HMTL5 File. If the property is set to true, the
menu item will be displayed. If it is set to false, then the menu item will be
hidden. By default, this property is set to true.
ShowExportToMht Shows/hides the menu item MHT Web Archive. If the property is set to true,
the menu item will be displayed. If it is set to false, then the menu item will
be hidden. By default, this property is set to true.
ShowExportToText Shows/hides the menu item Text File. If the property is set to true, the menu
item will be displayed. If it is set to false, then the menu item will be hidden.
By default, this property is set to true.
ShowExportToRtf Shows/hides the menu item Rich Text File. If the property is set to true, the
menu item will be displayed. If it is set to false, then the menu item will be
hidden. By default, this property is set to true.
© 2003-2015 Stimulsoft
MVC ViewerFx 128
ShowExportToWord2 Shows/hides the menu item Microsoft Word 2007/2010 File. If the property
007 is set to true, the menu item will be displayed. If it is set to false, then the
menu item will be hidden. By default, this property is set to true.
ShowExportToOpen Shows/hides the menu item OpenDocument Writer File. If the property is set
DocumentWriter to true, the menu item will be displayed. If it is set to false, then the menu
item will be hidden. By default, this property is set to true.
ShowExportToExcel Shows/hides the menu item Microsoft Excel File. If the property is set to
true, the menu item will be displayed. If it is set to false, then the menu item
will be hidden. By default, this property is set to true.
ShowExportToExcelX Shows/hides the menu item Microsoft Excel Xml File. If the property is set
ml to true, the menu item will be displayed. If it is set to false, then the menu
item will be hidden. By default, this property is set to true.
ShowExportToExcel2 Shows/hides the menu item Microsoft Excel 2007/2010 File. If the property
007 is set to true, the menu item will be displayed. If it is set to false, then the
menu item will be hidden. By default, this property is set to true.
ShowExportToOpen Shows/hides the menu item OpenDocument Calc File. If the property is set
DocumentCalc to true, the menu item will be displayed. If it is set to false, then the menu
item will be hidden. By default, this property is set to true.
ShowExportToCsv Shows/hides the menu item CSV File. If the property is set to true, the menu
item will be displayed. If it is set to false, then the menu item will be hidden.
By default, this property is set to true.
ShowExportToDbf Shows/hides the menu item DBF File. If the property is set to true, the menu
item will be displayed. If it is set to false, then the menu item will be hidden.
By default, this property is set to true.
ShowExportToXml Shows/hides the menu item XML File. If the property is set to true, the menu
item will be displayed. If it is set to false, then the menu item will be hidden.
By default, this property is set to true.
ShowExportToDif Shows/hides the menu item Data Interchange Format (DIF) File. If the
property is set to true, the menu item will be displayed. If it is set to false,
then the menu item will be hidden. By default, this property is set to true.
ShowExportToSylk Shows/hides the menu item Symbolic Link (SYLK) File. If the property is set
to true, the menu item will be displayed. If it is set to false, then the menu
item will be hidden. By default, this property is set to true.
ShowExportToImage Shows/hides the menu item BMP Image. If the property is set to true, the
Bmp menu item will be displayed. If it is set to false, then the menu item will be
hidden. By default, this property is set to true.
ShowExportToImage Shows/hides the menu item GIF Image. If the property is set to true, the
Gif menu item will be displayed. If it is set to false, then the menu item will be
hidden. By default, this property is set to true.
ShowExportToImage Shows/hides the menu item JPEG Image. If the property is set to true, the
Jpeg menu item will be displayed. If it is set to false, then the menu item will be
© 2003-2015 Stimulsoft
129 Stimulsoft Reports
ShowExportToImage Shows/hides the menu item PCX Image. If the property is set to true, the
Pcx menu item will be displayed. If it is set to false, then the menu item will be
hidden. By default, this property is set to true.
ShowExportToImage Shows/hides the menu item PNG Image. If the property is set to true, the
Png menu item will be displayed. If it is set to false, then the menu item will be
hidden. By default, this property is set to true.
ShowExportToImage Shows/hides the menu item TIFF Image. If the property is set to true, the
Tiff menu item will be displayed. If it is set to false, then the menu item will be
hidden. By default, this property is set to true.
ShowExportToImage Shows/hides the menu item Windows Metafile. If the property is set to true,
Metafile the menu item will be displayed. If it is set to false, then the menu item will
be hidden. By default, this property is set to true.
ShowExportToImage Shows/hides the menu item Scalable Vector Graphics (SVG) File. If the
Svg property is set to true, the menu item will be displayed. If it is set to false,
then the menu item will be hidden. By default, this property is set to true.
ShowExportToImage Shows/hides the menu item Compressed SVG (SVGZ) File. If the property is
Svgz set to true, the menu item will be displayed. If it is set to false, then the menu
item will be hidden. By default, this property is set to true.
With this group of properties one can modify options to send Email.
Name Description
ShowEmailDialog Shows/hides the dialog window of sending reports by Email. If the option is
disabled then sending by Email will be done with settings set on the server
side in the EmailReport action. By default, this property is set to true.
9.9.7 Printing
Name Description
ShowPrintDialog Shows/hides the dialog box of printing parameters. If the dialog is hidden
© 2003-2015 Stimulsoft
MVC ViewerFx 130
then printing will be done by default settings. By default the option is set to
true.
AutoPageOrientation Enables automatic page orientation when printing a report, if the incorrect
printing format is set. By default the option is set to true.
AutoPageScale Enables automatic scaling when printing the report, if incorrect size is set in
the printer settings. By default the option is set to true.
AllowDefaultPrint Shows/hides the printing item Default in the printing dialog. By default the
option is set to true.
AllowPrintToPdf Shows/hides the printing item Print as PDF in the printing dialog. By default
the option is set to true.
AllowPrintToHtml Shows/hides the printing item Print as HTML in the printing dialog. By
default the option is set to true.
10 Web ViewerFx
Put the StiWebViewerFx component on a web page. Then you need to use the following code to show
a report:
C#:
VB.NET:
If the report was not rendered before showing, then the WebViewerFx component renders it
automatically. Loading a report after loading the viewer is done using the OnGetReport event. After
subscription to this event, it will occur each time when the viewer needs a report. In other words, after
loading WebViewerFx requests the report from the server and, if the subscription to the OnGetReport
event is done, then, in this event, the report can be assigned to the designer. Below is a code example,
using the OnGetReport event:
© 2003-2015 Stimulsoft
131 Stimulsoft Reports
If the report has not been rendered before being displayed, the WebViewerFx component renders it
automatically.
If it is required to show WebViewerFx to the entire browser window, you can use the following method:
In this case, in the entire region in the current browser window a viewer will be displayed. All other
items are located on the .aspx page will not be displayed.
The StiWebViewerFx component has thew ability to change the themes of the viewer. The theme can
be changed using the ThemeName property. For example, ThemeName="Black".
© 2003-2015 Stimulsoft
Web ViewerFx 132
Setting the WebViewerFx can be done using the static properties, which are described in the
StiWebViewerFxOptions. class. Static properties of the WebViewerFx can be divided into following
groups: Connection, Zooming and Toolbar.
10.4.1 Connection
The static properties described below belong to the StiWebViewerFxOptions.Connection group and
responsible for connecting the client and server sides:
Name Description
ClientRequestTimeout property sets time (in seconds) that the client part will wait the response
from the server side. The default value is 10 seconds.
ClientRepeatCount property sets the number of repeats of requests of the server side to the
client side, when getting errors of obtaining data. The default value is 2
repeats.
RelativeUrls property allows using the relative Url. If the RelativeUrls is set to false,
then the absolute Url is used. If the RelativeUrls is set to true, then the
relative Url is used. By default, the value is set to false. A sample of the
absolute and relative Urls is shown below:
http://localhost:4444/WebViewerDemo/WebViewer.aspx is an
absolute Url, the RelativeUrls property is set to false;
/WebViewerDemo/WebViewer.aspx is a relative Url, the RelativeUrls
property is set to true.
© 2003-2015 Stimulsoft
133 Stimulsoft Reports
10.4.2 Zooming
The group of static properties Zoom has one StiZoomMode static property. Depending on the values
of this property it is possible to set report template zoom. This property has the following values:
PageWidth, PageHeight, OnePage, Zoom25, Zoom50, Zoom75, Zoom100, Zoom150, Zoom200.
Name Description
Default Value sets previously saved report zoom in WebViewerFx. So, if a report
was saved with 37% zoom then, when opening it the next time, the report
is shown in 37% zoom.
PageWidth Value sets zoom by Page Width. So the width of the report template
matches the width of the web viewer window.
OnePage Value sets zoom by One Page. So the entire page of the report template
fits in the window of the web viewer.
TwoPages Value sets zoom by Two Pages. So two report pages will be shown by
width and height in the WebViewerFx.
Zoom25, Zoom50, Value sets zoom level of the report template which is 25%, 50%, 75%,
Zoom75, Zoom100, 100%, 150%, 200%.
Zoom150, Zoom200
Name Description
ShowZoom Property is used to show/hide the zoom panel. If the ShowZoom property
is set to true, then the zoom panel will be shown. If the ShowZoom
property is set to false, then the zoom panel will be hidden. By default this
property is set to true.
© 2003-2015 Stimulsoft
Web ViewerFx 134
© 2003-2015 Stimulsoft
135 Stimulsoft Reports
10.5 Properties
The ServerTimeout property is used to define time of storing a report in the server cache. By
default, this property is set to "00:10:00", this means that the report is stored 10 minutes in the server
cache and then it is removed.
The Background property is used to change the background color. By default, this property is set to
White, this means that the background color is white. It is also possible to set any color in the #rrggbb
format and transparent color.
The DataEncryption property is used to enable/disable data encryption. If the DataEncryption
property is set to false, then data are not encrypted. If the DataEncryption property is set to true, then
© 2003-2015 Stimulsoft
Web ViewerFx 136
The Localization property is used to specify the ability to localize the WebViewerFx UI in any of 26
languages available. The Localization property should be set to the value. The value is the .xml file in
the Localization folder of the root directory in the project). By default, this property is set to "en", this
means that the UI is localized in English. A code sample for setting the Localization property of the
WebViewerFx UI to English language ("en") is shown below:
The ImageQuality property is used to change the quality of images in the report. depending on the
value of this property it is possible to change the image file size and image quality. If the ImageQuality
property is set to Low, then the file size and quality will be low. If the ImageQuality property is set to
Normal, then the file size and quality will have optimal ratio between size and quality. If the
ImageQuality property is set to High, then the file size and quality will be the highest.
The ThemeName property is used to change the style the theme of the WebViewerFx. If the
ThemeName property is set to Blue, then the style of the viewer will be as shown on the picture below:
© 2003-2015 Stimulsoft
137 Stimulsoft Reports
If the ThemeName property is set to Silver, then the style of the viewer will look as shown on the
picture below:
If the ThemeName property is set to Black, then the style of the viewer will look as shown on the
picture below:
© 2003-2015 Stimulsoft
Web ViewerFx 138
It is possible to customize a list of export formats. In other words, it is possible to hide unused export
formats. Customization of the export formats list can be done by using the WebViewerFx properties.
For example - export to HTML. Availability of this format in the list of formats for export depends on
the value of the ShowExportToHtml property. The picture below shows the full list of formats:
© 2003-2015 Stimulsoft
139 Stimulsoft Reports
As seen in the picture above the Html format is shown in the list of formats, and this means that the
ShowExportToHtml property is set to true. If the set this property to false (code below):
then the HTML format will not be shown in the list of export formats. The picture below shows a list of
formats without HTML:
© 2003-2015 Stimulsoft
Web ViewerFx 140
10.7 Data
To preview the report data are required. By default, data are taken from the Dictionary of the edited
report. If necessary, they can be overridden. To do this you need to add the handler to the GetDataSet
event. There is a sample code below using what data can be overridden:
© 2003-2015 Stimulsoft
141 Stimulsoft Reports
C#:
VB.NET:
As seen from code, data are taken from XML and XSD files. The same way exists for other data
sources.
11 Flex Viewer
The Viewer.Fx component is delivered with Stimulsoft Reports.Fx. This component is used to show
reports in Flex applications.
© 2003-2015 Stimulsoft
Flex Viewer 142
Also, there is another way to show a report instead of placing Viewer.Fx on the scene of a Flex
application:
If a report is shown in the dialog window, i.e. ability to set parameters of dialog window.
It is possible to setup user interface, i.e. it is possible to hide some buttons or panels. On the picture
above only 4 buttons of 9 are shown. The code below shows how to get this result:
StiOptions.viewer.toolbar.showOpenButton = false;
© 2003-2015 Stimulsoft
143 Stimulsoft Reports
StiOptions.viewer.toolbar.showSaveButton = false;
StiOptions.viewer.toolbar.showThumbnailsButton = false;
StiOptions.viewer.toolbar.showBookmarksButton = false;
StiOptions.viewer.toolbar.showFindButton = false;
In other words each button has the show function. This function has two values: true or false. The
default value of this function is true.
StiOptions.viewer.toolbar.showZoom = false
The StiWebDesignerSL component is designed to edit reports in a window of a browser. You do not
need to install .NET Framework, ActiveX components or other special plug-ins on the client. All you
need is a Web browser and Silverlight Runtime. With StiWebDesignerSL it is possible to create, edit,
save, view and print reports on any computer with any operating system, where there is Internet access
and a Web browser with installed Silverlight Runtime version 4. StiWebDesignerSL is an ASP.NET
component. It can be divided into two parts: client and server. Client side is a graphical part of the
designer, realized under the Silverlight technology. Server side is a report engine and a module that
performs the functions of receiving requests and passing data to the client side of the designer. These
two parts are assembled into a single dll library and presented as a component.
© 2003-2015 Stimulsoft
Web Designer in Silverlight 144
To run the web report designer, it is required to put the StiWebDesignerSL component on the ASP.NET
page. Then, in the PageLoad event of a page, you need to assign a report to the Report property of a
component. An ASP.NET component will read the Silverlight-client application into memory from
resources and run it. Being loaded, the client side will request all necessary settings and a report file
from the server side. The server part will pass this. When you save or preview the report, the client side
sends the report as an XML the file, and server will perform preliminary processing of the report, and
transfer this file for saving, or compiles it and displays in a browser window.
For running the Web report designer it is necessary to put non visual StiWebDesignerSL component
on the form and, in the event handler of a control, to call the Design() method:
ASP.NET:
C#:
For loading a report in the Web designer, the method of calling can be slightly modified:
C#:
One of the following methods can be used to load a report to the Web designer:
Loading a report before loading the designer;
Loading a report after loading the designer;
Loading a report from the main menu of the designer.
© 2003-2015 Stimulsoft
145 Stimulsoft Reports
Loading a report before loading the designer. In this way the report (for example, from a file) is
loaded first and then the designer is loaded. The previously loaded report is specified as a parameter
of a method of calling the designer. A code below is a sample for loading a report before loading the
designer:
or, as a way, the previously loaded report is assigned to the designer. In this case designer loading is
done with this report. See the code below:
Loading a report after loading the designer is done using the GetReport event. After adding the
handler to this event, it will occur each time when a report is required for the designer. In other words,
after loading the Web designer requests a report from the server and, if the handler is added to the
GetReport event, then in this event a report can be assigned to the designer. See the code below how
to use the GetReport event:
Loading a report from the main menu of the designer. A report can be loaded by selecting the
Open Report menu item. After selecting this menu item the dialog box for specifying a report for
loading will appear. Also the designer supports loading reports and other report items (for example,
images) using Drag&Drop.
You can preview the report in the window of the Web-designer by selecting the Preview tab in the
designer. The picture below shows tabs of the Web-designer:
© 2003-2015 Stimulsoft
Web Designer in Silverlight 146
Data are required to preview a rendered report. By default, data specified in the Dictionary of the
edited report are taken. If it is necessary, they can be overridden. Below is a sample code with which
overrides the data:
As can be seen from the code, the data is taken from XML and XSD files. In the same way you can
substitute the data from other data sources.
Setting the Web designer can be done using the static properties, which are described in the
Stimulsoft.Report.Web.StiWebDesignerSLOptions class. Static properties of the Web designer can
be divided into following groups: Main menu, Zooming, Viewer.
The main menu of the Web designer can be setup according to user's requirements. This group of
static properties StiWebDesignerSLOptions.Menu allows enabling/disabling the main menu or
submenu items
Name Description
SaveReportAsPage property enables/disables the Save Report As... menu item. If the
Enabled SaveReportAsPageEnabled property is set to true, then the menu item is
enabled and can be available for a user. If false then it is disabled and cannot
be available for a user. By default the property is set to true;
CloseEnabled property enables/disables the Close menu item. If the CloseEnabled property
is set to true, then the menu item is enabled and can be available for a user. If
false then it is disabled and cannot be available for a user. By default the
property is set to true;
© 2003-2015 Stimulsoft
147 Stimulsoft Reports
SavePageAsEnable property enables/disables the Save Page As... menu item. If the
d SavePageAsEnabled property is set to true, then the menu item is enabled and
can be available for a user. If false then it is disabled and cannot be available
for a user. By default the property is set to true;
NewEnabled property enables/disables the New menu item. If the NewEnabled property is
set to true, then the menu item is enabled and can be available for a user. If
false then it is disabled and cannot be available for a user. By default the
property is set to true. The New menu item contains the submenu, where the
submenu item are present. They are: New Report, New Report With Wizard,
New Page. The picture below is shows the submenu of the New item:
12.5.2 Zooming
Name Description
© 2003-2015 Stimulsoft
Web Designer in Silverlight 148
ShowSliderZoomContr Property is used to show/hide the Zoom slider. If the ShowZoom property
ol is set to true, then the Zoom slider will be shown. If the ShowZoom
property is set to false, then the Zoom slider will be hidden. By default,
this property is set to true.
ZoomMode Is used to change report zoom. This property has the following values:
Default, OnePage, TwoPages, PageWidth:
Zoom Provides an opportunity to zoom in the designer. This property can take
any value from 0 to 100, where the value of the Zoom is the zoom
percentage. For example, if the Zoom property is set to 70, the zoom in
the designer will be equal to 70 percent.
12.5.3 Viewer
The group of static StiWebDesignerSLOptions.Viewer. properties allows setting the viewer. The list of
properties is represented below.
Name Description
© 2003-2015 Stimulsoft
149 Stimulsoft Reports
© 2003-2015 Stimulsoft
Web Designer in Silverlight 150
to false, then the Two Pages button will be hidden. By default the property
is set to true.
© 2003-2015 Stimulsoft
151 Stimulsoft Reports
ShowSliderZoomContr Property is used to show/hide the Zoom slider. If the ShowZoom property
ol is set to true, then the Zoom slider will be shown. If the ShowZoom
property is set to false, then the Zoom slider will be hidden. By default the
property is set to true.
Zoom Property is used to change the report zoom in the viewer. This property
can have any value from 0 to 100, where the Zoom value is zoom in
percent.
The PreInit event is used to change Web designer properties. This event occurs before initialization of
the designer, i.e. before passing Web designer properties to the client part of an application. In other
words, to change the Web designer properties from code in it necessary to add the handler to the
PreInit event. The code below shows how to add the handler to the PreInit event and set the
Localization property to en:
Now, when running the Web designer, it will be localized in English. For example, we need to change
the browser title. By default, the browser title is the value of the Report Alias property. If the value is
not set then the Report Name is taken. To change the browser title it is necessary to add the code
below to the event:
© 2003-2015 Stimulsoft
Web Designer in Silverlight 152
StiWebDesignerSL.StiPreInitEventArgs e)
{
e.WebDesignerSL.BrowserTitle = "Stimulsoft";
}
Now, when running the Web designer, Stimulsoft word will be shown as a report title.
The Web designer can be localized in 26 languages. It is necessary to change the value of the
Localization property. The localization file will be applied right after loading the Web designer. See the
code that can be used to change the localization:
When designing a report, a user may process events via the WCF server. For this you need to set the
UseWCFService property to true:
Stimulsoft.Report.StiOptions.Silverlight.WCFService.UseWCFService =
true;
When the UseWCFService property is set to true, a user may use the following events:
Stimulsoft.Report.StiOptions.Silverlight.WCFService.WCFRenderReport
Stimulsoft.Report.StiOptions.Silverlight.WCFService.WCFTestConnection
The WCFTestConnection event occurs when clicking the Test Connection button;
Stimulsoft.Report.StiOptions.Silverlight.WCFService.WCFBuildObjects
The WCFBuildObjects event occurs when returning the list tables from the created data source;
Stimulsoft.Report.StiOptions.Silverlight.WCFService.WCFRetrieveColumns
The WCFRetrieveColumns event occurs when returning the list of data columns for the table;
© 2003-2015 Stimulsoft
153 Stimulsoft Reports
Stimulsoft.Report.StiOptions
.Silverlight.WCFService.WCFOpeningReportInDesigner
The WCFOpeningReportInDesigner event occurs when clicking the Open Report button in the main
menu;
Stimulsoft.Report.StiOptions.Engine.GlobalEvents.SavingReportInDesigner
Stimulsoft.Report.StiOptions.Silverlight.WCFService.WCFExportDocument
The WCFExportDocument event occurs when exporting a report by means of the server. In order to
make available a menu with exports in the viewer by means of the server, you must set the
ShowReportSaveToServerButton property to true:
Stimulsoft.Report.StiOptions
.Viewer.Elements.ShowReportSaveToServerButton = true;
Put the StiWebViewerSL component on a web page. Then you need to use the following code to show
a report:
If the report was not rendered before showing, then the WebViewerSL component renders it
automatically. Also the viewer supports loading reports using the Drag&Drop.
Setting the WebViewerSL can be done using the properties, which are described in the
StiWebViewerSL class.
© 2003-2015 Stimulsoft
Silverlight Web Viewer 154
Name Description
© 2003-2015 Stimulsoft
155 Stimulsoft Reports
Name Description
© 2003-2015 Stimulsoft
Silverlight Web Viewer 156
13.2.3 Zooming
Name Description
ShowSliderZoomContr Property is used to show/hide the Zoom slider. If the ShowZoom property
ol is set to true, then the Zoom slider will be shown. If the ShowZoom
property is set to false, then the Zoom slider will be hidden. By default the
property is set to true.
ZoomMode Is used to change report zoom. This property has the following values:
Default, OnePage, TwoPages, PageWidth.
© 2003-2015 Stimulsoft
157 Stimulsoft Reports
Zoom Property is used to change the report zoom in the viewer. This property
can have any value from 0 to 100, where the Zoom value is zoom in
percent.For example, if the Zoom property is set to 70, the zoom in the
viewer will be equal to 70 percent.
When you export a report to any format, saving the report will take place in one of the following saving
modes: Client or Server. Using the SaveMode property it is possible to change the mode of saving. If
the SaveMode property id set to Client, then the report will be saved on the client side of the
WebViewerSL application by means of Silverlight without a server. If the SaveMode property is set to
Server, then saving the report will take place directly on the server, and after saving the report will be
transferred to the client side. Depending on the value of the SaveMode property user will see different
the lists of export formats. The picture below shows lists of exports in various saving modes:
© 2003-2015 Stimulsoft
Silverlight Web Viewer 158
A report opened in WebViewerSL can be exported to many different formats. The list of formats for
export can be customized. In other words, you can hide unused export formats. Customization of the
list of formats of exports can be made by means of WebViewerSL properties. For example the HTML
format, in the Client saving mode. Showing of this format in the list of formats for export depends on
the value of the ShowHtmlButton property. The picture below shows the complete list of formats in
the Client save mode:
© 2003-2015 Stimulsoft
159 Stimulsoft Reports
As can be seen from the picture above, the HTML format is displayed in the list of formats that
corresponds to the ShowHtmlButton property set to true. If you set this property to false:
then the HTML will not be displayed in the list of formats for exporting. The picture below shows a list
of formats for exporting without the Html format:
© 2003-2015 Stimulsoft
Silverlight Web Viewer 160
14 HTML5 Designer
The HTML5 Report Designer is a Web-service. This designer is used to create and edit reports on
mobile devices using a browser. Designer's interface provides the user with easy operation, a huge set
of tools, components, and facilities to develop reports, their visual design and preview.
Name Description
© 2003-2015 Stimulsoft
161 Stimulsoft Reports
CacheMode Defines for the report generator which report cache to use to store
images and service information. You can choose one of the
following options:
Page
Uses the page cache.
Session
Uses the session cache.
ServerTimeout Determines the storage time of the report in the server cache. By
default, this property is set to "00:20:00", equivalent to 20 minutes
of storing the report in the cache, i.e. after 20 minutes, the report
will automatically be removed from the server cache.
Events Description
GetReport Loading a report after loading the report designer is carried out
with help of the GetReport event. After you subscribed to this
event, it will occur each time the designer will need the report. In
other words, after loading, the web designer requests the report
from the server and, if subscribed to the GetReport event, then
you can assign the report to the designer.
Notice: You can assign a report to the designer with help of the GetReport event, but this
also can be done using the Page_Load event.
To load a report in the designer, you need to assign the Report property of the designer. For example,
from a file. If nothing is assigned to the Report property, the designer will be loaded blank and ready
to create a report. Here is the code to load the report.
© 2003-2015 Stimulsoft
HTML5 Designer 162
{
if (Page != null && !Page.IsPostBack)
{
StiReport report = new StiReport();
report.Load("D:\\Result.mrt");
StiMobileDesigner1.Report = report;
}
}
<StiMobileDesigner ID="StiMobileDesigner1"
OnSaveReport="StiMobileDesigner1_SaveReport"
OnLoadReport="StiMobileDesigner1_GetDataSetOnLoad"
OnCreateReport="StiMobileDesigner1_GetDataSetOnCreate />
e.Report.RegData(data);
e.Report.Dictionary.Synchronize();
}
© 2003-2015 Stimulsoft
163 Stimulsoft Reports
StiMobileDesigner.StiGetReportEventArgs e)
{
e.Report.Load(@"D:\TwoSimpleLists.mrt");
e.Report.RegData(data);
}
After creating or editing a report template, you can save changes. This can be done using the
SaveReport event, assigning a saving method. The following example describes a method to store the
report code.
15 HTML5 Viewer
The HTML5 Viewer is used to display reports on mobile devices. The component is able to display
reports, zoom them, save to various formats and also print.
© 2003-2015 Stimulsoft
HTML5 Viewer 164
15.2 Caching
The StiMobileViewer component can output reports in two modes: 1. Using the caching and 2. Without
caching. If the cashing is not used then it is necessary, when every page refreshing, to get data from a
report and render a report again. When using caching the rendered report is saved in cache on the
server. The next time when the page is refreshed, the previously rendered report is loaded from cache
and its re-rendering is not required. It is important to remember that every report saved in cache takes
the server memory and, if there are a lot of queries to reports, it can be a critical factor. Therefore, one
should choose choose either low requirements to the memory but high requirements to performance
or high requirements to the memory but low requirements to speed. Caching should not be used if the
end user needs a report with actual data when every refreshing. The caching process can be controlled
using the RenderMode, CacheMode, and ServerTimeOut properties. If the caching of a report is not
used then the report that was rendered using the last data when page refreshing will be printed but not
the report that is shown on the current moment. If it is necessary to get the exact copy of a report form
the browser, then it is necessary to use caching.
The RenderMode property indicates how and when a report should be rendered. All modes of the
StiMobileViewer component can be divided in two categories: using the caching of a rendered report,
and without using caching of the rendered report.
The modes without caching
RenderOnlyCurrentPage
Very interesting mode of the report output. In this mode, the report is rendered only to the page that is
currently displayed in the StiMobileViewer component. For example, if the report consists of 100
pages (this is a big report to be output in the web), and the current page is the page number 5, the
report will be rendered only up to the page number 5. The sever memory is saved in this mode.
Ajax
This mode uses Ajax to output a report and to update the content of the StiMobileViewer component.
For example, if a user goes to the next page of a report then not the whole page of the browser on
what the StiMobileViewer component is placed will be refreshed but only the next page of a report
will be sent to the browser using the post-back query. This increases the convenience of working with
the StiMobileViewer component.
© 2003-2015 Stimulsoft
165 Stimulsoft Reports
AjaxWithCache
This mode as well as the Ajax mode uses the Ajax technology to output a report and also is used for
refreshing operations of the StiMobileViewer component. However, unlike the Ajax mode, this
AjaxWithCache mode does not re-render the report after each information request on the server. The
report that was earlier saved in cache is used.
The CacheMode property indicates what cache should be used to store reports, images, and service
information. There are two ways:
Page
A page cache will be used.
Session
A session cache will be used.
The ServerTimeout property indicates the amount of time on what it is necessary to save a report,
pictures of a report, or other service information in the cache. Do not use too much time or too little
time. If the time is too large, then the used cache will be overflowed and will be automatically cleared
by the server. As a result, the report (or images of a report) will not be cached, and incorrect result of
the report output in the StiMobileViewer component will occur. If the time is too small, then by the
time of request to the cache, there some necessary data may not be found. It is recommended to set
the time equal to 10 minutes. But the exact time can be found experimentally, considering the
parameters of the server, users activity, etc.
A report can be shown without using the StiMobileViewer component. The special
Stimulsoft.Report.Mobile.StiReportResponse class is used in this case. This class is a set of methods
for saving a rendered report in different formats to the stream of a page. It is possible to assign a lot
of input parameters which allows controlling the saving format of a report. For example, the following
code can be used to save a report to the PDF format to the stream of a page:
In this code the report will be loaded first. Then this report will be rendered. Then the result of the
report rendering will be saved to the stream of a page. The following code saves a report to the Excel
2007 format.
© 2003-2015 Stimulsoft
HTML5 Viewer 166
report.Load("MyReport.mrt");
report.Render(false);
Stimulsoft.Report.Mobile.StiReportResponse.ResponseAsExcel2007(this,
report);
15.5 Settings
Setting the HTML5 Viewer can be done using properties. Properties of HTML5 Viewer can be divided
into the following groups: Zooming and Toolbar.
15.5.1 Zooming
The Zooming group of properties is represented by one property ZoomPercent. The ZoomPercent
property value will be any number from 2 to 403. This number corresponds to the zooming percentage
of the report in the viewer.
15.5.2 Toolbar
The group of static properties StiMobileViewerOptions.Toolbar allows setting the toolbox of the
HTML5 Viewer.
Name Description
© 2003-2015 Stimulsoft
167 Stimulsoft Reports
ShowNextButton Property is used to show/hide the Next Page button. By default this
property is set to true.
ShowLastButton Property is used to show/hide the Last Page button. By default this
property is set to true.
ShowViewMode Property is used to show/hide the Single Page button. By default this
property is set to true.
ShowAboutButton Property is used to show/hide the About button. By default this property
is set to true.
15.6 Properties
The ServerTimeout property is used to define time of storing a report in the server cache. By
default, this property is set to "00:10:00", this means that the report is stored 10 minutes in the
server cache and then it is removed.
The BackColor property is used to change the background color. By default, this property is set to
White, this means that the background color is white. It is also possible to set any color in the
#rrggbb format and transparent color.
The GlobalizationFile property is used to localize the HTML5 Viewer. To do this, you must specify
the value of the GlobalizationFile property, where the value is .xml file in the folder \Localization of
© 2003-2015 Stimulsoft
HTML5 Viewer 168
the root user project. By default, this property is set to "en", which means the English localization.
Below is a sample code where the property is set to "ru", which corresponds to Russian localizations
of HTML5 Viewer:
The ImageQuality property is used to change the quality of images in the report. depending on the
value of this property it is possible to change the image file size and image quality. If the
ImageQuality property is set to Low, then the file size and quality will be low. If the ImageQuality
property is set to Normal, then the file size and quality will have optimal ratio between size and
quality. If the ImageQuality property is set to High, then the file size and quality will be the highest.
It is possible to customize a list of export formats. In other words, it is possible to hide unused export
formats. Customization of the export formats list can be done by using the Mobile Viewer properties.
For example, the export to HTML. Availability of this format in the list of formats for export depends
on the value of the ShowExportToHtml property. The picture below shows the full list of formats:
As seen in the picture above the HTML format is shown in the list of formats, and this means that the
ShowExportToHtml property is set to true. If the set this property to false (code below):
© 2003-2015 Stimulsoft
169 Stimulsoft Reports
then the HTML format will not be shown in the list of export formats. The picture below shows a list of
formats without the HTML option:
Data are needed for rendering a report. By default, the data are taken which the specified in the
Dictionary of the the report. If you want to override the data, you should subscribe to the
GetReportData event. Here is an example of a code used to override data:
e.Report.RegData(data);
}
© 2003-2015 Stimulsoft
HTML5 Viewer 170
As can be seen from the code, the data are taken from the XML and XSD files. The same way, you can
put the data from other data sources.
The HTML5 MVC Report Designer is a Web-service. It is designed to create and edit reports on
mobile devices using the browser. Designer interface provides the user with easy control, a huge set of
tools, components and tools to develop reports, visual design and preview.
In order to run the HTML5 MVC report designer, it is required to put the StiMvcMobileDesinger
component on the ASP.NET page, set necessary properties and define required actions in the view
controller. When running the Web report designer the following actions occur:
When it is loaded, the client side requests a report that should be returned by action set and
defined in the controller settings.
When exporting a report, the client side calls an action, which also must return the specific
response.
In order to run the report designer on the main master-page of the application you need to place a
code of adding java-scripts, which are required for the component work properly. This code is placed
in the block <head>:
ASPX:
<head runat="server">
<%= Html.Stimulsoft().RenderMvcMobileDesignerScripts() %>
</head>
Razor:
<head runat="server">
@Html.Stimulsoft().RenderMvcMobileDesignerScripts()
</head>
To view the report you should add the StiMvcMobileDesinger component to an ASP.NET page, and
set it the necessary properties, and in the view controller, to determine the necessary steps
ASPX:
© 2003-2015 Stimulsoft
171 Stimulsoft Reports
Razor:
@Html.Stimulsoft().StiMvcMobileDesigner("MvcMobileDesigner1", new
StiMvcMobileDesignerOptions() {
ActionGetReportTemplate = "GetReportTemplate",
Width = Unit.Percentage(100),
Height = Unit.Pixel(700)
})
Controller:
return
StiMvcMobileDesigner.GetReportTemplateResult(HttpContext, report);
}
For loading report templates a special action is used. It has the recommended name
GetReportTemplate:
Controller:
© 2003-2015 Stimulsoft
HTML5 MVC Designer 172
return
StiMvcMobileDesigner.GetReportTemplateResult(HttpContext, report);
}
Controller:
The preview function of the edited report, in the HTML5 Designer, has two modes: HTML, PDF. To
preview the rendered report it is necessary to determine a specific action which has a recommended
name GetReportSnapshot:
ASPX:
Razor:
Razor:
@Html.Stimulsoft().StiMvcMobileDesigner("MvcMobileDesigner1", new
StiMvcMobileDesignerOptions() {
ActionGetReportSnapshot = "GetReportSnapshot"
})
As in the previous form of a preview, the report will be in the data transmitted to the controller. This
action should return a report prepared in a special format to the client side. To do this, use the
following code:
Controller:
© 2003-2015 Stimulsoft
173 Stimulsoft Reports
report);
}
If the report requires data other than those specified in the report template, you can use the same
solution as in the previous form of the preview:
Controller:
report.RegData(data);
report.Dictionary.Synchronize();
return
StiMvcMobileDesigner.GetReportSnapshotResult(HttpContext, report);
}
A special action that has the name SaveReportTemplate for processing the saved report in the web
designer:
Controller:
Saving the report can be performed in the background, i.e. visually it will not be displayed. At the same
time, the report will be saved again, i.e. the report file will be overwritten. Also, before you save the
report, you can display a dialog box in which you should specify the report name with which it will be
saved. To do this, you must set the ShowSaveDialog property to true:
© 2003-2015 Stimulsoft
HTML5 MVC Designer 174
ASPX:
Razor:
@Html.Stimulsoft().StiMvcMobileDesigner("MvcMobileDesigner1", new
StiMvcMobileDesignerOptions() {
ActionGetReportTemplate = "GetReportTemplate",
ShowSaveDialog = true
})
In order to localize the interface designer in the appropriate language, use special actions, that has the
name Localization.
ASPX:
Razor:
@Html.Stimulsoft().StiMvcMobileDesigner("MvcMobileDesigner1", new
StiMvcMobileDesignerOptions() {
Localization = "Localizations/en.xml",
})
There are some other actions of the Web designer. The actions are OpenReport, DesignerEvent and
ExitDesigner.
ASPX:
© 2003-2015 Stimulsoft
175 Stimulsoft Reports
ActionOpenReportTemplate = "OpenReportTemplate",
ActionExitDesigner = "ExitDesigner",
ActionDesignerEvent = "DesignerEvent"
})%>
Razor:
@Html.Stimulsoft().StiMvcMobileDesigner("MvcMobileDesigner1", new
StiMvcMobileDesignerOptions() {
ActionOpenReportTemplate = "OpenReportTemplate",
ActionExitDesigner = "ExitDesigner",
ActionDesignerEvent = "DesignerEvent"
})
OpenReport:
The OpenReport action is used to open the report designer. This action is determined in the view
controller:
Controller:
ExitDesigner:
The ExitDesigner action is called when you click the Exit button in the main menu of the designer:
DesignerEvent:
All the other actions which occur in the designer register in DesignerEvent. DesignerEvent is
determined in the view controller:
© 2003-2015 Stimulsoft
HTML5 MVC Designer 176
Setting the web designer can be done using the properties, which are described in the
StiMvcMobileDesinger class.
16.8.1 Actions
This group includes properties that define the name of actions in the view controller, which will call the
client side report designer using the appropriate functions. The group includes the following
properties:
Name Description
Controller Specifies the action method name of processing queries of the report
designer. If the property is not specified, then the current controller will be
used for processing queries.
ActionGetReportSn Specifies the action method name of preparing a rendered report for preview.
apshot
ActionGetNewRepo Specifies the action method name of retrieving data to the new report
rtData template.
ActionExitDesigner Specifies the action method name for transition to the desired representation
when closing the web designer.
© 2003-2015 Stimulsoft
177 Stimulsoft Reports
16.8.2 Server
This group includes properties that define parameters of the client connection and the server part.
Name Description
ServerTimeout Defines the time that the report will be stored in the server or session cache.
ServerRelativeUrl Defines the time that shows that the viewer will use both relative and absolute
s URLs.
ServerCacheItem Sets the relative priority of the report that is stored in the system cache.
Priority
Name Description
ShowFileMenu Shows/hides the File menu item. Setting it to true makes the menu item
visible.
ShowFileMenuNew Shows/hides the New menu item. Setting it to true makes the menu item
visible.
ShowFileMenuOpen Shows/hides the Open menu item. Setting it to true makes the menu item
visible.
ShowFileMenuSave Shows/hides the Save menu item. Setting it to true makes the menu item
visible.
ShowFileMenuClose Shows/hides the Close menu item. Setting it to true makes the menu item
visible.
ShowFileMenuExit Shows/hides the Exit menu item. Setting it to true makes the menu item
visible.
© 2003-2015 Stimulsoft
HTML5 MVC Designer 178
16.8.4 Interface
This group includes properties using which you can setup the interface of the designer.
Name Description
Width Sets the width of the component with units set in the Unit class. Values available
- Unit.Pixel(), Unit.Point() and Unit.Percentage().
Height Sets the height of the component with units set in the Unit class Values available
- Unit.Pixel(), Unit.Point() and Unit.Percentage().
DefaultUnit Sets units in the report by default - pixels, centimeters, inches, hundredths of
inch.
ShowPropertiesG Enables/disables the Property panel. Setting it to true enables this panel.
rid
PropertiesGridW Sets the width of the property panel with units set in the Unit class. Values
idth available - Unit.Pixel(), Unit.Point() and Unit.Percentage().
PropertiesGridLa Sets the width of the column header on the properties panel using the property.
belWidth Values available - Unit.Pixel(), Unit.Point() and Unit.Percentage().
ShowDictionary Shows/hides the Data Dictionary. If this property is set to true the Dictionary will
be shown.
ShowInsertButto Shows/hides the Insert tab. If this property is set to true the tab will be shown.
n
ShowPageButton Shows/hides the Page tab. If this property is set to true the tab will be shown.
ShowPreviewBut Shows/hides the Preview tab. If this property is set to true the tab will be shown.
ton
ShowTooltips Shows/hides the Tooltips. If this property is set to true tooltips will be shown.
ShowSaveButton Shows/hides the Save button. If this property is set to true the button will be
shown.
ShowSaveDialog Shows/hides the dialog window when saving. If this property is set to true the
dialog will be shown and you should set the name of the saved report. If the
property is set to false the dialog will hidden and the report will be saved with
the previous name, the report will be rewritten.
Localization Sets the directory (relative and absolute), in which the localization files are
placed. This property is used to build the list of available localizations.
© 2003-2015 Stimulsoft
179 Stimulsoft Reports
16.8.5 Bands
Using this group of properties you can show/hide bands on the tab Insert.
Name Description
ShowDataBand Shows/hides the band Data. If it is set to true, the band is shown in the list
of bands.
ShowHierarchicalBan Shows/hides the band Hierarchical. If it is set to true, the band is shown in
d the list of bands.
ShowHeaderBand Shows/hides the band Header. If it is set to true, the band is shown in the list
of bands.
ShowFooterBand Shows/hides the band Footer. If it is set to true, the band is shown in the list
of bands.
ShowPageHeaderBan Shows/hides the band PageHeader. If it is set to true, the band is shown in
d the list of bands.
ShowPageFooterBan Shows/hides the band PageFooter. If it is set to true, the band is shown in
d the list of bands.
ShowReportTitleBan Shows/hides the band ReportTitle. If it is set to true, the band is shown in
d the list of bands.
ShowReportSummar Shows/hides the band ReportSummary. If it is set to true, the band is shown
yBand in the list of bands.
ShowGroupHeaderBa Shows/hides the band GroupHeader. If it is set to true, the band is shown in
nd the list of bands.
ShowGroupFooterBa Shows/hides the band GroupFooter. If it is set to true, the band is shown in
nd the list of bands.
ShowColumnHeader Shows/hides the band ColumnHeader. If it is set to true, the band is shown
Band in the list of bands.
ShowColumnFooterB Shows/hides the band ColumnFooter. If it is set to true, the band is shown
and in the list of bands.
ShowChildBand Shows/hides the band Child.If it is set to true, the band is shown in the list of
bands.
ShowOverlayBand Shows/hides the band Overlay. If it is set to true, the band is shown in the
list of bands.
ShowEmptyBand Shows/hides the band Empty. If it is set to true, the band is shown in the list
of bands.
© 2003-2015 Stimulsoft
HTML5 MVC Designer 180
Name Description
ShowCrossDataBand Shows/hides the cross band CrossData. If it is set to true, the cross band is
shown in the list of bands.
ShowCrossHeaderBa Shows/hides the cross band CrossHeader. If it is set to true, the cross band
nd is shown in the list of bands.
ShowCrossFooterBan Shows/hides the cross band CrossFooter. If it is set to true, the cross band
d is shown in the list of bands.
ShowCrossGroupHea Shows/hides the cross band CrossGroupHeader. If it is set to true, the cross
derBand band is shown in the list of bands.
ShowCrossGroupFoo Shows/hides the cross band CrossGroupFooter. If it is set to true, the cross
terBand band is shown in the list of bands.
ShowCrossTab Shows/hides the cross band CrossTab. If it is set to true, the cross band is
shown in the list of bands.
16.8.6 Components
Using this group of properties you can show/hide components on the tab Insert.
Name Description
© 2003-2015 Stimulsoft
181 Stimulsoft Reports
17 Stimulsoft Reports.JS
We made a library for working with Stimulsoft Reports on JavaScript, but we used the ideology of
.NET, so all JavaScript code presented below uses .NET C# notation.
The library StimulsoftReports.JS provides to the developer the ability to quickly and easily integrate a
powerful and flexible reporting system from Stimulsoft in yours web application written in any
language. To do this, connect the JavaScript library to the client application:
<script src="stimulsoft.reports.js"></script>
© 2003-2015 Stimulsoft
Stimulsoft Reports.JS 182
Additionally, to connect Stimulsoft Report Viewer you need to add CSS and JS:
Additionally, to connect Stimulsoft Report Designer you need to add CSS and JS:
<link href="stimulsoft.designer.office2013.white.blue.css"
rel="stylesheet">
<script src="stimulsoft.designer.js" type="text/javascript"></script>
Viewer
The appearance of the viewer and the designer can be modified using any of the available themes by
simply connecting the desired CSS. The list of CSS themes:
stimulsoft.viewer.default.min.css
stimulsoft.viewer.windows.xp.css
stimulsoft.viewer.windows7.css
stimulsoft.viewer.office2003.css
stimulsoft.viewer.office2007.blue.css
stimulsoft.viewer.office2007.silver.css
stimulsoft.viewer.office2007.black.css
stimulsoft.viewer.office2010.black.css
stimulsoft.viewer.office2010.css
stimulsoft.viewer.office2010.silver.css
stimulsoft.viewer.office2013.css
stimulsoft.viewer.office2013.white.carmine.css
stimulsoft.viewer.office2013.white.green.css
stimulsoft.viewer.office2013.white.orange.css
stimulsoft.viewer.office2013.white.purple.css
stimulsoft.viewer.office2013.white.teal.css
stimulsoft.viewer.office2013.white.violet.css
© 2003-2015 Stimulsoft
183 Stimulsoft Reports
Designer
The list of CSS themes:
stimulsoft.designer.office2013.white.blue.css
stimulsoft.designer.office2013.white.carmine.css
stimulsoft.designer.office2013.white.green.css
stimulsoft.designer.office2013.white.orange.css
stimulsoft.designer.office2013.white.purple.css
stimulsoft.designer.office2013.white.teal.css
stimulsoft.designer.office2013.white.violet.css
stimulsoft.designer.office2013.lightgray.blue.css
stimulsoft.designer.office2013.lightgray.carmine.css
stimulsoft.designer.office2013.lightgray.green.css
stimulsoft.designer.office2013.lightgray.orange.css
stimulsoft.designer.office2013.lightgray.purple.css
stimulsoft.designer.office2013.lightgray.teal.css
stimulsoft.designer.office2013.lightgray.violet.css
stimulsoft.designer.office2013.darkgray.blue.css
stimulsoft.designer.office2013.darkgray.carmine.css
stimulsoft.designer.office2013.darkgray.green.css
stimulsoft.designer.office2013.darkgray.orange.css
stimulsoft.designer.office2013.darkgray.purple.css
stimulsoft.designer.office2013.darkgray.teal.css
stimulsoft.designer.office2013.darkgray.violet.css
stimulsoft.designer.office2013.verydarkgray.blue.css
stimulsoft.designer.office2013.verydarkgray.carmine.css
© 2003-2015 Stimulsoft
Stimulsoft Reports.JS 184
stimulsoft.designer.office2013.verydarkgray.green.css
stimulsoft.designer.office2013.verydarkgray.orange.css
stimulsoft.designer.office2013.verydarkgray.purple.css
stimulsoft.designer.office2013.verydarkgray.teal.css
stimulsoft.designer.office2013.verydarkgray.violet.css
The uncompressed version for customized settings for each CSS file is available.
Note: The HTML page must begin with a proper DOCTYPE definitionto set the type of the
current document in HTML5:
<!DOCTYPE html>
Due to limitations of the JavaScript language to work with external data, you must run a minimum
server instance.This will provide the ability to open reports from files, use the external data in the
report and to work with rendered reports.
Two methods of the StiReport object are used to load a report – loadFile() and load(). They are used
as follows:
loadFile(filePath) – loads a report from the MRT file which path is specified in the filePath;
load(str) – loads a report from the string str, that contains XML or JSON;
load(data) – loads a report from the array data of the number[] type;
For example, use the code below to load a report from file:
The MRT format of Stimulsoft Reports is the JSON based description of reports. You can use MRT
files, created in other Stimulsoft Reports designers in the JSON based description. Use the code below
to save a report to a string:
© 2003-2015 Stimulsoft
185 Stimulsoft Reports
The report includes presentation and data. To merge these entities and build a report using the
“render()” method. The following code renders a report:
To connect to the data you need to perform the “regData()” method of the report, passing it as a data
© 2003-2015 Stimulsoft
Stimulsoft Reports.JS 186
source parameter. The data source can load data from XML files (with XSD scheme) and from JSON
files. For example, loading data from XML:
Note: Loading data schema is not required. If you want to use the scheme, you must load it
© 2003-2015 Stimulsoft
187 Stimulsoft Reports
To convert an array of bytes to string and back you can use the static functions –
Stimulsoft.System.Text.Encoding.UTF8.getString(buffer) (returns a string derived from the byte
array passed in the parameter) and Stimulsoft.System.Text.Encoding.UTF8.getBytes(str) (returns a
byte array derived from the string passed in the parameter). There is also another way of data
management, which allows you to connect to different data sources and modify them in real time:
report.loadFile("SimpleList.mrt");
report.dictionary.databases.clear();
report.dictionary.databases.add(xmlDataBase);
This way you can easily add the required amount of data sources of different types.
Since pure JavaScript does not allow access to a remote database, this functionality is implemented
through the server-side code. For this, Stimulsoft Reports.JS supports two server-side technologies –
PHP and Node.JS.
The database adapter is a layer between DBMS and the client-side script. It connects to the DBMS and
receives the necessary data, converting them to the JSON format. The script running on the server (with
help of adapter) provides exchange of JSON data between the client-side JavaScript and the server-
side using a POST-request.
In order to use this mechanism in the client-side JavaScript must specify the URL of the host that
handles POST-requests to the required adapter. In case, if it is a PHP script it indicates a web page:
StiOptions.WebServer.url = "http://mywebsite.com/script.php";
If you have adapters for Node.JS, you need to specify the host and port, running the script:
StiOptions.WebServer.url = "http://mywebsite.com:9615";
If you use the report designer, then this line should be placed before the code to display the designer.
Call the function to render a report template:
report.renderAsync();
PHP and Node.JS scripts to handle POST-requests to the server and data transfer between the adapter
© 2003-2015 Stimulsoft
Stimulsoft Reports.JS 188
and the client can be downloaded together with the Stimulsoft.Reports.JS assembly. On the client-side,
the connection string in any of the supported DBMS (MySQL, MS SQL or Firebird) must specify the
required parameters, including the host, which is not a host that is running the DBMS, but the host on
which the POST-requests are processed and the adapter is running:
a server supporting Node.JS adapterserver that is running the script to handle POST-
requests (app.js) and adapter's script (in this case, a script MySQLAdapter.js);
a HTTP server httpserver that is running the http server for distribution to your pages and
the JavaScript client.
On the client-side, the next option runs a script that starts the designer:
StiOptions.WebServer.url = "http://adapterserver:9615";
In the form of creating a new connection the required parameters and the address of the MySQL server
are specified:
When all is done, then by pressing the Test button on the form should display "Connection was
successful".
In the process of adding data to the Dictionary, there is a need to synchronize the data structure of the
Dictionary with the added data source. This problem is easily solved by calling:
Stimulsoft.Report.Dictionary.syncronise()
The method adds a data structure (Tables and Columns, Relations and whole DataSources) in the
dictionary, and solves the problem of the empty data source added to the dictionary using the method:
Stimulsoft.Report.regData()
If DataSources, Columns or Relations from the DataStore does not exist in Dictionary, then new
elements will be added to the Dictionary.
© 2003-2015 Stimulsoft
189 Stimulsoft Reports
Rendered report can be saved into a JSON document for later viewing (data stored within a
document):
Report printing is implemented by means of the browser, so the view of the dialog box may be
different on variuos operating systems and browsers. Printing is possible after rendering a report by
the “print()” method:
report.print();
The optional parameter of Stimulsoft.Report.StiPagesRange allows you to specify the print range. The
parameters of the constructor of the Stimulsoft.Report.StiPagesRange object is:
The range in the string representation (page numbers separated by commas may specify the
range with a hyphen);
Stimulsoft Report Viewer is a tool to view reports that can be easily integrated into your Web
© 2003-2015 Stimulsoft
Stimulsoft Reports.JS 190
application with a few lines of code. Minimal server support required to start Stimulsoft Reports.JS is
any Web server that can provide access to the files of any type. To get started, you must connect CSS
and scripts:
Then load the required report and insert it into the HTML page code to deploy Stimulsoft Report
Viewer in the current DOM element:
<script type="text/javascript">
var report = new Stimulsoft.Report.StiReport();
report.loadFile("SimpleList.mrt");
Stimulsoft Report Viewer object is created by the Stimulsoft.Viewer.StiViewer() constructor, which has
three optional parameters. The first parameter is a set of options
Stimulsoft.Viewer.StiViewerOptions, divided into categories, appearance, toolbar and exports. All of
them are listed in the table below. The second parameter is the identifier of the viewer as a DOM
object. The third parameter is the flag of rendering the viewer in the moment of creation. If this flag is
set to true, the viewer will be drawn in the same place of the DOM tree, which houses the code. If the
flag is set to false, the viewer will be drawn where there is the “renderHtml()” method of the viewer.
For example, Initialization of the viewer in the head of a page:
<script type="text/javascript">
var viewer = new Stimulsoft.Viewer.StiViewer(null, "StiViewer",
false);
</script>
<div>Page content</div>
<div>
<script type="text/javascript">
// Render the report viewer in this place
viewer.renderHtml();
</script>
</div>
Another way to display the viewer in a particular control is to use the optional method parameter –
renderHtml(elementId), which indicates the ID of the HTML element - Initialization of the viewer in the
head of a page:
© 2003-2015 Stimulsoft
191 Stimulsoft Reports
<div id="viewerContent"></div>
Note: a viewer can be hidden by specifying the values of the property “visible”:
viewer.visible = false;
In order to write interactive applications it is needed to respond to changes in the application. The
event system which is represented in Stimulsoft Report Viewer can be used for this. The following
events exist:
onDesignReport
onBeginPro onPrintRep onEndExpo
cessData ort rtReport
Designer Events
onEndProc onBeginEx onEmailRe
essData portReport port
onBeginProcessData
is called before requesting the data for the report. The event handler argument “event” is an object
with the next fields:
Name Description
command a string ID for the current command. Can have values "TestConnection" and
"ExecuteQuery" to call the command to test a connection and data
acquisition respectively.
queryString a string with the SQL query to the database for data acquisition. Used only
with the command = "ExecuteQuery".
preventDefault a flag to prevent further processing of the event. The default value is “false”.
© 2003-2015 Stimulsoft
Stimulsoft Reports.JS 192
onEndProcessData
Is called after retrieving data for the report. The event handler argument “event” is an object with the
next fields:
Name Description
result a result dataset in a specific JSON format. It has two collections - columns
and rows, with descriptions of columns and rows of data sources.
preventDefault a flag to prevent further processing of the event. The default value is “false”.
This event can be used to add its own data sources generated "on the fly".
onPrintReport
Is called before printing the report. The event handler argument “event” is an object with the next fields:
Name Description
preventDefault a flag to prevent further processing of the event. The default value is “true”.
onBeginExportReport
Is called before export but after applying the export options. The event handler argument “event” is an
object with the next fields:
Name Description
© 2003-2015 Stimulsoft
193 Stimulsoft Reports
preventDefault a flag to prevent further processing of the event. The default value is “false”.
onEndExportReport
Is called after export report. The event handler argument “event” is an object with the next fields:
Name Description
preventDefault a flag to prevent further processing of the event. The default value is “false”.
onEmailReport
Is called before sending the report by email. The event handler argument “event” is an object with the
next fields:
Name Description
© 2003-2015 Stimulsoft
Stimulsoft Reports.JS 194
preventDefault a flag to prevent further processing of the event. The default value is “false”.
onDesignReport
Is called by pressing the Design button. The event handler argument “event” is an object with the next
fields:
Name Description
preventDefault a flag to prevent further processing of the event. The default value is “false”.
The following options are used to customize the appearance and behavior of the Stimulsoft Report
Viewer.
Stimulsoft.Viewer.StiViewerOptions:
© 2003-2015 Stimulsoft
195 Stimulsoft Reports
17.12.1 Appearance
Stimulsoft.Viewer.StiViewerOptions.appearance:
appearance.fullScr Sets the full screen mode of the report viewer. If set to false
eenMode true, then the width and height are ignored
appearance.scrollb Sets the mode of displaying the report viewer without false
arsMode scroll bars or with them
appearance.openLi Target window to open the link contained in the report “_self”
nksTarget
appearance.openE Target window to open the export file from the viewer “_blank”
xportedReportTar
get
appearance.showT Displays tips for the viewer controls when hovering the True
ooltips mouse
appearance.pageA Sets the position of the report page in the viewer window. Stimulsoft.Viewer.S
lignment Stimulsoft.Viewer.StiContentAlignment.Left – the page is tiContentAlignment
aligned by the left side of the viewer; .Center
Stimulsoft.Viewer.StiContentAlignment.Center – the page
is aligned by the center;
Stimulsoft.Viewer.StiContentAlignment.Right – the page
will be aligned by the right side of the viewer.
appearance.book Prints report bookmarks on the printer (in addition to the false
marksPrint report)
appearance.param Sets the maximum height of the parameter panel in pixels 300
etersPanelMaxHeig
© 2003-2015 Stimulsoft
Stimulsoft Reports.JS 196
ht
appearance.param Sets the date format and time for variables of the String.empty
etersPanelDateFor corresponding type on the parameters panel
mat
appearance.interfa Sets the type of the interface viewer. Can take the following Stimulsoft.Viewer.
ceType values: StiInterfaceType.Au
Stimulsoft.Viewer.StiInterfaceType.Auto – the interface to
type of the report viewer is selected automatically
depending on the device used;
Stimulsoft.Viewer.StiInterfaceType.Mouse – forced use
the interface to manage viewer using the mouse device;
Stimulsoft.Viewer.StiInterfaceType.Touch – force use of
the touch interface to manage viewer using the touch
screen (mobile devices).
appearance.chartR Sets the type of drawing charts on the report page. It has Stimulsoft.Viewer.S
enderType the following values: tiChartRenderType
Stimulsoft.Viewer.StiChartRenderType.AnimatedVector – .AnimatedVector
charts are drawn in the vector mode with animation;
Stimulsoft.Viewer.StiChartRenderType.Vector – charts are
drawn as vector images;
Stimulsoft.Viewer.StiChartRenderType.Image – charts are
drawn as images.
17.12.2 Toolbar
Stimulsoft.Viewer.StiViewerOptions.toolbar:
toolbar.fontColor Changes the font color for the toolbar and menu Stimulsoft.System.
Drawing.Color.em
pty
toolbar.fontFamily Changes the font family for the toolbar and menu ”Arial”
© 2003-2015 Stimulsoft
197 Stimulsoft Reports
toolbar.showSaveB Shows/hides the Save button on the toolbar of the report true
utton viewer
toolbar.showSendE Shows/hides the Send Email button on the toolbar of the false
mailButton report viewer
toolbar.showFullSc Shows/hides the Full Screen button on the toolbar of the true
reenButton report viewer
toolbar.showFirstP Shows/hides the First Page button on the toolbar of the true
ageButton report viewer
toolbar.showNextP Shows/hides the Next Page button on the toolbar of the true
ageButton report viewer
toolbar.showLastP Shows/hides the Last Page button on the toolbar of the true
ageButton report viewer
© 2003-2015 Stimulsoft
Stimulsoft Reports.JS 198
toolbar.showZoom Shows/hides the button for selecting the report zoom true
Button
toolbar.showAbout Shows/hides the About button on the toolbar of the report true
Button viewer
17.12.3 Exports
Stimulsoft.Viewer.StiViewerOptions.exports:
© 2003-2015 Stimulsoft
199 Stimulsoft Reports
<script type="text/javascript">
var report = new Stimulsoft.Report.StiReport();
report.loadFile("SimpleList.mrt");
options.width = "1000px";
options.height = "1000px";
options.appearance.scrollbarsMode = true;
options.appearance.backgroundColor =
Stimulsoft.System.Drawing.Color.dodgerBlue;
options.appearance.showTooltips = false;
options.toolbar.showPrintButton = false;
options.toolbar.showDesignButton = false;
options.toolbar.showAboutButton = false;
options.exports.showExportToPdf = true;
options.exports.ShowExportToWord2007 = true;
Stimulsoft Report Designer is an application for working with reports. It can be easily integrated into
any web page (requires any web server). To get started, you must connect CSS and scripts:
Then load the required report and insert it into the HTML page code to deploy Stimulsoft Report
Designer in the current DOM element:
© 2003-2015 Stimulsoft
Stimulsoft Reports.JS 200
<script type="text/javascript">
var designer = new Stimulsoft.Designer.StiDesigner(null,
"StiDesigner", false);
</script>
<div>Page content</div>
<div>
<script type="text/javascript">
// Render the report designer in this place
designer.renderHtml();
</script>
</div>
Another way to display the designer in a particular control is using the optional method parameter
renderHtml(elementId), which indicates the ID of the HTML element. Initialization of the designer in the
head of a page:
<div id="designerContent"></div>
Note: a designer can be hidden by specifying the values of the property “visible”:
© 2003-2015 Stimulsoft
201 Stimulsoft Reports
designer.visible = false;
To write interactive applications need to respond to changes in the application. The event system is
used for this. It is represented in Stimulsoft Report Designer with the following events:
onExit
onBeginPr onSaveRe onCreateR
ocessData port eport
Viewer Events
onEndProc onOpenRe onPreview
essData port Report
onBeginProcessData
Is called before requesting the data for the report. The event handler argument “event” is an object
with the next fields:
Name Description
command a string ID for the current command. Can have values "TestConnection" and
"ExecuteQuery" to call the command for test connection and data acquisition
respectively.
queryString a string with the SQL query to the database for data acquisition, used only
with the command = "ExecuteQuery".
preventDefault a flag to prevent further processing of the event. The default value is “false”.
onEndProcessData
Is called after retrieving the data for the report. The event handler argument “event” is an object with
the next fields:
Name Description
© 2003-2015 Stimulsoft
Stimulsoft Reports.JS 202
result a result dataset in a specific JSON format. It has two collections: columns and
rows, with descriptions of columns and rows of data sources.
preventDefault a flag to prevent the further processing of the event. The default value is
“false”.
This event can be used to add its own data sources generated "on the fly" to the report.
onSaveReport
Is called before saving the report. The event handler argument “event” is an object with the next fields:
Name Description
preventDefault a flag to prevent further processing of the event. The default value is “true”.
onOpenReport
Is called before user click button for opening a report. The event handler argument “event” is an object
with the next fields:
Name Description
preventDefault a flag to prevent further processing of the event. The default value is “true”.
onCreateReport
Is called after a new report is created. The event handler argument “event” it is an object with the next
fields:
Name Description
© 2003-2015 Stimulsoft
203 Stimulsoft Reports
onPreviewReport
is called before the launch of the preview when requesting data for the report. If the data source is set
in the report template, then calling “report.regData()” with the same name as the data source has a
lower priority, and data will be taken from the source specified in the report template. It is
recommended to clean the collection of data sources by “report.dictionary. databases.clear()”. The
event handler argument “event” is an object with the next fields:
Name Description
preventDefault a flag to prevent further processing of the event. The default value is “false”.
onExit
Is called before closing the designer. The event handler argument “event” is an object with the next
fields:
Name Description
© 2003-2015 Stimulsoft
Stimulsoft Reports.JS 204
The following options are used to customize the appearance and behavior of Stimulsoft Report
Designer.
Stimulsoft.Designer.StiDesignerOptions:
17.15.1 Appearance
Stimulsoft.Designer.StiDesignerOptions.appearance:
defaultUnit A default value of unit in the designer. It has the following Stimulsoft.Report.St
values: iReportUnitType.
Stimulsoft.Report.StiReportUnitType.Centimeters, Centimeters
Stimulsoft.Report.StiReportUnitType. HundredthsOfInch,
Stimulsoft.Report.StiReportUnitType. Inches,
Stimulsoft.Report.StiReportUnitType. Millimeters
interfaceType The type of the designer interface. It has the following Stimulsoft.Designer
values: .
Stimulsoft.Designer. StiInterfaceType.Auto, StiInterfaceType.Aut
Stimulsoft.Designer. StiInterfaceType.Mouse, o
Stimulsoft.Designer. StiInterfaceType.Touch
showSaveDialog Displays the dialog to enter the name of the report when it true
is saved
showTooltips Displays tips for the designer controls when hovering the true
mouse
appearance.fullScr Sets the full screen mode of the report designer. If set to false
eenMode true then width and height are ignored
17.15.2 Toolbar
Stimulsoft.Designer.StiDesignerOptions.toolbar:
© 2003-2015 Stimulsoft
205 Stimulsoft Reports
showPageButton Shows/hides the Page button in the toolbar of the designer true
showSaveButton Shows/hides the Save button in the toolbar of the designer true
showFileMenuNew Shows/hides the New item in the file menu of the designer true
showFileMenuOpe Shows/hides the Open item in the file menu of the designer true
n
showFileMenuSave Shows/hides the Save item in the file menu of the designer true
showFileMenuClos Shows/hides the Close item in the file menu of the designer true
e
showFileMenuExit Shows/hides the Exit item in the file menu of the designer true
showFileMenuRep Shows/hides the Report Setup item in the file menu of the true
ortSetup designer
showFileMenuOpti Shows/hides the Options item in the file menu of the true
ons designer
17.15.3 Bands
Stimulsoft.Designer.StiDesignerOptions.bands:
© 2003-2015 Stimulsoft
Stimulsoft Reports.JS 206
showFooterBand Shows/hides the FooterBand item in the bands menu of the true
designer
showDataBand Shows/hides the DataBand item in the bands menu of the true
designer
showChildBand Shows/hides the ChildBand item in the bands menu of the true
designer
showEmptyBand Shows/hides the EmptyBand item in the bands menu of the true
designer
showTable Shows/hides the Table item in the bands menu of the true
designer
17.15.4 Cross-Bands
Stimulsoft.Designer.StiDesignerOptions.crossBands:
showCrossTab Shows/hides the CrossTab item in the cross bands menu of false
the designer
© 2003-2015 Stimulsoft
207 Stimulsoft Reports
17.15.5 Components
Stimulsoft.Designer.StiDesignerOptions.components:
showText Shows/hides the Text item in the components menu of the true
designer
showPanel Shows/hides the Panel item in the components menu of the true
designer
showChart Shows/hides the Chart item in the components menu of the true
designer
17.15.6 Dictionary
Stimulsoft.Designer.StiDesignerOptions.dictionary
Almost all options described below can take the following values:
© 2003-2015 Stimulsoft
Stimulsoft Reports.JS 208
<script type="text/javascript">
var report = new Stimulsoft.Report.StiReport();
report.loadFile("SimpleList.mrt");
© 2003-2015 Stimulsoft
209 Stimulsoft Reports
options.appearance.fullScreenMode = true;
A rendered report can be exported to several formats. This example demonstrates the export to HTML:
imageQuality Quality of images which will be exported to the result file 0.75
© 2003-2015 Stimulsoft
Stimulsoft Reports.JS 210
imageFormat Sets an image export format. Can have the following values: null
Stimulsoft.Report.ImageFormat.Bmp,
Stimulsoft.Report.ImageFormat.Emf,
Stimulsoft.Report.ImageFormat.Exif,
Stimulsoft.Report.ImageFormat.Gif,
Stimulsoft.Report.ImageFormat.Guid,
Stimulsoft.Report.ImageFormat.Icon,
Stimulsoft.Report.ImageFormat.Jpeg,
Stimulsoft.Report.ImageFormat.MemoryBmp,
Stimulsoft.Report.ImageFormat.Png,
Stimulsoft.Report.ImageFormat.Tiff,
Stimulsoft.Report.ImageFormat.Wmf
zoom Zoom factor. By default the value is set to 1.0 that is equal 1
100% in the export settings dialog
exportMode Sets the mode of the document export using the div, span Stimulsoft.Report.E
or table element. Can have the following values: xport.StiHtmlExpor
Stimulsoft.Report.Export.StiHtmlExportMode.Span, tMode.Table
Stimulsoft.Report.Export.StiHtmlExportMode.Div,
Stimulsoft.Report.Export.StiHtmlExportMode.Table
exportQuality Export quality of the component size. Can have the Stimulsoft.Report.E
following values: xport.StiHtmlExpor
Stimulsoft.Report.Export.StiHtmlExportQuality.High, tQuality.High
Stimulsoft.Report.Export.StiHtmlExportQuality.Low
© 2003-2015 Stimulsoft
211 Stimulsoft Reports
useStylesTable Uses the Styles Table; if false then the style table is empty true
and all properties of each component will be described
directly in the style of this component
removeEmptySpac Indicates that table styles will be used in the result HTML true
eAtBottom file. The HTML5 and MHT export mode is not supported.
pageHorAlignmen The horizontal alignment of pages. The HTML5 and MHT Stimulsoft.Base.Dra
t export mode is not supported. Can have the following wing.StiHorAlignm
values: ent.Left
Stimulsoft.Base.Drawing.StiHorAlignment.Left,
Stimulsoft.Base.Drawing.StiHorAlignment.Center,
Stimulsoft.Base.Drawing.StiHorAlignment.Right
compressToArchiv Provides the ability (when exporting to HTML) to get the zip false
e file after conversion. If this flag set to is true, the report
processing occurs first, and then all the files and folders will
be packed in a zip archive
useEmbeddedIma Provides the ability to embed images directly into the HTML false
ges file. In this case, it is necessary to consider that the correct
displaying of this file depends on the browser being used.
Not all browsers support the option to view the HTML file
with embedded pictures
continuousPages Indicates that all report pages will be shown as vertical true
ribbon. The HTML and MHT export mode is not supported
chartType A type of the chart in the HTML exports. Can have the Stimulsoft.Report.E
following values: xport.StiHtmlChart
Stimulsoft.Report.Export.StiHtmlChartType.Image, Type.AnimatedVect
Stimulsoft.Report.Export.StiHtmlChartType.Vector, or
Stimulsoft.Report.Export.StiHtmlChartType.AnimatedVecto
r
openLinksTarget A target (string) to open links from the exported report null
© 2003-2015 Stimulsoft
Stimulsoft Reports.JS 212
imageQuality Quality of images which will be exported to the result file 0.75
imageResolutionM Image resolution mode. Can have the following values: Stimulsoft.Report.E
ode Stimulsoft.Report.Export.StiImageResolutionMode.Exactl xport.StiImageReso
y, lutionMode.Exactly
Stimulsoft.Report.Export.StiImageResolutionMode.NoM
oreThan,
Stimulsoft.Report.Export.StiImageResolutionMode.Auto
embeddedFonts Indicates that fonts which used in report will be included in false
PDF file
standardPdfFonts Indicates that only standard PDF fonts will be used in false
result PDF file
useUnicode Indicates that Unicode symbols must be used in result PDF false
file
18 Java Viewer
The StiViewerFx component is delivered as a part of StimulsoftReports.Fx for Java. This component is
used to display reports in Java applications. To run the viewer you will need to place the StiViewerFx
component on the Frame and set necessary properties to it. For running the report viewer it requires
the Java 1.5 platform or higher.
© 2003-2015 Stimulsoft
213 Stimulsoft Reports
Add the StiViewerFx component on the required component (for example on JFx):
where the JFrameparentFrame is a main Frame of the application. For better showing StiViewerFx, the
parent component must have BoxLayoutManager. For loading and showing the report use the
following method:
viewerfx.getStiViewModel().loadDocumentFile(documentFile, showProgress);
where the argument documentFile is a file of mdc documents, and the boolean value showProgress
provides the ability to define whether to show the loading progress of the document (if it is set to true
then the process is displayed, if false - it is not displayed.) It is also possible to display a report in the
form of a dialog box, you can use the method:
where the argument parentFrame is a frame from which the dialog is displayed, and the Boolean value
modal - dialog modality. The method returns JDialog, which subsequently can make the necessary
manipulations, such as resizing, changing dialog parameters, visibility, etc.
In addition to the standard (built-in) functions, there is an ability to define your own (custom) functions.
To do this, we have the list customFunctions implemented in the class StiReport. Before rendering a
report all required functions must be added in it. Classes of user-defined functions must implement the
interface com.stimulsoft.report.StiCustomFunction. The description of the interface
StiCustomFunction:
public String getFunctionName() – the function class should return the name of the custom
function. Register is taken into account. Do not use the names of existing built-in functions, methods,
variables, reserved words as true/false/null, etc.
public List<Class> getParametersList() – the function class should return a list of classes of
variables used in the custom function.
An example of using on the base of Samples\webfx\. Suppose you need to implement a custom
substring function. In the class my.actions.MyRenderReportAction write the following:
© 2003-2015 Stimulsoft
Java Viewer 214
© 2003-2015 Stimulsoft
215 Stimulsoft Reports
Using a report designer and viewer in the Web application. Flexible setup of an application using the
configuration file. Loading and saving reports from the file system or a database. Ability to override
mechanisms for loading and saving reports. Ability to use a set of custom JSP tags.
19.1 Installation
Installation:
Download and install Java™ SE version 1.5 or higher (for the version 1.5 jaxb-impl and jaxb-api
libraries are required).
Download and install EclipsePlatform.
Download an archive with jar files on stimulsoft.com.
© 2003-2015 Stimulsoft
Java with Flex Client 216
In the window opened fill in the Project name (e.g. sti_fx_web, as shown in the picture below). Then
configure the web server, on which the application will run.
© 2003-2015 Stimulsoft
217 Stimulsoft Reports
Target a runtime:
Under Target Runtime, you see <None>, as shown in the picture below, because you haven't created a
runtime yet for Apache Tomcat. Click New Runtime to open the New Target Runtime Wizard. Select
© 2003-2015 Stimulsoft
Java with Flex Client 218
Apache Tomcat of the correct version from a list. Check Create a new local server as shown on Figure 3,
then click Next.
Then define the Tomcat installation directory, in which Apache Tomcat is installed, or in which one
needs to install it, as shown in the picture. If it is not installed, then click Download and Install. After all
fields are specified, click Finish.
© 2003-2015 Stimulsoft
219 Stimulsoft Reports
In order to verify the project and the Tomcat server, create a simple JSP and deploy it on Tomcat. To
do this, one can create a new JSP, by choosing File> New> Other, or one can use the context menu,
right-click the project name in the Project Explorer and select New> JSP file. In the next window (see
the picture) define the directory Web Content, and in the File name write index.jsp. Click Finish to
create pages using the default template.
© 2003-2015 Stimulsoft
Java with Flex Client 220
Now open the index.jsp and edit it so that it displays the current date. The code page is specified in
the code:
© 2003-2015 Stimulsoft
221 Stimulsoft Reports
<h1>
This index.jsp.<br>
<%=date.toString()%>
</h1>
</body>
</html>
Now deploy it on the server. For this one need to use the context menu, right-click the project name,
select Run> Run as> Run on server. Define a previously created server and click Finish.
© 2003-2015 Stimulsoft
Java with Flex Client 222
As a result, you receive the following (see the picture below). This page will be available from any
browser at http://localhost:8080/{ProjectName} (where the {ProjectName} name of the created
project, in our case sti_fx_web).
Create a simple page with a report designer. To do this, put the following libraries into the
WebContent\WEB-INF\lib\ directory: stimulsoft.lib.jar, stimulsoft.reports-base.jar, stimulsoft.reports-
report.jar, stimulsoft.reports-flex.jar, stimulsoft.reports-web.jar. As a result, one can see the following
(picture below):
© 2003-2015 Stimulsoft
223 Stimulsoft Reports
Next, open the web.xml for editing, it should look like in Listing 2:
© 2003-2015 Stimulsoft
Java with Flex Client 224
<url-pattern>/stimulsoft_webviewer_action</url-pattern>
</servlet-mapping>
</web-app>
Leave unchanged the remaining web.xml blocks, which defines the servlets required for working. Then,
edit the index.jsp (see the code below).
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Stimulsoft Reports.Fx for Java</title>
</head>
<body>
<h1 align="center">My first report!</h1>
<stidesignerfx:iframe
width="100%" height="90%" align="middle"
styleClass="" frameborder="0" styleId=""
marginheight="4" marginwidth="10" name="stiviewer"
scrolling="no" style="" title="report"/>
</body>
</html>
Add taglib directives in the JSP (Listing 5). They will work with custom tags on the page.
Add a tag <stidesignerfx:iframe/>, an analog of an html tag iframe with the support of all its attributes.
See the following as a result of the application deployment, (see the picture below):
© 2003-2015 Stimulsoft
225 Stimulsoft Reports
All these are analogs of similar HTML tags, supporting all the attributes. A list of standard attributes is
expanded for displaying the report and setting variables for the report. The report = "SimpleList.mrt"
attribute opens the report with the name SimpleList.mrt. Variables in the Report can be passed in two
© 2003-2015 Stimulsoft
Java with Flex Client 226
ways:
Set the value of a variableStr attribute as a string in the following format: "Variable1 = value1 &
Variable2 = value2". In this case, two variables Variable1 with a value1 and Variable2 with a value2 in
the report will be passed. For example, you need to edit the index.jsp file to open a report with the
name MyFirstReport.mrt by clicking the button and the MyVar report variable has the stidesignerfx
value (Listing 5).
<html>
<head>
<title>Report</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<stidesignerfx:button value="Run the report designer" report="MyFirstReport.mrt"
variableStr="MyVar=stidesignerfx" />
</body>
</html>
It is also possible to pass parameters to a report as a Map <String, String>. Redesign our webpage
as follows (Listing 6). In this case, a report with the name MyFirstReport.mrt will be loaded in a report
and two parameters will be passed into it:
<html>
<head>
<title>Report</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<%
Map<String, String>variableMap= new HashMap<String, String>();
variableMap.put("Variable1", "var1");
variableMap.put("Variable2", "var2");
request.setAttribute("myMap", variableMap);
%>
<stidesignerfx:iframe report="MyFirstReport.mrt" variableMap="myMap"
width="100%" height="100%" align="right"
styleClass="" frameborder="0" styleId=""
© 2003-2015 Stimulsoft
227 Stimulsoft Reports
</body>
</html>
Data here are passed as a HashMap, this parameter should be set to the request or session, and the
key under which it will be there should be passed to the tag as a variableMap attribute. Applying two
attributes variableMap and variableStr is not allowed.
package my.servlet;
import java.io.IOException;
import java.util.Properties;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import my.actions.MyLoadAction;
import my.actions.MyLoadDataAction;
import my.actions.MyLocalizationAction;
import my.actions.MyMailAction;
import my.actions.MyRenderReportAction;
import my.actions.MySaveAction;
import com.stimulsoft.base.exception.StiException;
import com.stimulsoft.flex.StiFlexConfig;
/**
* Application initialization.
*/
public class ApplicationInitializer implements ServletContextListener {
@Override
public void contextInitialized(final ServletContextEvent event) {
try {
// configuration application
StiFlexConfig stiConfig = initConfigWithoutDir();
// ---------------------------------------------------------
// need to override the standard methods
// another comment
stiConfig.setLoadClass(MyLoadAction.class);
stiConfig.setSaveClass(MySaveAction.class);
© 2003-2015 Stimulsoft
Java with Flex Client 228
stiConfig.setLoadDataClass(MyLoadDataAction.class);
stiConfig.setMailAction(MyMailAction.class);
stiConfig.setLocalizationAction(MyLocalizationAction.class);
stiConfig.setRenderReportAction(MyRenderReportAction.class);
// ---------------------------------------------------------
StiFlexConfig.init(stiConfig);
@Override
public void contextDestroyed(final ServletContextEvent event) {
// empty
}
In which the main application directory with the file stimulsoft.properties will be defined. In order to
make your own reports saving or loading, it is necessary to specify these classes in a configuration, just
the same way as you can specify a class to load data from xml. Classes are as follow: Listing
MyLoadAction.java
package my.actions;
import java.io.InputStream;
import com.stimulsoft.flex.StiLoadAction;
import com.stimulsoft.flex.utils.StiSaveLoadFileReport;
@Override
© 2003-2015 Stimulsoft
229 Stimulsoft Reports
Listing MySaveAction.java:
package my.actions;
import com.stimulsoft.flex.StiSaveAction;
import com.stimulsoft.flex.utils.StiOperationResult;
import com.stimulsoft.flex.utils.StiSaveLoadFileReport;
@Override
public StiOperationResult save(String report, String reportName,
boolean newReportFlag) {
System.out.println("must override this method to specify your own
save report");
return new StiSaveLoadFileReport().save(report, reportName,
newReportFlag);
}
Listing MyLoadDataAction.java:
package my.actions;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;
import com.stimulsoft.flex.StiLoadDataAction;
@Override
protected String getConnectionString() {
System.out.println("must override this method to specify your own
connection string");
// return
// "Data Source=localhost\\SQLEXPRESS;Initial Catalog=Mybase;User
ID=UserName; Password=Password;";
return super.getConnectionString();
© 2003-2015 Stimulsoft
Java with Flex Client 230
@Override
protected String getUserName() {
System.out.println("must override this method to specify your own
user name");
// return "UserName";
return super.getUserName();
}
@Override
protected String getPassword() {
System.out.println("must override this method to specify your own
password");
// return "Password";
return super.getPassword();
}
@Override
protected String getQuery() {
System.out.println("my Query " + super.getQuery());
return super.getQuery();
}
@Override
public Connection getConnection() throws ClassNotFoundException,
SQLException {
System.out.println("must override this method to specify your own
connection");
boolean overrideByConnectionString = getConnectionString() != null
&& getConnectionString().equals("needOverride");
boolean overrideByDataSource = getDataSourceName() != null
&& getDataSourceName().equals("DataSourceOverride");
if (overrideByConnectionString || overrideByDataSource) {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Properties info = new Properties();
info.setProperty("user", "test");
info.setProperty("password", "test");
String connectionString = "jdbc:sqlserver://localhost\
\SQLEXPRESS1:1433;databaseName=mybase;";
return DriverManager.getConnection(connectionString, info);
} else {
return super.getConnection();
}
}
}
Listing MyLocalizationAction.java:
package my.actions;
© 2003-2015 Stimulsoft
231 Stimulsoft Reports
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import com.stimulsoft.base.exception.StiException;
import com.stimulsoft.base.utils.StiXmlMarshalUtil;
import com.stimulsoft.flex.StiLocalizationAction;
import com.stimulsoft.flex.StiLocalizationInfo;
import com.stimulsoft.lib.io.StiFileUtil;
@Override
public List<StiLocalizationInfo> getLocalizations() throws
StiException, FileNotFoundException {
System.out.println("must override this method to specify your own
Localizations");
List<StiLocalizationInfo> list = new
ArrayList<StiLocalizationInfo>();
File localizationDir = getLocalizationDir();
if (localizationDir.exists()) {
Iterator<File> iterateLocalization =
StiFileUtil.iterateFiles(localizationDir,
new String[] { "xml" }, false);
for (; iterateLocalization.hasNext();) {
File fileLoc = iterateLocalization.next();
InputStream is = new BufferedInputStream(new
FileInputStream(fileLoc));
StiLocalizationInfo localization =
StiXmlMarshalUtil.unmarshal(is,
StiLocalizationInfo.class);
localization.setKey(fileLoc.getName());
list.add(localization);
}
}
return list;
}
@Override
protected File getLocalizationDir() {
System.out.println("must override this method to specify your own
LocalizationDir");
return new File("Localization");
}
© 2003-2015 Stimulsoft
Java with Flex Client 232
@Override
public InputStream getLocalization(String key) throws StiException,
FileNotFoundException {
System.out.println("must override this method to specify your own
load Localization");
File file = new File(getLocalizationDir(), key);
return new BufferedInputStream(new FileInputStream(file));
}
}
Listing MyMailAction.java:
package my.actions;
import java.util.Properties;
import javax.mail.BodyPart;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import javax.mail.internet.PreencodedMimeBodyPart;
import com.stimulsoft.base.mail.StiMailProperties;
import com.stimulsoft.flex.StiMailAction;
import com.stimulsoft.flex.interactionObject.StiMailData;
/**
* MyMailAction.
*
* @Copyright Stimulsoft
*
*/
public class MyMailAction extends StiMailAction {
@Override
public void init(StiMailData mailData, StiMailProperties mailConf) {
System.out.println("must override this method to specify your own
init");
this.mailData = mailData;
this.mailConf = mailConf;
session = getSession();
}
@Override
© 2003-2015 Stimulsoft
233 Stimulsoft Reports
@Override
protected Properties getProperties() {
System.out.println("must override this method to specify your own
mail Properties");
Properties props = new Properties();
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
return props;
}
@Override
protected Message getMessage() throws MessagingException {
System.out.println("must override this method to specify your own
mail Message");
Message message = new MimeMessage(session);
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse(mailConf.getFrom()));
message.setRecipients(Message.RecipientType.CC,
InternetAddress.parse(mailConf.getRecipients()));
message.setSubject(mailConf.getSubject());
message.setContent(mp);
return message;
}
@Override
protected BodyPart getTextPart() throws MessagingException {
System.out.println("must override this method to specify your own
mail TextPart");
MimeBodyPart text = new MimeBodyPart();
text.setText(mailConf.getBody(), "UTF-8", "plain");
return text;
}
@Override
protected BodyPart getFilePart() throws MessagingException {
© 2003-2015 Stimulsoft
Java with Flex Client 234
@Override
public void sendMessage() throws MessagingException {
System.out.println("must override this method to specify your own
send Message");
Message message = getMessage();
Transport transport = getTransport();
transport.sendMessage(message, message.getAllRecipients());
transport.close();
}
}
Listing MyRenderReportAction.java:
package my.actions;
import java.io.IOException;
import com.stimulsoft.base.exception.StiException;
import com.stimulsoft.flex.StiRenderReportAction;
import com.stimulsoft.report.StiReport;
@Override
public StiReport render(StiReport report) throws IOException,
StiException {
System.out.println("must override this method to specify your own
render report");
return report.render();
}
}
© 2003-2015 Stimulsoft
235 Stimulsoft Reports
jdbc.driver={myDriver};
jdbc.url={myConnectionUrl};
jdbc.username={myUserName };
jdbc.password={ myUserPassword };
jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver;
jdbc.url= jdbc:sqlserver://[serverName[\instanceName][:portNumber]]
[;property=value[;property=value]];
jdbc.username={myUserName };
jdbc.password={ myUserPassword };
http://msdn.microsoft.com/en-us/library/ms378428
jdbc.driver=oracle.jdbc.driver.OracleDriver
jdbc.url=jdbc:oracle:thin:@[HOST][:PORT]:SID;
jdbc.username={myUserName };
jdbc.password={ myUserPassword };
http://www.orafaq.com/wiki/JDBC
jdbc.driver= org.postgresql.Driver
jdbc.url= jdbc:postgresql://[host]:[port]/[database]
jdbc.username={myUserName };
jdbc.password={ myUserPassword };
http://jdbc.postgresql.org/documentation/80/connect.html
© 2003-2015 Stimulsoft
Java HTML5 Designer 236
Leave unchanged the remaining web.xml blocks, which defines the servlets required for working. Then,
edit the index.jsp (Listing 2).
© 2003-2015 Stimulsoft
237 Stimulsoft Reports
<%@page import="com.stimulsoft.report.dictionary.dataSources.StiDataTableSource"%>
<%@page import="com.stimulsoft.report.utils.data.StiXmlTable"%>
<%@page import="com.stimulsoft.report.utils.data.StiXmlTableFildsRequest"%>
<%@page import="com.stimulsoft.webdesigner.StiWebDesigerHandler"%>
<%@page import="com.stimulsoft.webdesigner.StiWebDesignerOptions"%>
<%@page
import="com.stimulsoft.report.dictionary.databases.StiXmlDatabase"%>
<%@page import="java.io.File"%>
<%@page import="com.stimulsoft.report.StiSerializeManager"%>
<%@page import="com.stimulsoft.report.StiReport"%>
<%@page language="java" contentType="text/html; charset=utf-8"
pageEncoding="UTF-8"%>
<%@taglib uri="http://stimulsoft.com/webdesigner" prefix="stiwebdesigner"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Stimulsoft Webdesigner for Java</title>
<stiwebdesigner:resources />
<style type="text/css">
</style>
</head>
<body>
<%
final String reportPath =
request.getSession().getServletContext().getRealPath("/reports/Master-
Detail.mrt");
final String xmlPath =
request.getSession().getServletContext().getRealPath("/data/Demo.xml");
final String xsdPath =
request.getSession().getServletContext().getRealPath("/data/Demo.xsd");
final String savePath =
request.getSession().getServletContext().getRealPath("/save/");
© 2003-2015 Stimulsoft
Java HTML5 Designer 238
tableSource.setDictionary(report.getDictionary());
report.getDictionary().getDataSources().add(tableSource);
}
} catch (Exception e){
e.printStackTrace();
}
}
StiSerializeManager.serializeReport(report, fos);
fos.close();
} catch (Exception e){
e.printStackTrace();
}
}
};
pageContext.setAttribute("handler", handler);
pageContext.setAttribute("options", options);
%>
<stiwebdesigner:webdesigner
handler="${handler}" options="${options}" />
© 2003-2015 Stimulsoft
239 Stimulsoft Reports
</body>
</html>
Add taglib directives in the JSP. They will work with custom tags on the page.
Add a tag <stiwebdesigner:resources /> , tag used to load necessary resources (css & js) for
webdesigner, it haven’t any attributes, it must be placed inside HTML <head> tag.
Description of StiWebDesigerHandler
To handle designer events, class that implement StiWebDesigerHandler must be created and setup in
stiwebdesigner tag. Occured on opening {@link StiReport}.
© 2003-2015 Stimulsoft
Java HTML5 Designer 240
jdbc.driver={myDriver};
jdbc.url={myConnectionUrl};
jdbc.username={myUserName };
jdbc.password={ myUserPassword };
jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver;
jdbc.url= jdbc:sqlserver://[serverName[\instanceName][:portNumber]]
[;property=value[;property=value]];
jdbc.username={myUserName };
jdbc.password={ myUserPassword };
http://msdn.microsoft.com/en-us/library/ms378428
jdbc.driver=oracle.jdbc.driver.OracleDriver
jdbc.url=jdbc:oracle:thin:@[HOST][:PORT]:SID;
jdbc.username={myUserName };
jdbc.password={ myUserPassword };
http://www.orafaq.com/wiki/JDBC
jdbc.driver= org.postgresql.Driver
jdbc.url= jdbc:postgresql://[host]:[port]/[database]
jdbc.username={myUserName };
jdbc.password={ myUserPassword };
http://jdbc.postgresql.org/documentation/80/connect.html
21.1 Installation
Installation:
Download and install Java™ SE version 1.5 or higher (for the version 1.5 jaxb-impl and jaxb-api
libraries are required).
© 2003-2015 Stimulsoft
241 Stimulsoft Reports
Launch the Eclipse IDE, choose File> New> Project. In the project wizards open the Web type and in
the drop-down list select Dynamic Web Project wizard and click Next (Figure 1). Select dynamic Web
project:
In the window opened fill in the Project name (e.g. sti_webviewer, as shown on Figure2). Then configure
the web server, on which the application will run. Create a new dynamic Web project:
© 2003-2015 Stimulsoft
Java HTML5 Viewer 242
Target a runtime
Under Target Runtime, you see <None>, as shown in Figure 1, because you haven't created a runtime
yet for Apache Tomcat. Click New Runtime to open the New Target Runtime Wizard. Select Apache
Tomcat of the required version from the list of available, check the Create a new local server as shown
in Figure 3, then click Next.
© 2003-2015 Stimulsoft
243 Stimulsoft Reports
Target a runtime
Under Target Runtime, you see <None>, as shown in Figure 1, because you haven't created a runtime
yet for Apache Tomcat. Click New Runtime to open the New Target Runtime Wizard. Select Apache
Tomcat of the correct version from a list. Check Create a new local server as shown on Figure 3, then
click Next.Create a new server runtime:
Then define the Tomcat installation directory, in which Apache Tomcat is installed, or in which one
needs to install it, as shown on Figure 4. If it is not installed, then click Download and Install. After all
fields are specified, click Finish. Define the server location:
© 2003-2015 Stimulsoft
Java HTML5 Viewer 244
In order to verify the project and the Tomcat server, create a simple JSP and deploy it on Tomcat. To
do this, one can create a new JSP, by choosing File> New> Other, or one can use the context menu,
right-click the project name in the Project Explorer and select New> JSP file. In the next window (see
Figure 5) define the directory WebContent, and in the File name write index.jsp. Click Finish to create
pages using the default template:
© 2003-2015 Stimulsoft
245 Stimulsoft Reports
Now open the index.jsp and edit it so that it displays the current date. The code page is specified in
the Listing 1.
© 2003-2015 Stimulsoft
Java HTML5 Viewer 246
<body>
<%java.util.Date date = new java.util.Date();%>
<h1>
This index.jsp.<br>
<%=date.toString()%>
</h1>
</body>
</html>
Now deploy it on the server. For this one need to use the context menu, right-click the project name,
select Run> Run as> Run on server. Define a previously created server and click Finish:
© 2003-2015 Stimulsoft
247 Stimulsoft Reports
As a result, you receive the following (see Figure 7). This page will be available from any browser at
http://localhost:8080/{ProjectName} (where the {ProjectName} name of the created project, in our
case sti_webviewer):
© 2003-2015 Stimulsoft
Java HTML5 Viewer 248
© 2003-2015 Stimulsoft
249 Stimulsoft Reports
Next, open the web.xml for editing, it should look like in Listing 2:
© 2003-2015 Stimulsoft
Java HTML5 Viewer 250
</servlet>
<servlet-mapping>
<servlet-name>StimulsoftAction</servlet-name>
<url-pattern>/stimulsoft_webviewer_action</url-pattern>
</servlet-mapping>
</web-app>
Leave unchanged the remaining web.xml blocks, which defines the servlets required for working. Then,
edit the index.jsp (Listing 4).
It will display empty webviewer (because of empty StiReport object). Add taglib directives in the JSP.
They will work with custom tags on the page.
Add a tag <stiwebviewer:resources />, tag used to load necessary resources (css & js) for
webviewer, it haven’t any attributes, it must be placed inside HTML <head> tag.
© 2003-2015 Stimulsoft
251 Stimulsoft Reports
Example of usage webviewer tag (display generated (mdc) report from d:\repots\TwoSimpleLists.mdc
with custom parameters)
pageContext.setAttribute("report", report);
pageContext.setAttribute("options", options);
%>
<h1 align="center">My first report!</h1>
<stiwebviewer:webviewer report="${report}" options="${options}"/>
</body>
</html>
© 2003-2015 Stimulsoft
Java HTML5 Viewer 252
21.6 Options
© 2003-2015 Stimulsoft
253 Stimulsoft Reports
is false.
boolean scrollbarsMode - A value which indicates that the web viewer will show the report with,
default is false.
boolean menuAnimation - A value which indicates that menu animation is enabled, default is
true.
StiShowMenuMode menuShowMode - The mode that shows menu of the viewer, default id
StiShowMenuMode.Click.
StiPrintDestination menuPrintDestination - The default mode of the report print destination,
default is StiPrintDestination.Default.
StiPagesViewMode pagesViewMode - The mode of showing a report in the web viewer - one
page or the whole report, default is StiPagesViewMode.OnePage.
int menuZoom - The report showing zoom. The default value is 100.
StiContentAlignment pageAlignment - The alignment of the web viewer page, default is
StiContentAlignment.Center.
boolean pageShowShadow - A value which indicates that the shadow of the page will be
displayed in the webviewer, default is true.
StiColor pageBorderColor - A color of the page border, default is Gray.
boolean bookmarksVisible - A visibility of the Toolbar of the web viewer, default is true;
boolean bookmarksPrint - A value which allows printing report bookmarks, default is false;
int bookmarksTreeWidth - A width of the bookmarks tree in the web viewer, default is 180.
boolean toolbarVisible - A value which indicates that report bookmarks will be shown in the web
viewer, default is true;
StiColor toolbarBackgroundColor - A color of the toolbar background.
StiColor toolbarFontColor - A color of the toolbar texts.
String toolbarFontFamily - A value which indicates which font family will be used for drawing texts
in the webviewer, default is Arial;
StiContentAlignment toolbarAlignment - The alignment of the web viewer toolbar, default is
StiContentAlignment.Default;
boolean toolbarButtonCaptions - A value which allows displaying or hiding toolbar buttons
captions, default is false;
boolean toolbarMenuCaptions - A value which allows displaying or hiding toolbar menu
captions, default is true;
boolean showCurrentPageControl - A visibility of the current page control in the toolbar of the
web viewer, default is true;
boolean showButtonPrint - A visibility of the Print button in the toolbar of the web viewer, default
is true;
boolean showButtonSave - A visibility of the Save button in the toolbar of the web viewer, default
is true;
boolean showButtonBookmarks - A visibility of the Parameters button in the toolbar of the web
viewer, default is true;
boolean showButtonParameters - A visibility of the Parameters button in the toolbar of the web
viewer, default is true;
boolean showButtonFirstPage - A visibility of the First Page button in the toolbar of the web
viewer, default is true;
boolean showButtonPreviousPage - A visibility of the Prev Page button in the toolbar of the web
viewer, default is true;
boolean showButtonNextPage - A visibility of the Next Page button in the toolbar of the web
viewer, default is true;
boolean showButtonLastPage - A visibility of the Last Page button in the toolbar of the web
viewer, default is true;
© 2003-2015 Stimulsoft
Java HTML5 Viewer 254
boolean showButtonZoom - A visibility of the Zoom control in the toolbar of the webviewer,
default is true;
boolean showButtonViewMode - visibility of the View Mode button in the toolbar of the web
viewer, default is true;
boolean showExportDialog - A value which allows to display the export dialog, or to export with
the default settings, default is true;
boolean showExportToDocument - A value which indicates that the user can save the report
from the web viewer to the report document file, default is true;
boolean showExportToPdf - A value which indicates that the user can save the report from the
web viewer to the PDF format, default is true;
boolean showExportToXps - A value which indicates that the user can save the report from the
web viewer to the XPS format, default is true;
boolean showExportToHtml - A value which indicates that the user can save the report from the
web viewer to the HTML format, default is true;
boolean showExportToText - A value which indicates that the user can save the report from the
web viewer to the TEXT format, default is true;
boolean showExportToRtf - A value which indicates that the user can save the report from the
web viewer to the RTF format, default is true;
boolean showExportToWord2007 - A value which indicates that the user can save the report
from the web viewer to the Word 2007-2010 format, default is true;
boolean showExportToExcel - A value which indicates that the user can save the report from the
web viewer to the Excel BIFF format, default is true;
boolean showExportToExcelXml - A value which indicates that the user can save the report from
the web viewer to the ExcelXML format, default is true;
boolean showExportToExcel2007 - A value which indicates that the user can save the report from
the web viewer to the Excel 2007-2010 format, default is true;
boolean showExportToCsv - A value which indicates that the user can save the report from the
web viewer to the CSV format, default is true;
boolean showExportToXml - A value which indicates that the user can save the report from the
web viewer to the XML format, default is true;
boolean showExportToSylk - A value which indicates that the user can save the report from the
web viewer to the Sylk format, default is true;
boolean showExportToImageBmp - A value which indicates that the user can save the report
from the web viewer to the BMP image format, default is true;
boolean showExportToImageJpeg - A value which indicates that the user can save the report
from the web viewer to the JPEG image format, default is true;
boolean showExportToImagePcx - A value which indicates that the user can save the report from
the web viewer to the PCX image format, default is true;
boolean showExportToImagePng - A value which indicates that the user can save the report
from the web viewer to the PNG image format, default is true;
boolean showExportToImageSvg - A value which indicates that the user can save the report from
the web viewer to the SVG image format, default is true;
boolean showExportToImageSvgz - A value which indicates that the user can save the report
from the web viewer to the SVGZ image format, default is true;
int refreshTimeout - A value wich indicates timeout in minutes for execute dummy request to
avoid end session, default is 0 (disabled);
© 2003-2015 Stimulsoft
255 Stimulsoft Reports
jdbc.driver={myDriver};
jdbc.url={myConnectionUrl};
jdbc.username={myUserName };
jdbc.password={ myUserPassword };
jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver;
jdbc.url= jdbc:sqlserver://[serverName[\instanceName][:portNumber]]
[;property=value[;property=value]];
jdbc.username={myUserName };
jdbc.password={ myUserPassword };
http://msdn.microsoft.com/en-us/library/ms378428
jdbc.driver=oracle.jdbc.driver.OracleDriver
jdbc.url=jdbc:oracle:thin:@[HOST][:PORT]:SID;
jdbc.username={myUserName };
jdbc.password={ myUserPassword };
http://www.orafaq.com/wiki/JDBC
jdbc.driver= org.postgresql.Driver
jdbc.url= jdbc:postgresql://[host]:[port]/[database]
jdbc.username={myUserName };
jdbc.password={ myUserPassword };
http://jdbc.postgresql.org/documentation/80/connect.html
22 WinRT Viewer
ViewerRT is used to display reports in the WinRT components. The component can display a report,
zoom it, save rendered reports to various exporting formats and print them.
© 2003-2015 Stimulsoft
WinRT Viewer 256
Add the following code to display the rendered report (*.mdc, *.mdz, *.mdx):
XAML:
<Page x:Class="Demo.RT.BlankPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:viewerRT="using:Stimulsoft.Report.Viewer.RT">
<viewerRT:StiViewerControl x:Name="viewerControl"/>
</Page>
C#:
namespace Demo.RT
{
public sealed partial class BlankPage : Page
{
#region Handlers
async private void BlankPage_Loaded(object sender, RoutedEventArgs
e)
{
StorageFolder folder =
Windows.Storage.KnownFolders.DocumentsLibrary;
StorageFile storageFile = await
folder.GetFileAsync("SimpleList.mdc");
public BlankPage()
{
this.InitializeComponent();
this.Loaded += BlankPage_Loaded;
}
}
}
If the report has not been rendered, i.e. the report template is saved (*.mrt, *.mrz, *.mrx), then enter the
following code:
XAML:
<Page x:Class="Demo.RT.BlankPage"
© 2003-2015 Stimulsoft
257 Stimulsoft Reports
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:viewerRT="using:Stimulsoft.Report.Viewer.RT">
<viewerRT:StiViewerControl x:Name="viewerControl"/>
</Page>
C#:
namespace Demo.RT
{
public sealed partial class BlankPage : Page
{
#region Handlers
async private void BlankPage_Loaded(object sender, RoutedEventArgs
e)
{
StorageFolder folder =
Windows.Storage.KnownFolders.DocumentsLibrary;
StorageFile storageFile = await
folder.GetFileAsync("SimpleList.mrt");
viewerControl.Report = report;
}
#endregion
public BlankPage()
{
this.InitializeComponent();
this.Loaded += BlankPage_Loaded;
}
}
}
The report can be saved from the project code. Here is an example of the code to save a report:
XAML:
<Page x:Class="Demo.RT.BlankPage">
© 2003-2015 Stimulsoft
WinRT Viewer 258
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:viewerRT="using:Stimulsoft.Report.Viewer.RT">
<viewerRT:StiViewerControl x:Name="viewerControl"/>
</Page>
C#:
namespace Demo.RT
{
public sealed partial class BlankPage : Page
{
#region Handlers
async private void buttonSaveReport_Click(object sender,
RoutedEventArgs e)
{
StiReport report = new StiReport();
StorageFolder folder =
Windows.Storage.KnownFolders.DocumentsLibrary;
StorageFile storageFile = await
folder.CreateFileAsync("Report1.mdc");
await report.SaveDocumentAsync(storageFile);
}
#endregion
public BlankPage()
{
this.InitializeComponent();
this.Loaded += BlankPage_Loaded;
}
}
}
23 WinRT Designer
The report designer for WinRT is designed for creating and editing reports in Windows 8 and works
with ARM and Intel versions. The UI of the designer provides for user convenient control, wide range of
tools, components and instruments for creating reports, visual design and previewing. The operations
in the designer can be done using touch (hand, stylus) or mouse. The report designer supports Ribbon
interface 2013.
In this topic we will review the examples of working from code for the report designer WinRT.
© 2003-2015 Stimulsoft
259 Stimulsoft Reports
Loading a report:
In order to load the report designer for further editing it is necessary to assign a report to the Report
property of the designer. If you do not assign anything to this property, the designer will be loaded
Saving a report:
After creating or editing a report template you should save the changes. Below is a method of saving a
report code in the *.mrt file:
24 Exports
This section describes principles of saving rendered reports to different formats, basic characteristics
of methods for export, export optimization guidelines data structure which are used in export methods.
Stimulsoft Reports supports great many export formats to save rendered reports. Many clients think
that there are too many formats. But when you need to get file of definite format type, write only one
string of code and the format is not PDF, HTML or RTF, only Stimulsoft Reports may help. We do not
think that too many export formats in our report generator is disadvantage and continually work on
© 2003-2015 Stimulsoft
Exports 260
adding new formats. The more exports the better, as they say.
A list of supported file formats is represented in the table below. All exports are joined into groups.
Export Name
Microsoft Excel
BMP (Bitmap)
PCX (PCExchange)
© 2003-2015 Stimulsoft
261 Stimulsoft Reports
Stimulsoft Reports offers many ways of exporting rendered reports to other formats. Each method of
export to other format has several settings. For exporting rendered reports Stimulsoft Reports uses a
system of services. This means that all objects which are used in export are represented in the
collection of services and when it is necessary to export a report, the report generator searches the
appropriate service in the collection of services. There are two ways of exporting rendered formats to
other formats from code: using the ExportDocument method of the StiReport class, and using direct
creating or getting from a collection of services the required export service.
The ExportDocument method is a simplified wrapping for report exports. There is no need to get the
required export service. All you need is to define the export type, pass parameters of export and
define the folder where the file should be saved. For example:
The following code id used to export reports to PDF. The PDF file will be placed in the MyReport.Pdf.
The export parameters can be passed using the StiPdfExportSettings object type. This class is
described in the description of the PDF format. If there is no need to change export parameters then it
is possible to use the short code line:
report.ExportDocument(StiExportFormat.Pdf, "MyReport.Pdf");
In this case the export parameters are not passed and the report generator will use parameters which
are set by default for each export. Besides, the result of export can be placed in the stream. For
example:
Notice: The ExportDocument method does not call the Render method automatically. Before calling
the ExportDocument method it is necessary to render a report or load a previously rendered report.
As you can see, no services in examples were not created and samples contain simple code. All work by
creating services and checking parameters can be done using the ExportDocument method.
The code above requires connection the following namespaces from assemblies
© 2003-2015 Stimulsoft
Exports 262
Stimulsoft.Reports.dll:
Stimulsoft.Report
Formats Description
Formats which are used for representing documents and allows for easy viewing and printing:
Web formats:
HtmlTable export to Html using the Html Table element, to create a report
structure.
HtmlSpan export to Html using the Html Span element, to create a report
structure.
HtmlDiv export to Html using the Html Div element, to create a report
structure.
Text formats:
Rtf export to Rich Text Format by default. This element duplicates the
HtmlTable mode.
RtfTable export to Rich Text Format using the Rtf Table element, to create
a report structure.
RtfFrame export to Rich Text Format using the Rtf Frame element, to create
a report structure.
RtfWinWord export to Rich Text Format using the Microsoft Word graphic
element, to create a report structure.
© 2003-2015 Stimulsoft
263 Stimulsoft Reports
Spreadsheets:
Excel export to Microsoft Excel. The file is created using the BIFF (Binary
Interchange File Format).
ExcelXml export to Microsoft Excel Xml. The file is created using the Xml.
This format is supported starting with Microsoft Office 2003.
Export as data:
Export as image:
The way to create the export service is shown below. See the code:
If you exported from the WinForms Viewer, then you should notice, than for each export the special
form for setting parameters of export is shown. This form can be called from the code. The code below
© 2003-2015 Stimulsoft
Exports 264
service.Export(report, "MyReport.pdf");
This code will call the dialog form for setting parameters of export. If a user clicks "OK", then the file
will be created. If to click the "Cancel" button, then the file creation will be interrupted.
Notice: The name of the method for the report export with dialog forms differs from the name of
the export method without parameters.
The export service of a report contains yet another ability. The report can be sent via Email. For
example:
This code will call the dialog form for setting parameters of reports, and if a user clicks "OK", then the
reporting tool will call the Email client and will create a new Email letter, the exported report will be
attached to the Email letter. The code above requires connection of the following names from the
Stimulsoft.Report.dll assemblies:
Stimulsoft.Report
Stimulsoft.Report.Export
© 2003-2015 Stimulsoft
265 Stimulsoft Reports
StiOdtExportService
Stimulsoft Reports supports two exports with fixed page layout. What is the fixed page layout? This
means that all elements of a page can be placed at any part of a page. In this case, if to change a
position of one element then other components position will not be changed. These are formats to
PDF (Portable Document Format), Microsoft Power Point 2007/2010 and XPS (XML Paper
Specification).
24.3.1 PDF
PDF (Portable Document Format) – is a file format created by Adobe Systems for document exchange
used to create electronic editions using the Adobe Acrobat package. The PDF format is a file text
format that is used to publish documents on any platform and OS. The PDF document contains one or
more pages. Each page may contain any components: text, graphic and illustrations, information, that
provides navigation across the document.
Export to PDF is based on the "Adobe Portable Document Format, Version 1.3, second edition", using
some elements of latest format specifications.
By default all embedded fonts are optimized. Characters which are not used in a report are excluded. It
allows decreasing the size of a file. But, for correct work of the editable field, the font should be
complete. Therefore, for fonts, which are used in editable fields, optimization is not done. This
increases the output file size. If Asian languages are used, the file size can be 15-20mb.
If by some reasons the font optimization is not working correct it can be forcibly disabled using the
static property:
© 2003-2015 Stimulsoft
Exports 266
StiOptions.Export.Pdf.ReduceFontFileSize = false;
Digital signature is a requisite of an electronic document used to protect this document from
falsification. This document is a result of cryptographic conversion of information using the closed key
of the electronic signature and allows identifying the owner of the certificate of the key of the signature.
Digital signatures are often used to implement electronic signatures
The StiPdfExportSettings class is used to control digital signature. It has the following properties:
By default:
UseDigitalSignature = false;
UseLocalMachineCertificates = true;
GetCertificateFromCryptoUI = true;
SubjectNameString = string.Empty;
24.3.1.3 Encryption
A PDF document can be encoded to protect the content from unauthorized access. A user may set the
following parameters of encryption:
User password;
Owner password;
© 2003-2015 Stimulsoft
267 Stimulsoft Reports
Access permission;
Key length.
Using the StiPdfExportSettings class it is possible to set the encryption parameters from code. The
following properties of this class are used:
PasswordInputUser = string.Empty;
PasswordInputOwner = string.Empty;
UserAccessPrivileges = StiUserAccessPrivileges.All;
KeyLength = StiPdfEncryptionKeyLength.Bit40;
An example of using:
© 2003-2015 Stimulsoft
Exports 268
To enable the export of editable fields it is necessary to set the static property
StiOptions.Export.Pdf.AllowEditablePdf = true;
If it is necessary to have the MultiLine editable field, then it is necessary to set the WordWrap
property of the text box to true.
The export parameters of the PDF export are described in the StiPdfExportSettings class. The
description of all class properties are in the table below.
ImageQuality float image quality; may have values from 0.0 (the lowest quality) to
1.0 (the highest quality); by default 0.75
ImageResolution float image resolution dpi; can take any value, by default 100
EmbeddedFonts bool embed font files into the PDF file; is true then all fonts are
embedded into the file and this file will have the same look on
any computer (there is no need to embed additional fonts); if
false then fonts are not embedded; by default true
StandardPdfFonts bool use standard fonts which are embedded in Adobe Acrobat
Reader and there is no need to embed them into the file; all
fonts are changed on standard fonts (Courier, Helvetica, Times-
Roman); by default false
Compressed bool compress the PDF file; decreases the file size by compressing
the text information (images are always compressed); by default
true
UseUnicode bool writes a text in the Unicode; if false then 190 symbols can be
written, and a lot of problems with native language symbols may
occur; if true then any symbols can be used; by default true
ExportRtfTextAsImage bool export RichText objects as images; if false then export tries to
convert RichText objects into PDF primitives; if true the RichText
is written as an image; by default false
© 2003-2015 Stimulsoft
269 Stimulsoft Reports
GetCertificateFromCry bool get the certificate from the Crypto interface; if false then a
ptoUI certificate is searched by certificate identifier without using the
interface; by default true
UseLocalMachineCerti bool search certificates on the local machine; if false then certificate is
ficates searched in the store of the current user; by default false
ImageCompressionMe enum image compression method - JPEG (with quality loss) or Flate
thod (without quality loss); by default
StiPdfImageCompressionMethod.Jpeg
If the UseUnicode is used then, for Acrobat Reader 5.0, it is necessary to use the Embedded fonts =
true. If the UseUnicode + encoding is used, then it is necessary to use the Embedded fonts = true.
Except the StiPdfExportSettings class, parameters of export to PDF are also set using the static
properties. All properties are described in the table below. To access to export properties it is
necessary to add the StiOptions.Export.Pdf... prefix. For example,
© 2003-2015 Stimulsoft
Exports 270
StiOptions.Export.Pdf.DivideSegmentPages.
DivideSegmentPages bool divide segmented pages into separate pages; if false then are
exported "as is" without dividing; by default true
ReduceFontFileSize bool optimize embedded fonts - eliminate symbols which are not
met in a report; if false then fonts are not changed; by default
true
AllowEditablePdf bool export editable fonts as editable PDF objects (in this case fonts
which are used in editable fields are not optimized); if false
then editable fields are exported as simple text; by default
false
AllowImageComparer bool use the image comparer, e.g. replace image duplicates (see
Common export settings); if false then an image is exported
"as is"; by default true
AllowInheritedPageResou bool store resources of pages in the parent dictionary and inherit
rces from it; if false then resources of pages are specified in each
page; this property is critical for some programs of PDF files
processing; by default true
24.3.2 XPS
XPS (XML Paper Specification) is the open graphic format of fixed page layout on the base XML (more
precisely XAML-based) used to store printed output as electronic documents. This format was
developed by Microsoft as alternative to the PDF format.
The XPS document format consists of structured XML markup that defines the layout of a document
and the visual appearance of each page, along with rendering rules for distributing, archiving,
rendering, processing and printing the documents. The markup language for XPS is a subset of XAML
© 2003-2015 Stimulsoft
271 Stimulsoft Reports
that allows including vector graphic elements, using XAML to mark up the WPF-primitives.
The XPS is a ZIP-archive that contains the files which make up the document. The archive includes page
mark up (one file per each page of a document), text, embedded fonts, raster images, 2D vector
graphics and other information.
The export parameters of the XPS export are described in the StiXpsExportSettings class. The
description of all class properties are in the table below.
ImageQuality float image quality; may have values from 0.0 (the lowest quality)
to 1.0 (the highest quality); by default 0.75
ImageResolution float image resolution dpi; can take any value, by default 100
Besides the StiXpsExportSettings class, the parameters of export to XPS are also set using the static
properties. All properties are described in the table below. To access to export properties it is
necessary to add the StiOptions.Export.Xps... prefix. For example,
StiOptions.Export.Xps.ReduceFontFileSize.
ReduceFontFileSize bool optimize embedded fonts - exclude symbols which are not
met in a report; if false then fonts are not changed; by
default true
AllowImageComparer bool use the image comparer, e.g. replace image duplicates (see
Common export settings); if false then an image is exported
"as is"; by default true
© 2003-2015 Stimulsoft
Exports 272
The export parameters of the PPT export are described in the StiPpt2007ExportSettings class. The
description of all class properties are in the table below.
ImageQuality float image quality; may have values from 0.0 (the lowest quality)
to 1.0 (the highest quality); by default 0.75
ImageResolution float image resolution dpi; can take any value, by default 100
Besides the StiPpt2007ExportSettings class, the parameters of the export to PPT are also set using the
static properties. All properties are described in the table below. To access to export properties it is
necessary to add the StiOptions.Export.Ppt2007... prefix. For example,
StiOptions.Export.Ppt2007.ReduceFontFileSize.
AllowImageComparer bool use the image comparer, e.g. replace image duplicates (see
Common export settings); if false then an image is exported
"as is"; by default true
There are two formats HTML (HyperText Markup Language), HTML5 and MHTML (MIME HTML) are
described in this chapter. The first and second formats are used for web page layout. The second
format is a web page archive format used to bind resources together with the HTML code into a single
file.
24.4.1 HTML
HTML (HyperText Markup Language) is the predominant markup language for Web pages. The
majority of web pages are created using the HTML language. The HTML language is interpreted by
browser and shown as a document. HTML is a tag language of the document layout. It provides a
means to describe the structure of text-based information in a document by denoting certain text as
links, headings, paragraphs, lists, etc. Elements are the basic structure for HTML markup. Elements have
two basic properties: attributes and content. Each attribute and each element's content has certain
restrictions that must be followed for a HTML document to be considered valid. An element usually has
a start tag (e.g. <element-name>) and an end tag (e.g. </element-name>).
© 2003-2015 Stimulsoft
273 Stimulsoft Reports
The export parameters of the HTML export are described in the StiHtmlExportSettings class. The
description of all class properties are in the table below.
Except the StiHtmlExportSettings class parameters of export to HTML are set using the static
properties. All properties are described in the table below. To access to export properties it is
necessary to add the StiOptions.Export.Html... prefix. For example,
StiOptions.Export.Html.ConvertDigitsToArabic.
© 2003-2015 Stimulsoft
Exports 274
ReplaceSpecialCharacters bool change symbols '<', '>', '&', ' " ' on < > &
" by default true
24.4.2 MHT
MHTML (MIME HTML) is a web page archive format used to bind resources which are typically
represented by external links (such as images, Flash animations, Java applets, audio files) together with
HTML code into a single file. This file is a web archive and has the «.mht» extension. The content of a
file is written as an Email message using the MIME standard: in the beginning of a file the HTML file is
written. Then all resources in the base64 encoding with headers are written. Internet Explorer, Opera,
Microsoft Word can work with the MHTML format.
The export parameters of the MHT export are described in the StiMhtExportSettings class. The
description of all class properties are in the table below.
© 2003-2015 Stimulsoft
275 Stimulsoft Reports
This chapter describes exports formats of text files. In other words the files which are used to create
text documents.
24.5.1 TXT
Text file (TXT) is a kind of computer file that is structured as a sequence of lines. A text file exists
within a computer file system. The end of a text file is often denoted by placing one or more special
characters, known as an end-of-file marker, after the last line in a text file.
The export parameters of the TXT export are described in the StiTxtExportSettings class. The
description of all class properties are in the table below.
DrawBorder bool draw border lines; if false, then borders are not
drawn; by default true
KillSpaceGraphLines bool remove all rows of a text which contains only blank
spaces and symbols of the vertical border; by default
true
PutFeedPageCode bool put feed page code after each page; by default true
© 2003-2015 Stimulsoft
Exports 276
CutLongLines bool cut too long lines of a text which cannot be placed in
text boxes; by default true
Static properties of export to TXT are shown on the table below. To access to export properties it is
necessary to add the StiOptions.Export.Txt... prefix. For example,
StiOptions.Export.Txt.ColumnWidths.
ColumnWidths string forcibly set the text column width (the list through the
semicolon); if a row is empty then the column width is not
changed; by default empty string
UseFullTextBoxWidth bool use all text box width for a text; in this case if the text is laid
on a border, then the border is erased in this place; if false,
then when drawing a text, one blank space on the right is
always left for correct drawing borders; by default false
UseOldMode bool use the old mode of the text export; this property is left for
keeping compatibility with old versions; by default false
UseFullVerticalBorder bool draw vertical border outside a cell. So a border will never be
closed with a text; by default true
UseFullHorizontalBorder bool draw horizontal border outside a cell. So a border will never
be closed with a text; by default true
CheckBoxTextForTrue string a text that shows the checkbox true status ; by default "+"
CheckBoxTextForFalse string a text that shows the check false status; by default "-"
24.5.2 RTF
Rich Text Format (RTF) is a free document file format developed by Microsoft for cross-platform
document interchange. The first version of the RTF standard appeared in 1987. Since that time format
specification was changed and added. RTF-documents are supported by many text editors.
© 2003-2015 Stimulsoft
277 Stimulsoft Reports
The export parameters of the RTF export are described in the StiRtfExportSettings class. The
description of all class properties are in the table below.
ImageQuality float image quality; may have values from 0.0 (the lowest
quality) to 1.0 (the highest quality); by default 0.75
ImageResolution float image resolution dpi; can take any value, by default
100
CodePage int this property is obsolete and is not used any longer,
remained for compatibility with earlier versions
Except the StiRtfExportSettings class parameters of export to RTF can be set using the static
properties. All properties are described in the table below. To access to export properties it is
necessary to add the StiOptions.Export.Rtf... prefix. For example,
StiOptions.Export.Rtf.UsePageRefField.
ConvertDigitsToArabic bool convert ASCII digits into Arabic digits; by default false
DivideSegmentPages bool divide segmented pages into separate pages; if false then
are exported "as is" without dividing; by default true
LineHeightExactly bool export rows heights of a table "exactly"; if false then the
height is exported as "at least"; by default true
© 2003-2015 Stimulsoft
Exports 278
DivideBigCells bool divide big cells into smaller ones for easier editing and
scrolling; by default true
The export parameters of the Word 2007 export are described in the StiWord2007ExportSettings
class. The description of all class properties are in the table below.
ImageQuality float image quality; may have values from 0.0 (the lowest
quality) to 1.0 (the highest quality); by default 0.75
ImageResolution float image resolution dpi; can take any value, by default 100
Static properties of export to Word 2007. To access to export properties it is necessary to add the
StiOptions.Export.Word2007... prefix. For example,
StiOptions.Export.Word2007.DivideSegmentPages.
© 2003-2015 Stimulsoft
279 Stimulsoft Reports
24.5.4 ODT
Open Document Text (ODT) is the open document for storing documents of the OpenOffice Writer,
which is included into the OpenOffice.org package.
OpenOffice.org is the open package of office applications created as alternative to Microsoft Office.
OpenOffice.org was one of the first what supported the new open OpenDocument. Works on Microsoft
Windows and UNIX systems: GNU/Linux, Mac OS X, FreeBSD, Solaris, Irix.
OpenDocument Format (ODF) is the open file format for storing office documents, including text
documents, spreadsheets, images, data bases, presentations. This format is based on the XML format.
OpenOffice Writer is the text processor and visual HTML editor, included into the OpenOffice. It is open
software (LGPL license). Writer is similar to Microsoft Word and has approximately the same
functionality. Writer allows saving documents in different formats including Microsoft Word, RTF,
XHTML, and OASIS Open Document Format. Starting with the OpenOffice version 2.0, the
OpenDocument Format is the default format for saving documents. File have the «.odt» extension.
When exporting the report is converted into a single table. The document is easily editable but some
objects can be changed.
The export parameters of the ODT export are described in the StiOdtExportSettings class. The
© 2003-2015 Stimulsoft
Exports 280
ImageQuality float image quality; may have values from 0.0 (the lowest quality) to1.0
(the highest quality); by default 0.75
ImageResolution float image resolution, dot per inch; may have any value, by default 100
Static properties of export to ODT. To access to export properties it is necessary to add the
StiOptions.Export.Odt... prefix. For example, StiOptions.Export.Odt.DivideSegmentPages.
AllowImageComparer bool use the image comparer, e.g. replace image duplicates
(see Common export settings); if false then an image is
exported "as is"; by default true
24.6 Spreadsheets
This group of exports create spreadsheets. They are exports to both different formats of Microsoft
Excel and to OpenOffice Calc.
24.6.1 Excel
Microsoft Excel is a spreadsheet application written and distributed by Microsoft for Microsoft
Windows. It allows using calculation, graphing tools, pivot tables and a macro programming language
called VBA. So, it is the most popular table processor available for these platforms since version 5 in
1993.
Microsoft Excel up until Excel 2007 version used a proprietary binary file format called Binary
Interchange File Format (BIFF) and .xls file extension. Specification was closed but since 2008 it was
published. Besides, most of Microsoft Excel can read CSV, DBF, SYLK, DIF, and other formats.
© 2003-2015 Stimulsoft
281 Stimulsoft Reports
The export parameters of the XLS export are described in the StiExcelExportSettings class. The
description of all class properties are in the table below.
ImageQuality float image quality; may have values from 0.0 (the lowest
quality) to1.0 (the highest quality); by default 0.75
ImageResolution float image resolution, dot per inch; may have any value, by
default 100
UseOnePageHeaderAndFooter bool remove from a report all page headers (except the first
one) and all page footers (except the last one); by default
false
ExportDataOnly bool export data only, e.g. all components which are placed on
data bands; by default false
Static properties of export to Excel. To access to export properties it is necessary to add the
StiOptions.Export.Excel... prefix. For example, StiOptions.Export.Excel.AllowExportDateTime.
AllowExportDateTime bool export date and time; if false then date and time are
exported as text strings; by default false
ColumnsRightToLeft bool set the order of columns from right to left; by default
false
DivideBigCells bool divide big cells into smaller ones for easier editing and
scrolling; by default true
© 2003-2015 Stimulsoft
Exports 282
For storing documents as the basic Microsoft Excel format, right up to the Excel 2007 version, used its
own binary format of files (BIFF) and the file extension was «.xls». In Excel 2007/2010, the basic format
is the Microsoft Office Open XML format and stores document in files with the «.xlsx» extension. The
Excel 2007 is compatible with binary formats such as CSV, DBF, SYLK, DIF, and others.
The export parameters of the Excel 2007 export are described in the StiExcel2007ExportSettings class.
The description of all class properties are in the table below.
ImageQuality float image quality; may have values from 0.0 (the
lowest quality) to1.0 (the highest quality); by
default 0.75
ImageResolution float image resolution, dot per inch; may have any
value, by default 100
ExportDataOnly bool export data only, e.g. all components which are
placed on data bands; by default false
© 2003-2015 Stimulsoft
283 Stimulsoft Reports
24.6.3 ODS
Open Document Spreadsheet (ODS) is the opened format to store OpenOffice Calc spreadsheet
documents, that is included into the OpenOffice.org package.
OpenDocument Format (ODF) — an open document file format for storing and exchanging editable
documents including text documents (such as notes, reports, and books), spreadsheets, drawings,
databases, presentations. The format is based on the XML-format. The standard was jointly developed
by public and various organizations and is available to all and can be used without restrictions.
OpenOffice Calc is the table processor that is included into the OpenOffice and is a free software (LGPL
license). Calc is similar to the Microsoft Excel spreadsheet and functionality of these processors is
approximately equal. Calc allows you to saving documents to various formats, including Microsoft
Excel, CSV, HTML, SXC, DBF, DIF, UOF, SLK, SDC. Starting with version OpenOffice 2.0, for document
storage format by default OpenDocument Format, files are saved with the extension «. Ods». Starting
with the OpenOffice version 2.0 for storing documents, by default, the OpenDocument Format is used.
Files are stored with the «.ods» extension.
The export parameters of the ODS export are described in the StiOdsExportSettings class. The
description of all class properties are in the table below.
ImageQuality float image quality; may have values from 0.0 (the lowest quality)
to1.0 (the highest quality); by default 0.75
ImageResolution float image resolution, dot per inch; may have any value, by
default 100
© 2003-2015 Stimulsoft
Exports 284
Static properties of export to ODS. To access to export properties it is necessary to add the
StiOptions.Export.Ods... prefix. For example, StiOptions.Export.Ods.AllowImageComparer.
24.7 Data
This is a group of file formats which are used to store table data.
24.7.1 CSV
CSV (Comma Separated Values) is a text format that is used to represent table data. Each string of the
file is one row of the table. The values of each column are separated by the delimiter that depends on
regional settings. The values that contain reserved characters (such as a comma or a new string) are
framed with the double quotes ( ") symbol; if double quotes are found in the value they are
represented as two double quotes in the file.
Notice: Only those data (components) can be exported to the CSV format which are placed on data
bands. If the SkipColumnHeaders property is set to false then, additionally, column headers are
exported as the first row.
The export parameters of the CSV export are described in the StiCsvExportSettings class. The
description of all class properties are in the table below.
Separator string sets the symbol-separator of a list that is used when exporting;
by default CurrentCulture.TextInfo.ListSeparator
© 2003-2015 Stimulsoft
285 Stimulsoft Reports
Static properties of export to CSV. To access to export properties it is necessary to add the
StiOptions.Export.Csv... prefix. For example, StiOptions.Export.Csv.ForcedSeparator.
ForcedSeparator string sets the separator forcibly which are used in export; if
the empty string is set then the symbol from export
settings in used; by default - empty string
24.7.2 DBF
The DBF (DataBase File) is the format to store data and it is used as the standard way to store and
pass information. The DBF file consist of a header section for describing the structure of the data in the
file. There are several variations on the .dbf file structure.
Notice: Only data can be exported to the DBF format, in other words only the components, which
are placed on data bands.
The following elements can be specified in the Tag field to control export:
DataType [ : FieldLength [ : DecimalPartLength ] ]
ExportType : "FieldName"
Column: "FieldName" "DataString"
Several elements should be separated with the semicolon. The “DataType" element should be only one
and should be placed first, other elements – if necessary.
Values of the "DataType" element are shown in the table below. If the data type is not set, then the
string data type is taken by default. The "FieldLength" element sets fixed width of a data field. If the
field width is not set, then the width is taken from the table. For the string type the default width is the
longest string. The "DecimalPartLength" element sets the number of characters after comma. If it is not
set, then the default number is taken.
© 2003-2015 Stimulsoft
Exports 286
Type Description
string : 25 set the column width (25 characters) and cuts all long strings
float :10 converts decimal digit with the length 10 characters, 5 characters
after comma
float :10 : 2 converts decimal digit with the length 10 characters, 2 characters
after comma
int :10 : 2 converts integer digit with the length 10 characters; the second
parameter is ignored
Notice: If the integer part of a digit is long and cannot be placed into the specified field, then it is
cut, so data are lost. For example, if the write «-12345,678» in the «float:8:3» field, then the «2345,678»
will be output.
The "ExportType" element indicates for which export the field name is set. The values can be used:
“dbf”, “csv”, “xml”, “default”. The "FieldName" element indicates the field name in the file (for the DBF
the is automatically cut up to 10 characters). The own name can be specified to each type of export. If
the name for each export is not specified then the name for the “default” type is taken. For example:
The "Column" element indicates that the additional field is added to the exported data. The
"FieldName" element indicates the name of a new field. The "DataRow" element indicates the content of
a new field and can be expression. For example
The export parameters of the DBF export are described in the StiDbfExportSettings class. The
description of all class properties are in the table below.
© 2003-2015 Stimulsoft
287 Stimulsoft Reports
24.7.3 XML
XML (eXtensible Markup Language) is a text format that is used to store structured data (in exchange
for existed files of data bases), for exchange of information between programs and also to create on
its base the special markup languages (for example, XHTML), sometimes called dictionaries. XML is the
hierarchical structure that is used to store any data. Visually this structure can be represented as the
tree. XML supports Unicode and other encoding.
Notice: Only those data (components) are exported to the XML format which are placed on data
bands.
The following elements can be specified in the Tag field to control export to XML:
DataType
ExportType : "FieldName"
Column: "FieldName" "DataRow"
Several elements should be separated with the semicolon. The “DataType" element should be only one
and should be placed first, other elements – if necessary.
Values of the "DataType" element are shown in the table below. If the data type is not set, then the
string data type is taken by default.
int Numeric
long Numeric
float Decimal
double Decimal
string Text
date Date
The "ExportType" element indicates for which export the field name is set. The values can be used:
“dbf”, “csv”, “xml”, “default”. The "FieldName" element indicates the field name in the file. The own name
can be specified to each type of export. If the name for each export is not specified then the name for
the “default” type is taken. For example:
© 2003-2015 Stimulsoft
Exports 288
The "Column" element indicates that additional field is added to the exported data. The "FieldName"
element indicates the name of a new field. The "DataRow" element indicates the content of a new field
and can be expression. For example:
24.7.4 DIF
DIF (Data Interchange Format) is a text format that is used to exchange sheets between spreadsheets
processors (Microsoft Excel, OpenOffice.org Calc, Gnumeric, StarCalc, Lotus 1-2-3, FileMaker, dBase,
Framework, Multiplan, etc). The only limitation of this format is that the DIF format may contain only one
sheet in one book.
The export parameters of the DIF export are described in the StiDifExportSettings class. The
description of all class properties are in the table below.
UseDefaultSystemEncoding bool use the default system encoding; if false then use
encoding that is set by the Encoding property; by
default true
24.7.5 SYLK
SYLK (Symbolic Link) format- this text format is used to exchange data between applications,
specifically spreadsheets. Files of SYLK have «.slk» extension. Microsoft does not publish a SYLK
specification, therefore work with this format in different applications can be different.
Notice: A SYLK file can be written in Unicode and read by some applications but anyway many
applications which do support Unicode writes SYLK files into ANSI but not Unicode. Therefore, symbols
which do not have representation in the system code page will be written as ('?') symbols.
The export parameters of the SYLK export are described in the StiSylkExportSettings class. The
description of all class properties are in the table below.
© 2003-2015 Stimulsoft
289 Stimulsoft Reports
UseDefaultSystemEncoding bool use the default system encoding; if false then use
encoding that is set by the Encoding property; by
default true
24.8 Images
Export groups to graphic formats. All graphic formats can be divided in to types: bitmapped images
and vector formats. Notice. On the current moment the export of monochrome image is supported
only to the BMP, GIF, PCX, PNG, TIFF
format. So the DitheringType property works only for these exports.
All exports of images have the same export settings. They are described in the table below. But each
format has its own ExportSettings class. For BMP, GIF, PNG, TIFF, JPEG, PCX, and EMF the following
classes are used in exports. The StiBmpExportSettings is used for export to BMP,
StiGifExportSettings is used for export to GIF, StiPngExportSettings is used for export to PNG,
StiTiffExportSettings is used for export to TIFF, StiJpegExportSettings is used for export to JPEG,
StiPcxExportSettings is used for export to PCX, and StiEmfExportSettings is used for export to EMF.
© 2003-2015 Stimulsoft
Report Inheritance 290
25 Report Inheritance
In both ways you should create a basic report in the designer that includes all necessary elements. You
may add the following components to the basic reports:
Pages;
Components;
Data sources;
Variables;
Connections.
After the report has been created you may either save the report as a special basic class (for this you
should use the Save as command) or save the report as a regular report and then use it as a master
report. In the first case, you will get the C# or VB.NET class, and will be able to create new reports. For
example:
In order to use the basic report when creating a new report in the designer, you need to add the
following string of a code:
StiReport.ReportType = typeof(Reports.Report);
Then all new reports will be automatically inherited from the basic class. In the second way you need to
use the following code:
report.MasterReport = masterReport.SaveToString();
report.Design();
© 2003-2015 Stimulsoft
291 Stimulsoft Reports
26 Scripts
The report generator uses a single specified programming language to generate the report code and
handle report events. If the current programming language of a report does not suit your requirements
you can change it. The options are currently C# or VB.NET.
In the Language group select a new programming language and press Ok. The current programming
language will then be changed.
Important: The underlying report code will have to be regenerated for the entire report, and any
changes which have been made within the report code will be lost.
It is not convenient to change the programming language each time a report is rendered, so Stimulsoft
Reports allows you to set the default programming language used by all new reports.
To do this you should use the Services Configurator utility. All programming languages in Stimulsoft
Reports are located under the Languages node. The language which is shown first in the list is the
default programming language. For example, on the picture below the C# programming language is
the default programming language. To make VB.Net the default programming language simply drag
the StiCSharpLanguage service down one position with the mouse or use the up and down buttons to
re-order the languages.
© 2003-2015 Stimulsoft
Scripts 292
When you create a new report its source code, often called the report script, is generated automatically
using either C# or VB.NET programming language depending on the currently selected default. You can
use only one of these programming languages at a time
In the report code the structure and initialization of the report class, which itself inherits from the
StiReport class, are described. When adding new pages, components or changing any parameters of a
report, those changes are automatically recorded within the class. The report class therefore contains a
description of all components, data, events, report properties, and data source structures for the
report. Any events specified by the user are also added to the report code.
For the ultimate in power and flexibility Stimulsoft Reports allows direct editing of the report code - if
you want something not provided by the available properties and features of the designer you can
actually code your own features within the report. When writing events or another code in the report,
you use the standard syntax of the selected .Net Framework programming language i.e. if the language
is set to C# you write code using C# syntax.
Note: The report code is generated in C# or VB.Net programming language. All events and any
another code in this report must be written in the currently selected language.
When rendering reports, compilation of the report class occurs first. After that the compiled report is
© 2003-2015 Stimulsoft
293 Stimulsoft Reports
executed.
Note: The report code is compiled using the .NET Framework compiler.
Whilst Stimulsoft Reports allows you to directly edit the report code, it is important to remember that it
is impossible to make changes in the parts of the report code which are automatically updated - such
changes will be lost when the next update takes place. The automatically updated report code is
enclosed in Region preprocessor directives:
© 2003-2015 Stimulsoft
Scripts 294
Any code that you write within the report must be written outside these Regions.
27 Right To Left
By default, components are output from left to right. The Right to Left property allows changing the
mode of showing report items.
There is a capability to change the mode of showing viewer items and order of showing report pages
in WinForms. By default, showing of all elements of the viewer and the display order of pages of the
report is left to right. How the viewer will look like can depend on the static RightToLeft property of
the viewer. If the RightToLeft property is set to No, then the viewer items and pages of the report in
the viewer window are shown from left to right. Code below show how to set the left to right mode of
showing viewer items and report pages:
StiOptions.Viewer.RightToLeft = StiRightToLeftType.No;
If the RightToLeft property is set to Yes, then viewer items and report pages in a viewer window are
displayed from right to left. The code for setting the right to left mode is shown below:
StiOptions.Viewer.RightToLeft = StiRightToLeftType.No;
27.2 Icons
With the help of icons information about the components, settings and tools applied to these
components in the reports is displayed. These icons are filtering, conditions and events of the inherited
report, dynamic collapsing, dynamic sorting, order, quick information. By default, these icons are
displayed in the left to right order in a component, but if necessary, they can be displayed in the right
to left order. It is possible using the properties: ConditionsRightToLeft, EventsRightToLeft,
InheritedRightToLeft, InteractionCollapsingRightToLeft, InteractionSortRightToLeft,
OrderAndQuickInfoRightToLeft, FiltersRightToLeft, QuickButtonsRightToLeft. They belong to the
StiOptions.Viewer.Pins class. Consider these features in more detail:
The mode of displaying the Conditions icon depends on the value of the ConditionsRightToLeft
property. For example, if to place a Condition in the DataBand, then the Conditions icon will be
displayed by default in the lower left corner of this DataBand, because the ConditionsRightToLeft
property is set to false. The picture below shows an example of a report template with the Conditions
icon in the left to right mode:
© 2003-2015 Stimulsoft
295 Stimulsoft Reports
Set the ConditionsRightToLeft property to true to change the position of the icon:
StiOptions.Viewer.Pins.ConditionsRightToLeft = true;
And then the icon will be displayed in the "right to left" mode, i.e. in the lower right corner of the
DataBand. The picture below shows an example of a report template with the Conditions icon in the
right to left mode:
Change the value of the EventsRightToLeft property to change the location of the Events icon. For
example, if to place an Event in the text component, then the Events bookmark will be displayed by
default in the upper left corner of the text component, because the EventsRightToLeft property is set
to false. The picture below shows an example of a report template with the Events icon in the left to
right mode:
Set the EventsRightToLeft property to true to change the location of the Events icon.
StiOptions.Viewer.Pins.EventsRightToLeft = true;
The picture below shows an example of a report template with the Events icon in the right to left mode:
© 2003-2015 Stimulsoft
Right To Left 296
The InheritedRightToLeft property is used to change the location of the Inherited icon. By default,
this property is set to false, i.e. the icon appears in the left to right mode. The picture below shows an
example of a report template with the Inherited icon in the left to right mode:
StiOptions.Viewer.Pins.InheritedRightToLeft = true;
the Inherited icon will appear in the right to left mode (see the picture below):
StiOptions.Viewer.Pins.InteractionCollapsingRightToLeft = true;
© 2003-2015 Stimulsoft
297 Stimulsoft Reports
Collapsing icons will appear in the right to left mode (see the picture below):
The InteractionSortRightToLeft property is used to change the location of the InteractionSort icon.
By default, this property is set to false, i.e. the icon appears in the left to right mode. The picture below
shows an example of a report template with the InteractionSort icon in the left to right mode:
StiOptions.Viewer.Pins.InteractionSortRightToLeft = true;
the InteractionSort icon will appear in the right to left mode (see the picture below):
The OrderAndQuickInfoRightToLeft property is used to change the location of the Show Order
icon. By default, this property is set to false, i.e. the icon appears in the left to right mode. The picture
below shows an example of a report template with the Show Order icon in the left to right mode:
© 2003-2015 Stimulsoft
Right To Left 298
StiOptions.Viewer.Pins.InteractionSortRightToLeft = true;
the Show Order icon will appear in the right to left mode (see the picture below):
The FiltersRightToLeft property is used to change the location of the Filters icon. By default, this
property is set to false, i.e. the icon appears in the left to right mode. The picture below shows an
example of a report template with the Filters icon in the left to right mode:
StiOptions.Viewer.Pins.FiltersRightToLeft = true;
the Filters icon will appear in the right to left mode (see the picture below):
The QuickButtonsRightToLeft property is used to change the location of the QuickButtons icon. By
default, this property is set to false, i.e. the icon appears in the left to right mode. The picture below
shows an example of a report template with the Filters icon in the left to right mode:
© 2003-2015 Stimulsoft
299 Stimulsoft Reports
StiOptions.Viewer.Pins.QuickButtonsRightToLeft = true;
the QuickButtons icon will appear in the right to left mode (see the picture below):
In the designer and WPF report viewer it is possible to set the mode of showing controls in the right to
left direction. By default, all controls are displayed in the left to right order. It is possible to change this.
The FlowDirection property is used for this. If the property is set to LeftToRight, then controls are
shown from left to right (see the code below).
FlowDirection="LeftToRight"
The picture below shows the left to right order of showing controls in the designer and viewer. If the
FlowDirection property is set to RightToLeft, then controls are shown in the right to left order. See
the code below how to achieve this result.
FlowDirection="RightToLeft"
The picture below shows the right to left order of showing controls in the designer and viewer.
© 2003-2015 Stimulsoft
Right To Left 300
As can be seen from the picture above, the order of showing report pages in the viewer also depends
on the value of the FlowDirection property.
28 Deployment
© 2003-2015 Stimulsoft
301 Stimulsoft Reports
Assemblies Description
Stimulsoft.Report.dll This baseline assembly contains the base functionality of the report
generator.
Stimulsoft.Report.Chart.dll This baseline assembly contains the core of the chart component.
Stimulsoft.Design.dll This assembly contains Visual Studio design-time part of the StiReport
class and StiDesignerControl class.
Stimulsoft.Database.dll This dll file is used for creating and editing a connections string. Also
this dll contains QueryBuilder.
Stimulsoft.Report.Web.dll This assembly helps showing reports in ASP.NET and contains Web
Viewer.
Demo Applications:
Tools:
Installer.exe This application helps to install Stimulsoft Reports.Net into GAC. Also it
helps in using NGEN utility.
© 2003-2015 Stimulsoft
Deployment 302
Import.Rdl.exe This application is used for converting the RDL (Report Definition
Language) templates to the Stimulsoft Reports.Net templates.
Import.Rtf.exe This application is used for converting the RTF (Rich Text Format) files
to the Stimulsoft Reports.Net templates.
Assemblies Description
Stimulsoft.Report.Wpf.Des This assembly contains Visual Studio design-time part for the WPF
ign.dll viewer and WPF designer.
Stimulsoft.Report.Xbap.De This assembly contains Visual Studio design-time part for the XBAP
sign.dll viewer.
© 2003-2015 Stimulsoft
303 Stimulsoft Reports
Stimulsoft.Database.dll This dll file is used for creating and editing a connections string. Also
this dll contains QueryBuilder.
Stimulsoft.Report.Wpf.Blac This assembly contains the Black theme for the WPF report viewer and
kTheme.dll WPF report designer.
Stimulsoft.Report.Wpf.Offi This assembly contains the Office 2003 Blue theme for the WPF report
ce2003BlueTheme.dll viewer and WPF report designer.
Stimulsoft.Report.Wpf.Offi This assembly contains the Office 2003 Olive Green theme for the WPF
ce2003OliveGreenTheme.dl report viewer and WPF report designer.
l
Stimulsoft.Report.Wpf.Offi This assembly contains Office 2003 Silver theme for the WPF report
ce2003SilverTheme.dll viewer and WPF report designer.
Stimulsoft.Report.Wpf.Offi This assembly contains Office 2007 Black theme for the WPF report
ce2007BlackTheme.dll viewer and WPF report designer.
Stimulsoft.Report.Wpf.Offi This assembly contains Office 2007 Blue theme for the WPF report
ce2007BlueTheme.dll viewer and WPF report designer.
Stimulsoft.Report.Wpf.Offi This assembly contains Office 2007 Silver theme for the WPF report
ce2007SilverTheme.dll viewer and WPF report designer.
Stimulsoft.Report.Wpf.Offi This assembly contains Office 2010 Blue theme for the WPF report
ce2010BlueTheme.dll viewer and WPF report designer.
Demo Applications:
Tools:
Installer.exe This application helps to install Stimulsoft Reports.Net into GAC. Also it
helps in using NGEN utility.
© 2003-2015 Stimulsoft
Deployment 304
Import.Rdl.exe This application is used for converting the RDL (Report Definition
Language) templates to the Stimulsoft Reports.Net templates.
Import.Rtf.exe This application is used for converting the RTF (Rich Text Format) files
to the Stimulsoft Reports.Net templates.
Assemblies Description
Stimulsoft.Report.dll This baseline assembly contains the base functionality of the report
generator.
Stimulsoft.Database.dll This dll is used for creating and editing connections string. Also this
dll contains QueryBuilder.
© 2003-2015 Stimulsoft
305 Stimulsoft Reports
Stimulsoft.Report.Web.dll This assembly helps to show reports in ASP.NET and contains Web
Viewer.
Stimulsoft.Report.WebFx.dl This assembly helps to show reports in ASP.NET with help of Adobe
l Flash and contains WebViewer.Fx.
Demo application:
Tools:
Installer.exe This application helps to install Stimulsoft Reports into GAC. Also it
helps in using NGEN utility.
Import.Rdl.exe This application is used for converting the RDL (Report Definition
Language) templates to the Stimulsoft Reports.Net templates.
Import.Rtf.exe This application is used for converting the RTF (Rich Text Format) files
to the Stimulsoft Reports.Net templates.
Assemblies Description
© 2003-2015 Stimulsoft
Deployment 306
Assemblies Description
Stimulsoft.Report.dll This baseline assembly contains the base functionality of the report
generator.
Stimulsoft.Database.dll This dll is used for creating and editing connections string. Also this
dll contains QueryBuilder.
Silverlight Assemblies:
Stimulsoft.Compression.SL. The assembly provides compression methods for using in the report
dll generator. It is a Silverlight based assembly.
Stimulsoft.Report.SL.dll This baseline assembly contains the base functionality of the report
generator. It is a Silverlight based assembly.
Stimulsoft.Report.Check.SL. This assembly contains core of the Report Checker tool for Silverlight.
dll
© 2003-2015 Stimulsoft
307 Stimulsoft Reports
Stimulsoft.Report.Design.SL This assembly contains Silverlight Viewer for using in the WinForms
Viewer.dll report designer for showing report with help of Silverlight preview
tab.
Demo application:
Tools:
OptionsHelper.exe This application is used for creating Options.xml file for Designer.exe
application.
Installer.exe This application helps to install Stimulsoft Reports into GAC. Also it
helps in using NGEN utility.
Import.Rdl.exe This application is used for converting the RDL (Report Definition
© 2003-2015 Stimulsoft
Deployment 308
Import.Rtf.exe This application is used for converting the RTF (Rich Text Format) files
to the Stimulsoft Reports.Net templates.
Assemblies Description
Assemblies Description
Stimulsoft.Report.dll This baseline assembly contains the base functionality of the report
generator.
Stimulsoft.Report.Chart.dll This baseline assembly contains the core of the chart component.
Stimulsoft.Design.dll This assembly contains Visual Studio design-time part of the StiReport
class and StiDesignerControl class.
© 2003-2015 Stimulsoft
309 Stimulsoft Reports
ll report engine.
Stimulsoft.Database.dll This dll file is used for creating and editing a connections string. Also
this dll contains QueryBuilder.
Stimulsoft.Report.Web.dll This assembly helps showing reports in ASP.NET and contains Web
Viewer.
Stimulsoft.Report.WebFx.d This assembly helps to show reports in ASP.NET with help of Adobe
ll Flash and contains WebViewer.Fx.
Stimulsoft.Database.Wpf.d This dll is used for creating and editing a connections string. Also this
ll dll contains QueryBuilder.
Stimulsoft.Report.Design.S The assembly contains Silverlight Viewer for using in WinForms report
LViewer.dll designer for showing report with help of Silverlight preview tab.
Stimulsoft.Report.Wpf.Des This assembly contains Visual Studio design-time part for the WPF
ign.dll viewer and WPF designer.
Stimulsoft.Report.Xbap.De This assembly contains Visual Studio design-time part for the XBAP
sign.dll viewer.
Stimulsoft.Report.Wpf.Blac This assembly contains Black theme for the WPF report viewer and
kTheme.dll WPF report designer.
Stimulsoft.Report.Wpf.Offi This assembly contains Office 2003 Blue theme for the WPF report
ce2003BlueTheme.dll viewer and WPF report designer.
Stimulsoft.Report.Wpf.Offi This assembly contains Office 2003 Olive Green theme for the WPF
ce2003OliveGreenTheme.dl report viewer and WPF report designer.
l
Stimulsoft.Report.Wpf.Offi This assembly contains Office 2003 Silver theme for the WPF report
ce2003SilverTheme.dll viewer and WPF report designer.
Stimulsoft.Report.Wpf.Offi This assembly contains Office 2007 Black theme for the WPF report
© 2003-2015 Stimulsoft
Deployment 310
Stimulsoft.Report.Wpf.Offi This assembly contains Office 2007 Blue theme for the WPF report
ce2007BlueTheme.dll viewer and WPF report designer.
Stimulsoft.Report.Wpf.Offi This assembly contains Office 2007 Silver theme for the WPF report
ce2007SilverTheme.dll viewer and WPF report designer.
Stimulsoft.Report.Wpf.Offi This assembly contains Office 2010 Blue theme for the WPF report
ce2010BlueTheme.dll viewer and WPF report designer.
Silverlight Assemblies:
Stimulsoft.Compression.SL This assembly provides compression methods for using in the report
.dll generator. It is a Silverlight based assembly.
Stimulsoft.Report.SL.dll The baseline assembly contains the basic functionality of the report
generator. It is a Silverlight based assembly.
Stimulsoft.Report.Check.SL This assembly contains core of the Report Checker tool for Silverlight.
.dll
Demo Applications:
© 2003-2015 Stimulsoft
311 Stimulsoft Reports
Tools:
Installer.exe This application helps to install Stimulsoft Reports.Net into GAC. Also it
helps in using NGEN utility.
Import.Rdl.exe This application is used for converting the RDL (Report Definition
Language) templates to the Stimulsoft Reports.Net templates.
Import.Rtf.exe This application is used for converting the RTF (Rich Text Format) files
to the Stimulsoft Reports.Net templates.
OptionsHelper.exe This application is used for creating Options.xml file for Designer.exe
application.
StyleDesigner.Wpf.exe This application helps to design reports styles. It uses WPF technology.
ReportChecker.Wpf.exe The utility used for checking reports on issues. It uses WPF technology.
© 2003-2015 Stimulsoft
Deployment 312
Assemblies Description
Stimulsoft_ViewerFx.swc This library contains the report engine and report viewer.
DemoFx for Flex.exe The Adobe AIR application which demonstrates main features of
Stimulsoft Reports.Fx.
Assemblies Description
DemoFx for PHP.exe An Adobe AIR application which demonstrates basic features of
Stimulsoft Reports.Fx.
localization (folder) This folder contains all localization files. The list of localization files is
indicated automatically when loading the designer or viewer.
swfobject.js These files are used for loading the Flash content and Flash player
playerProductInstall.swf updates.
designer.html Stimulsoft Reports.Fx web based report designer and report viewer
viewer.html files.
DesignerFx_PHP.swf
ViewerFx_PHP.swf
index.php
handler.php
localization.php
database_xml
database_mssql.php
database_mysql.php
© 2003-2015 Stimulsoft
313 Stimulsoft Reports
database_odbc.php
database_oracle.php
database_pg.php
Assemblies Description
stimulsoft.reports.fx-web- This library is used for the report viewer and report designer in a
2011.1.1000.jar web application.
stimulsoft.reports.fx-swt- This library for using the report viewer and report designer in an
2011.1.1000.jar swt application.
DemoFx for Java.exe An Adobe AIR application which demonstrates basic features of
Stimulsoft Reports.Fx.
There is no possibility of creating a method that compiles into memory and returns the assembly. This
is because of the restrictions of .NET Framework. If, in the application, the .NET assembly is loaded,
then the assembly is locked until the application closes even if the assembly is loaded from a stream. In
this case, the assembly is stored in the temp directory of the windows, and then loaded into memory.
Loading the report assemblies (like any other .NET assembly) is a file on disk in a particular place and
memory for this, blocked by the assembly.
Use the reports in the application as C# classes (keeping them as classes in the report designer). In
this case, the report is compiled with your application, and, therefore, it does not need compilation and
loading assemblies. When updating, it is inconvenient to administer reports.
Use reports as a compiled assembly, i.e. save reports as assemblies of the report designer. In this
case,when updating reports, it is also too inconvenient to administer them.
© 2003-2015 Stimulsoft
Deployment 314
Do not use reports compilation. But use the interpretation of the expressions in the report.
Interpreter mode can be enabled by means of the CalculationMode report property. However, one
should consider that the expressions interpreter works slower than compiled expression. The
interpreter cannot interpret all expressions of C# and VB.NET. Also, do not use events in the report
components.
Compilation and report rendering in another application domain. In this case, after rendering the
report its assembly can be unloaded along with the entire application domain from memory. The
locked assembly file can be removed after unload. To create a report, you can use the
CreateReportInNewAppDomain() method of the StiReport class, for its upload use the
UnloadReportAppDomain() method. However, in this case, the RegData method and
RegBusinessObject work very slowly (as data marshaling in another domain is used). It is better
request data from the report. Creating and deleting the application domain takes some time.
One of the most effective ways is a report compilation when first calling the report. And with each
next calling - report loading from the previously compiled assembly. In this case, the report is stored in
memory only once, the assembly on disk only once. Before running the application the folder where
reports are stored can be removed (before using report) as all reports will be recreated (when
accessed). Here is the code that uses this method. New rendered report is created if it does not, or if
the report has been modified, and if the version of the .NET Framework, which has been collected for
the assembly, and the version under which the application is running is not the same. With this method,
only the first run is slow.
Code Sample:
string folder =
Environment.GetFolderPath(Environment
.SpecialFolder.LocalApplicationData);
folder = Path.Combine(folder, "Stimulsoft\\CompiledReports");
folder = Path.Combine(folder,
System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion().ToS
tring());
string compiledReportFile = Path.Combine(folder,
report.GetReportAssemblyCacheName());
if (File.Exists(compiledReportFile))
report = StiReport.GetReportFromAssembly(compiledReportFile, true);
else
{
if (!Directory.Exists(folder)) Directory.CreateDirectory(folder);
report.Compile(compiledReportFile);
}
report.Render(false);
Precompilation of reports updating them. This method is a variation of the previous one. After
updating reports in the application, or if they are not present, or if necessary, start the compilation
process of all reports, which are used in the application. Before compiling the old version assemblies is
© 2003-2015 Stimulsoft
315 Stimulsoft Reports
removed. Sometimes the process of compiling the report for a given process may take some time.
The following assemblies and files of Stimulsoft Reports.Net can be delivered with the final
application:
Stimulsoft.Base.dll
Stimulsoft.Controls.dll
Stimulsoft.Controls.Win.dll
Stimulsoft.Database.dll
Stimulsoft.Editor.dll
Stimulsoft.Report.dll
Stimulsoft.Report.Win.dll
Stimulsoft.Report.Design.dll
Stimulsoft.Report.Web.dll
Localization files
The following assemblies and files of Stimulsoft Reports.Wpf can be delivered with the final application:
Stimulsoft.Base.dll
Stimulsoft.Database.Wpf.dll
Stimulsoft.Report.dll
Stimulsoft.Report.Check.dll
Stimulsoft.Report.Wpf.dll
Stimulsoft.Report.Wpf.BlackTheme.dll
Stimulsoft.Report.Wpf.Office2003BlueTheme.dll
Stimulsoft.Report.Wpf.Office2003OliveGreenTheme.dll
Stimulsoft.Report.Wpf.Office2003SilverTheme.dll
Stimulsoft.Report.Wpf.Office2007BlackTheme.dll
Stimulsoft.Report.Wpf.Office2007BlueTheme.dll
Stimulsoft.Report.Wpf.Office2007SilverTheme.dll
Stimulsoft.Report.Wpf.Office2010BlueTheme.dll
Stimulsoft.Report.WpfDesign.dll
Stimulsoft.Report.Helper.dll
Localization files
The following assemblies and files of Stimulsoft Reports.Web can be delivered with the final application:
Stimulsoft.Base.dll
Stimulsoft.Report.dll
© 2003-2015 Stimulsoft
Deployment 316
Stimulsoft.Report.Web.dll
Stimulsoft.Report.WebDesign.dll
Stimulsoft.Report.WebFx.dll
Localization files
Important: The Stimulsoft.Report.Design assembly cannot be distributed. The licensing per number
of developers is required.
The following assemblies and files of Stimulsoft Reports Designer.Web can be delivered with the final
application:
Stimulsoft.Report.WebDesign.dll
The following assemblies and files of Stimulsoft Reports.Silverlight can be delivered with the final
application:
Stimulsoft.Base.SL.dll
Stimulsoft.Compression.SL.dll
Stimulsoft.Controls.SL.dll
Stimulsoft.Report.SL.dll
Stimulsoft.Report.SLDesign.dll
Stimulsoft.Report.Viewer.SL.dll
Stimulsoft.Report.WebSL.dll
Stimulsoft.Report.WebDesignSL.dll
Localization files
The following assemblies and files of Stimulsoft Reports Designer.Silverlight can be delivered with the
final application:
Stimulsoft.Report.WebDesignSL.dll
The following assemblies and files of Stimulsoft Reports.Ultimate can be delivered with the final
application:
Stimulsoft.Controls.dll
© 2003-2015 Stimulsoft
317 Stimulsoft Reports
Stimulsoft.Controls.Win.dll
Stimulsoft.Base.dll
Stimulsoft.Database.dll
Stimulsoft.Database.Wpf.dll
Stimulsoft.Editor.dll
Stimulsoft.Report.dll
Stimulsoft.Report.Check.dll
Stimulsoft.Report.Win.dll
Stimulsoft.Report.Web.dll
Stimulsoft.Report.WebFx.dll
Stimulsoft.Report.Wpf.dll
Stimulsoft.Report.Wpf.BlackTheme.dll
Stimulsoft.Report.Wpf.Office2003BlueTheme.dll
Stimulsoft.Report.Wpf.Office2003OliveGreenTheme.dll
Stimulsoft.Report.Wpf.Office2003SilverTheme.dll
Stimulsoft.Report.Wpf.Office2007BlackTheme.dll
Stimulsoft.Report.Wpf.Office2007BlueTheme.dll
Stimulsoft.Report.Wpf.Office2007SilverTheme.dll
Stimulsoft.Report.Wpf.Office2010BlueTheme.dll
Stimulsoft.Report.Design.dll
Stimulsoft.Report.DesignHelper.dll
Stimulsoft.Report.WebDesign.dll
Stimulsoft.Report.WpfDesign.dll
Stimulsoft.Base.SL.dll
Stimulsoft.Compression.SL.dll
Stimulsoft.Controls.SL.dll
Stimulsoft.Report.SL.dll
Stimulsoft.Report.SLDesign.dll
Stimulsoft.Report.Viewer.SL.dll
Stimulsoft.Report.WebSL.dll
Stimulsoft.Report.WebDesignSL.dll
Localization files
The following assemblies and files of Stimulsoft Reports.Fx for Flex can be delivered with the final
application:
Stimulsoft_ViewerFx.swc
Stimulsoft_DesignerFx.swc
Localization files
The following assemblies and files of Stimulsoft Reports.Fx for PHP can be delivered with the final
application:
© 2003-2015 Stimulsoft
Deployment 318
Server-side files
Client-side files
Localization files
The following assemblies and files of Stimulsoft Reports.Fx for Java can be delivered with the final
application:
For distribution Stimulsoft Reports assemblies together with the application it is enough to copy them
to the folder where the application file is saved. Registration to GAC is not required. Registration of
COM objects is not required. Registration in registry is not required. Using the NGEN utility is not
required.
For distribution Stimulsoft Reports.Web together with a web application it is enough to copy them to
the bin folder of an application. Registration to GAC is not required. Registration of COM objects is not
required. Registration in registry is not required. Using the NGEN utility is not required.
For distribution Stimulsoft Reports.Web together with a web application it is enough to copy them to
the bin folder of an application. Registration to GAC is not required. Registration of COM objects is not
required. Registration in registry is not required. Using the NGEN utility is not required. For working
with the product Stimulsoft Reports.Net report generator is required.
The most frequently used way of reports deployment is deployment reports as files. Stimulsoft Reports
supports two type of files: unpacked report (the .mrt file extension) and packed reports (the .mrz file
extension). Packed reports have small file size but it takes much time for saving and loading them. For
loading the previously saved report the following code is required:
C#:
© 2003-2015 Stimulsoft
319 Stimulsoft Reports
report.Load("report.mrt");
VB.NET:
C#:
VB.NET:
For automatic generation a report code the standard .NET Framework languages are used. When
using C#, it is possible to write the same code as in Visual Studio.NET. The same can be said about
VB.NET, where a report code can be saved and in the Visual Studio.NET project. Use the File | Save
Report As… menu for saving a report code
© 2003-2015 Stimulsoft
Deployment 320
Notice: The report code is completely compatible with C# and VB languages. Therefore, the report
code can be saved and used in the Visual Studio.NET project.
© 2003-2015 Stimulsoft
321 Stimulsoft Reports
Stimulsoft Reports reports generation has the unique ability to compile reports to the .Net Framework
assembly. Use the File | Save Report As… menu for saving a report to the assembly.
© 2003-2015 Stimulsoft
Deployment 322
For loading a report from the assembly the following code is used:
C#:
VB.NET:
Reports, which are loaded from assembly, do not require compilation. It is impossible to edit such
reports in the report designer.
It is required to use the program code to compile standalone reports. It is impossible to create
standalone reports using the designer. The following code will create the standalone report:
© 2003-2015 Stimulsoft
323 Stimulsoft Reports
C#:
VB.NET:
It is important to remember that for working with standalone reports the Stimulsoft Reports libraries
are required. Besides, the report should get all data itself.
© 2003-2015 Stimulsoft