DevExpress 发布 Free 的 Lightswitch 打印报表控件.
2011-06-11 08:28
555 查看
期待的消息,终于出现。 收藏以备用。
1) First Look At The DevExpress LightSwitch Reporting Control
http://lightswitchhelpwebsite.com/Blog/tabid/61/EntryId/32/First-Look-At-The-DevExpress-LightSwitch-Reporting-Control.aspx
2)How to: Use XtraReports in LightSwitch Applications
http://documentation.devexpress.com/#XtraReports/CustomDocument9901
XtraReports > Examples > How to: Use XtraReports in LightSwitch Applications
This tutorial will guide you through the process of creating a simple LightSwitch application containing a report using Microsoft® Visual Studio® 2010 or Visual Studio® LightSwitch™. You will learn how to add a report to a LightSwitch application and bind it to a data source.
To create a data-aware report in a LightSwitch application, do the following.
Create a LightSwitch Application with an XtraReports Extension
Add a Data Source to the Application
Add a Report to the Application
Bind the Report to Data and Adjust Its Layout
Add a Screen and Show the Report
View the Result
Create a LightSwitch Application with an XtraReports Extension
Run Microsoft® Visual Studio® 2010 or Visual Studio® LightSwitch™.
Start a new project (CTRL+SHIFT+N) and create a new LightSwitch Application.
Switch to the Solution Explorer (CTRL+ALT+L), right-click Application1, and in the invoked menu, click Properties.
Then, in the Application Designer, switch to Extensions, and enable the check box near the DevExpress.XtraReports.LightSwitch extensions, to add it to the application.
Click Save to apply the changes, and close the Application Designer.
Back in the Solution Explorer, right-click the Data Sources folder and in the invoked menu, click Add Data Source...
On the first page of the invoked wizard, choose WCF RIA Service and click Next.
On the next page, the XtraReportsService is selected by default, so click Next.
On the last page, choose to include all entities and click Finish.
Add a Data Source to the Application
Although the following steps demonstrate how to use an external data source in your LightSwitch application, XtraReports fully supports working with intrinsic data sources as well.
In the Solution Explorer, right-click the Data Sources folder and in the invoked menu, click Add Data Source...
At this time, choose Database in the wizard, and click Next.
In the invoked Choose Data Source dialog, choose Microsoft SQL Server and click Continue.
Next, in the Connection Properties dialog, specify the server name, authentication mode and your database name.
Test the connection and click OK to proceed.
On the last wizard page, select the required table(s), and click Finish.
Add a Report to the Application
In the Solution Editor, switch to the File View.
Then, right-click Server, and in the invoked menu, choose Add | New Item...
In the Add New Item dialog, select the XtraReport Class v11.1 item, and click Add.
Bind the Report to Data and Adjust Its Layout
After the report is added, re-build your application.
Then, click the report's smart tag and in its actions list, invoke the drop-down list for the XtraReportBase.DataSource property and choose the existing data source.
Following this step, the Field List reflects the structure of your report's data source, and can be used to create data-aware controls.
To group a report's data, use the Group and Sort panel. To show this panel, right-click your report and in the invoked menu, choose Tool Windows and click Group And Sort.
Then, group the report by the Country field...
... and drop the corresponding item from the Field List onto the created Group Header band.
To provide a Document Map to your report, bind the XRControl.Bookmark property of the created XRLabel to the same data field.
Add a Screen and Show the Report
In the Solution Explorer, select Screens, and in the invoked menu, choose Add Screen...
In the Add New Screen dialog, select List and Detail Screen, and set the Screen Data to the selected table.
In the application designer, right-click the Screen Command Bar, and choose Add Button...
In the Add Button dialog, specify the name for the corresponding method, and click OK.
Handle the Execute() method of the button, and call the ReportPreview.Show() method with the specified report name (including its namespace).
View the Result
Run the application and click Show The Report.
The result is shown in the following image.
See Also
Current Limitations of LightSwitch Reporting
1) First Look At The DevExpress LightSwitch Reporting Control
http://lightswitchhelpwebsite.com/Blog/tabid/61/EntryId/32/First-Look-At-The-DevExpress-LightSwitch-Reporting-Control.aspx
2)How to: Use XtraReports in LightSwitch Applications
http://documentation.devexpress.com/#XtraReports/CustomDocument9901
XtraReports > Examples > How to: Use XtraReports in LightSwitch Applications
This tutorial will guide you through the process of creating a simple LightSwitch application containing a report using Microsoft® Visual Studio® 2010 or Visual Studio® LightSwitch™. You will learn how to add a report to a LightSwitch application and bind it to a data source.
To create a data-aware report in a LightSwitch application, do the following.
Create a LightSwitch Application with an XtraReports Extension
Add a Data Source to the Application
Add a Report to the Application
Bind the Report to Data and Adjust Its Layout
Add a Screen and Show the Report
View the Result
Create a LightSwitch Application with an XtraReports Extension
Run Microsoft® Visual Studio® 2010 or Visual Studio® LightSwitch™.
Start a new project (CTRL+SHIFT+N) and create a new LightSwitch Application.
Switch to the Solution Explorer (CTRL+ALT+L), right-click Application1, and in the invoked menu, click Properties.
Then, in the Application Designer, switch to Extensions, and enable the check box near the DevExpress.XtraReports.LightSwitch extensions, to add it to the application.
Click Save to apply the changes, and close the Application Designer.
Back in the Solution Explorer, right-click the Data Sources folder and in the invoked menu, click Add Data Source...
On the first page of the invoked wizard, choose WCF RIA Service and click Next.
On the next page, the XtraReportsService is selected by default, so click Next.
On the last page, choose to include all entities and click Finish.
Note |
---|
We do not recommend you change the data source name from its default value (XtraReportsServiceData), as well as names of other auto-generated entities and their attributes. Otherwise, the application will not work. |
Although the following steps demonstrate how to use an external data source in your LightSwitch application, XtraReports fully supports working with intrinsic data sources as well.
In the Solution Explorer, right-click the Data Sources folder and in the invoked menu, click Add Data Source...
At this time, choose Database in the wizard, and click Next.
In the invoked Choose Data Source dialog, choose Microsoft SQL Server and click Continue.
Next, in the Connection Properties dialog, specify the server name, authentication mode and your database name.
Test the connection and click OK to proceed.
On the last wizard page, select the required table(s), and click Finish.
Add a Report to the Application
In the Solution Editor, switch to the File View.
Then, right-click Server, and in the invoked menu, choose Add | New Item...
In the Add New Item dialog, select the XtraReport Class v11.1 item, and click Add.
Bind the Report to Data and Adjust Its Layout
After the report is added, re-build your application.
Then, click the report's smart tag and in its actions list, invoke the drop-down list for the XtraReportBase.DataSource property and choose the existing data source.
Following this step, the Field List reflects the structure of your report's data source, and can be used to create data-aware controls.
To group a report's data, use the Group and Sort panel. To show this panel, right-click your report and in the invoked menu, choose Tool Windows and click Group And Sort.
Then, group the report by the Country field...
... and drop the corresponding item from the Field List onto the created Group Header band.
To provide a Document Map to your report, bind the XRControl.Bookmark property of the created XRLabel to the same data field.
Add a Screen and Show the Report
In the Solution Explorer, select Screens, and in the invoked menu, choose Add Screen...
In the Add New Screen dialog, select List and Detail Screen, and set the Screen Data to the selected table.
In the application designer, right-click the Screen Command Bar, and choose Add Button...
In the Add Button dialog, specify the name for the corresponding method, and click OK.
Handle the Execute() method of the button, and call the ReportPreview.Show() method with the specified report name (including its namespace).
| ||||
partial void ShowTheReport_Execute() { ReportPreview.Show("LightSwitchApplication.XtraReport1"); } Private Sub ShowTheReport_Execute() ReportPreview.Show("XtraReport1") End Sub |
C# | partial void ShowTheReport_Execute() { ReportPreview.Show("LightSwitchApplication.XtraReport1"); } |
VB | Private Sub ShowTheReport_Execute() ReportPreview.Show("XtraReport1") End Sub |
Run the application and click Show The Report.
The result is shown in the following image.
See Also
Current Limitations of LightSwitch Reporting
相关文章推荐
- DevExpress 报表控件发布时需要引用的程序集
- 在DevExpress程序中使用条形码二维码控件,以及进行报表打印处理
- [DevExpress]程序中使用条形码二维码控件,以及进行报表打印处理
- 葡萄城发布新版ActiveReports 9报表控件和报表服务器
- 网页打印控件Lodop5.0已发布
- Devexpress Xtrareport 打印报表
- VS2008 水晶报表发布后无法打印的解决办法(转)
- Devexpress 控件做水晶报表小试牛刀(Master-Detail)!!!
- 服务器CrystalReports发布 水晶报表注册,菜单栏英文,打印界面英文
- DevExpress XtraReports控件创建主从报表的两种方法
- 发布一个框架的补充文件,引进highcharts等报表控件.
- DevExpress 报表控件特别慢的解决方法之一.
- 葡萄城发布新版ActiveReports 9报表控件和报表服务器
- [看到第三方控件,就头晕 系列] Microsoft.net 自定义打印简单报表
- RDLC报表打印控件使用说明
- 拥有超过20万用户的亚洲最畅销.NET报表控件ActiveReports发布v7.0版本
- Asp.net用到DevExpress控件发布到服务器出现的问题
- 顶级界面控件DevExpress发布v17.2.5|附下载
- 找到1款套打连续打印分页打印报表控件
- DevExpress Winform 所有可打印控件(gridcontrol等)通用导出excel方法